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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6
7 class TracingJsExecutor:
8 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
9 self._js_host = js_host
10 self._win_idx = win_idx
11 self._tab_idx = tab_idx
12
13 def ExecuteJavascript(self, js):
14 return self._js_host.ExecuteJavascript(
15 js = js,
16 windex = self._win_idx,
17 tab_index = self._tab_idx
18 )
19
20 def ExecuteJavascriptFile(self, fileName):
21 fileJs, fd = (None, None)
22 try:
23 fd = open(os.path.join(os.path.dirname(__file__), fileName), "r")
24 fileJs = fd.read()
25 finally:
26 if fd:
27 fd.close()
28 return self.ExecuteJavascript(fileJs);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698