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

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 6760013: GetBatteryInfo() battery automation hook. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index edb424356cdb7a6f42977c02ac0d607d58dac472..390c9bc29d42c677dcfe5a867f170eea716c8236 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -2371,6 +2371,27 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
cmd_dict = { 'command': 'SignoutInScreenLocker' }
self._GetResultFromJSONRequest(cmd_dict, windex=-1)
+ def GetBatteryInfo(self):
+ """Get details about battery state.
+
+ Returns:
+ A dictionary.
+ Sample:
+ { u'battery': True,
+ u'line_power': False,
+ u'time_left': 29617, # 0 if the time left is still being calculated.
Nirnimesh 2011/03/29 01:29:39 Using 0 for 'still being calculated' case is incor
dtu 2011/03/29 02:21:22 Done. Key will be absent in the 'still being calcu
+ u'percentage': 100.0,
+ u'charged': False }
+
+ Use 'charged' instead of 'percentage' to determine whether the
+ battery is fully charged, since the percentage is only approximate.
+
krisr 2011/03/29 01:02:01 I actually had to look at the device to see how th
dtu 2011/03/29 02:21:22 Comment expanded. I also changed it so fields only
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = { 'command': 'GetBatteryInfo' }
+ return self._GetResultFromJSONRequest(cmd_dict, windex=-1)
+
def GetNetworkInfo(self):
"""Get details about ethernet, wifi, and cellular networks on chromeos.
« chrome/test/functional/chromeos_basic.py ('K') | « chrome/test/functional/chromeos_basic.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698