Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py

Issue 1004833003: [Telemetry][Android] Add support for turning screen off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/platform/android_platform_backend.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py b/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
index 4d19ff289185865919da5ad48a6c3b05dfc6434c..6324c63fd0afb38ea2dfa123c6e69df3e1ff6fb3 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
@@ -85,3 +85,39 @@ class AndroidPlatformBackendTest(unittest.TestCase):
android_device.AndroidDevice('success'), self._options)
backend.InstallTestCa()
self.assertTrue(backend.is_test_ca_installed)
+
+ def testIsScreenLockedTrue(self):
+ test_input = ['a=b', 'mHasBeenInactive=true']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertTrue(backend._IsScreenLocked(test_input))
+
+ def testIsScreenLockedFalse(self):
+ test_input = ['a=b', 'mHasBeenInactive=false']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertFalse(backend._IsScreenLocked(test_input))
+
+ def testIsScreenOnmScreenOnTrue(self):
+ test_input = ['a=b', 'mScreenOn=true']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertTrue(backend._IsScreenOn(test_input))
+
+ def testIsScreenOnmScreenOnFalse(self):
+ test_input = ['a=b', 'mScreenOn=false']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertFalse(backend._IsScreenOn(test_input))
+
+ def testIsScreenOnmInteractiveTrue(self):
+ test_input = ['a=b', 'mInteractive=true']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertTrue(backend._IsScreenOn(test_input))
+
+ def testIsScreenOnmInteractiveFalse(self):
+ test_input = ['a=b', 'mInteractive=false']
+ backend = android_platform_backend.AndroidPlatformBackend(
+ android_device.AndroidDevice('success'), self._options)
+ self.assertFalse(backend._IsScreenOn(test_input))
« no previous file with comments | « tools/telemetry/telemetry/core/platform/android_platform_backend.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698