summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakayuki Hoshi <hoshi@google.com>2014-10-21 01:38:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-21 01:38:49 +0000
commit1d82a8f57f47f61e3cd87cb13121ff78d1ac1195 (patch)
tree3685698a818b801b59b4e1a6e61ee9f9d83b187c
parent208e9088a95bddd77b82a043182a48166de542d0 (diff)
parentd1888fab2ddf8cc4be6cca50ecd00610bae4f920 (diff)
downloadcts-lollipop-dev.tar.gz
Merge "Fix LocationManagerTest#testGpsStatusListener test failure on fugu/molly/MTK boards." into lmp-devlollipop-dev
-rw-r--r--tests/tests/location2/src/android/location2/cts/LocationManagerTest.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/tests/location2/src/android/location2/cts/LocationManagerTest.java b/tests/tests/location2/src/android/location2/cts/LocationManagerTest.java
index f330e8a2e66..3765809bc33 100644
--- a/tests/tests/location2/src/android/location2/cts/LocationManagerTest.java
+++ b/tests/tests/location2/src/android/location2/cts/LocationManagerTest.java
@@ -227,15 +227,18 @@ public class LocationManagerTest extends InstrumentationTestCase {
@UiThreadTest
public void testGpsStatusListener() {
try {
- mManager.addGpsStatusListener(new MockGpsStatusListener());
- fail("Should have failed to add a gps status listener");
+ // .addGpsStatusListener returns true if the listener added successfully
+ if (mManager.addGpsStatusListener(new MockGpsStatusListener())) {
+ fail("Should have failed to add a gps status listener");
+ }
} catch (SecurityException e) {
// expected
}
try {
- mManager.addGpsStatusListener(null);
- fail("Should have failed to add a gps status listener");
+ if (mManager.addGpsStatusListener(null)) {
+ fail("Should have failed to add null as a gps status listener");
+ }
} catch (SecurityException e) {
// expected
}