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

Unified Diff: chrome/test/functional/tracing/tracing_js_executor.py

Issue 10736055: Smoke test for tracing infrastructure in PyAuto (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use argument slices rather than explicit argument lists where appropriate. Created 8 years, 5 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/functional/tracing/tracing_js_executor.py
diff --git a/chrome/test/functional/tracing/tracing_js_executor.py b/chrome/test/functional/tracing/tracing_js_executor.py
new file mode 100644
index 0000000000000000000000000000000000000000..6a27654789d5489320a47c85d93e3fc30474c2c3
--- /dev/null
+++ b/chrome/test/functional/tracing/tracing_js_executor.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+
+class TracingJsExecutor:
+ def __init__(self, js_host, win_idx = 0, tab_idx = 0):
nduca 2012/07/20 07:13:13 I think you should just put this file into the tes
+ self._js_host = js_host
+ self._win_idx = win_idx
+ self._tab_idx = tab_idx
+
+ def ExecuteJavascript(self, js):
+ return self._js_host.ExecuteJavascript(
+ js = js,
+ windex = self._win_idx,
+ tab_index = self._tab_idx
+ )
+
+ def ExecuteJavascriptFile(self, fileName):
+ fileJs, fd = (None, None)
+ try:
+ fd = open(os.path.join(os.path.dirname(__file__), fileName), "r")
+ fileJs = fd.read()
+ finally:
+ if fd:
+ fd.close()
+ return self.ExecuteJavascript(fileJs);

Powered by Google App Engine
This is Rietveld 408576698