From 36612d27b67ff2e79ffff8eb12d95d2058abde02 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 24 Jul 2012 17:42:25 -0700 Subject: Move notification tests to LittleMock. Directly mock NotificationManager instead of using SystemFacade. Change-Id: If932d26e23816e8674469c275a828701cce5fc2d --- .../providers/downloads/FakeSystemFacade.java | 29 ---------------------- 1 file changed, 29 deletions(-) (limited to 'tests/src/com/android/providers/downloads/FakeSystemFacade.java') diff --git a/tests/src/com/android/providers/downloads/FakeSystemFacade.java b/tests/src/com/android/providers/downloads/FakeSystemFacade.java index c184de83..6898efdb 100644 --- a/tests/src/com/android/providers/downloads/FakeSystemFacade.java +++ b/tests/src/com/android/providers/downloads/FakeSystemFacade.java @@ -1,17 +1,13 @@ package com.android.providers.downloads; -import android.app.Notification; import android.content.Intent; import android.content.pm.PackageManager.NameNotFoundException; import android.net.ConnectivityManager; import android.net.NetworkInfo; -import android.test.AssertionFailedError; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.Queue; public class FakeSystemFacade implements SystemFacade { @@ -22,8 +18,6 @@ public class FakeSystemFacade implements SystemFacade { Long mMaxBytesOverMobile = null; Long mRecommendedMaxBytesOverMobile = null; List mBroadcastsSent = new ArrayList(); - Map mActiveNotifications = new HashMap(); - List mCanceledNotifications = new ArrayList(); Queue mStartedThreads = new LinkedList(); private boolean returnActualTime = false; @@ -73,29 +67,6 @@ public class FakeSystemFacade implements SystemFacade { return true; } - @Override - public void postNotification(long id, Notification notification) { - if (notification == null) { - throw new AssertionFailedError("Posting null notification"); - } - mActiveNotifications.put(id, notification); - } - - @Override - public void cancelNotification(long id) { - Notification notification = mActiveNotifications.remove(id); - if (notification != null) { - mCanceledNotifications.add(notification); - } - } - - @Override - public void cancelAllNotifications() { - for (long id : mActiveNotifications.keySet()) { - cancelNotification(id); - } - } - public boolean startThreadsWithoutWaiting = false; public void setStartThreadsWithoutWaiting(boolean flag) { this.startThreadsWithoutWaiting = flag; -- cgit v1.2.3