diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/android/app/HostNotifications.kt b/tools/chatgui-android/router-tests/src/main/kotlin/android/app/HostNotifications.kt index 3c68f11e..79e9539a 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/android/app/HostNotifications.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/android/app/HostNotifications.kt @@ -59,11 +59,13 @@ class NotificationManager { if ("security" in failures) throw SecurityException("notify denied") active[id] = notification posted.add(notification) + check("notify_after" !in failures) { "notification publish failed after effect" } } fun cancel(id: Int) { cancellations.add(id) check("cancel" !in failures) { "notification cancel unavailable" } active.remove(id) + check("cancel_after" !in failures) { "notification cancel failed after effect" } } } @@ -95,6 +97,7 @@ class PendingIntent private constructor(val kind: String, val requestCode: Int, } private var intent = Intent(intent) var failCancel = false + var failCancelAfter = false var cancelled = false private set var cancelCalls = 0 @@ -104,5 +107,6 @@ class PendingIntent private constructor(val kind: String, val requestCode: Int, cancelCalls++ check(!failCancel) { "pending intent cancel unavailable" } cancelled = true + check(!failCancelAfter) { "pending intent cancel failed after effect" } } } diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/android/os/HostPower.kt b/tools/chatgui-android/router-tests/src/main/kotlin/android/os/HostPower.kt index 84d142a0..84ecc44a 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/android/os/HostPower.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/android/os/HostPower.kt @@ -26,10 +26,14 @@ class PowerManager { var releaseCalls = 0 var held = false val isHeld: Boolean get() { check("query" !in failures) { "wake lock query unavailable" }; return held } - fun setReferenceCounted(value: Boolean) { counted = value } + fun setReferenceCounted(value: Boolean) { + check("configure" !in failures) { "wake lock configure unavailable" } + counted = value + } fun acquire() = acquire(0) fun acquire(timeout: Long) { this.timeout = timeout + check("acquire_before" !in failures) { "wake lock acquire before effect" } held = true check("acquire" !in failures) { "wake lock acquire unavailable" } } @@ -37,6 +41,7 @@ class PowerManager { releaseCalls++ check("release" !in failures) { "wake lock release unavailable" } held = false + check("release_after" !in failures) { "wake lock release failed after effect" } } } }