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

Unified Diff: tools/telemetry/telemetry/tab.py

Issue 11360172: Added Tab.SnapshotContent and MapsGL example to telemetry (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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: tools/telemetry/telemetry/tab.py
diff --git a/tools/telemetry/telemetry/tab.py b/tools/telemetry/telemetry/tab.py
index 527a2e00fb94aea172a4d30a64c7a9106a2856e4..1e3825708e17243817da2742f284571dcee8f1ba 100644
--- a/tools/telemetry/telemetry/tab.py
+++ b/tools/telemetry/telemetry/tab.py
@@ -5,6 +5,7 @@ from telemetry import inspector_console
from telemetry import inspector_page
from telemetry import inspector_runtime
from telemetry import util
+from telemetry import snapshot
DEFAULT_TAB_TIMEOUT = 60
@@ -75,3 +76,23 @@ class Tab(object):
rs = self._runtime.Evaluate('document.readyState')
return rs == 'complete' or rs == 'interactive'
util.WaitFor(IsReadyStateInteractiveOrBetter, timeout)
+
nduca 2012/11/09 21:19:00 This should be a feature on inspector_page.py ---
+ def SnapshotContent(self, timeout=DEFAULT_TAB_TIMEOUT):
nduca 2012/11/09 21:19:00 So, what if someone calls this and the gpuBenchmar
nduca 2012/11/09 21:19:00 "content"? That would imply we're taking a picture
+ self._runtime.Evaluate("""
nduca 2012/11/09 21:19:00 This function should have """Help text""" that exp
+ window.chrome.gpuBenchmarking.snapshotComplete = false;
+ window.chrome.gpuBenchmarking.windowSnapshot(function(snapshot) {
+ window.chrome.gpuBenchmarking.snapshotData = snapshot;
+ window.chrome.gpuBenchmarking.snapshotComplete = true;
+ });
+ """)
+
+ def IsSnapshotComplete():
+ return self._runtime.Evaluate(
+ 'window.chrome.gpuBenchmarking.snapshotComplete')
+
+ util.WaitFor(IsSnapshotComplete, timeout)
+
+ snap = self._runtime.Evaluate('window.chrome.gpuBenchmarking.snapshotData')
+ if snap:
+ return snapshot.Snapshot(snap['data'])
+ return None
« tools/telemetry/telemetry/snapshot.py ('K') | « tools/telemetry/telemetry/snapshot.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698