Chromium Code Reviews| 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); |