diff options
Diffstat (limited to 'tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java')
-rw-r--r-- | tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java b/tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java index 6077b21f7c2..a535bb050d0 100644 --- a/tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java +++ b/tests/tests/permission/src/android/permission/cts/BackgroundPermissionsTest.java @@ -30,7 +30,7 @@ import static android.permission.cts.PermissionUtils.uninstallApp; import static com.android.compatibility.common.util.SystemUtil.eventually; -import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -126,8 +126,8 @@ public class BackgroundPermissionsTest { install(APK_LOCATION_29v4); - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "foreground app-op").isEqualTo(MODE_FOREGROUND)); + eventually(() -> assertWithMessage("foreground app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_FOREGROUND)); } /** @@ -141,8 +141,8 @@ public class BackgroundPermissionsTest { install(APK_LOCATION_BACKGROUND_29); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_IGNORED)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_IGNORED)); } /** @@ -157,8 +157,8 @@ public class BackgroundPermissionsTest { sUiAutomation.grantRuntimePermission(APP_PKG, ACCESS_COARSE_LOCATION); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_FOREGROUND)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_FOREGROUND)); } /** @@ -174,8 +174,8 @@ public class BackgroundPermissionsTest { sUiAutomation.grantRuntimePermission(APP_PKG, ACCESS_BACKGROUND_LOCATION); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_ALLOWED)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_ALLOWED)); } /** @@ -191,8 +191,8 @@ public class BackgroundPermissionsTest { // Wait until the system sets the app-op automatically // Fine location uses background location to limit access - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_FOREGROUND)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_FOREGROUND)); } /** @@ -208,8 +208,8 @@ public class BackgroundPermissionsTest { sUiAutomation.grantRuntimePermission(APP_PKG, ACCESS_BACKGROUND_LOCATION); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_ALLOWED)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_ALLOWED)); } /** @@ -225,8 +225,8 @@ public class BackgroundPermissionsTest { sUiAutomation.grantRuntimePermission(APP_PKG, ACCESS_COARSE_LOCATION); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_FOREGROUND)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_FOREGROUND)); } /** @@ -244,7 +244,7 @@ public class BackgroundPermissionsTest { sUiAutomation.grantRuntimePermission(APP_PKG, ACCESS_BACKGROUND_LOCATION); // Wait until the system sets the app-op automatically - eventually(() -> assertThat(getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).named( - "loc app-op").isEqualTo(MODE_ALLOWED)); + eventually(() -> assertWithMessage("loc app-op").that( + getAppOp(APP_PKG, ACCESS_COARSE_LOCATION)).isEqualTo(MODE_ALLOWED)); } } |