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

Unified Diff: tools/skpbench/_hardware.py

Issue 2360473002: Add hardware monitoring to skpbench (Closed)
Patch Set: Add hardware monitoring to skpbench Created 4 years, 3 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/skpbench/_adb_path.py ('k') | tools/skpbench/_hardware_android.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/_hardware.py
diff --git a/tools/skpbench/_hardware.py b/tools/skpbench/_hardware.py
new file mode 100644
index 0000000000000000000000000000000000000000..23cfc827bc97ccf44f98dee0549e7a04c564a8c6
--- /dev/null
+++ b/tools/skpbench/_hardware.py
@@ -0,0 +1,29 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import time
+
+class HardwareException(Exception):
+ def __init__(self, message, sleeptime=60):
+ Exception.__init__(self, message)
+ self.sleeptime = sleeptime
+
+class Hardware:
+ def __init__(self):
+ self.kick_in_time = 0
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exception_type, exception_value, traceback):
+ pass
+
+ def sanity_check(self):
+ '''Raises a HardwareException if any hardware state is not as expected.'''
+ pass
+
+ def sleep(self, sleeptime):
+ '''Puts the hardware into a resting state for a fixed amount of time.'''
+ time.sleep(sleeptime)
« no previous file with comments | « tools/skpbench/_adb_path.py ('k') | tools/skpbench/_hardware_android.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698