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

Side by Side Diff: tools/telemetry/telemetry/page/page.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import os 4 import os
5 import re 5 import re
6 import time 6 import time
7 import urlparse 7 import urlparse
8 8
9 from telemetry import util 9 from telemetry.core import util
10 10
11 class Page(object): 11 class Page(object):
12 def __init__(self, url, page_set, attributes=None, base_dir=None): 12 def __init__(self, url, page_set, attributes=None, base_dir=None):
13 parsed_url = urlparse.urlparse(url) 13 parsed_url = urlparse.urlparse(url)
14 if not parsed_url.scheme: 14 if not parsed_url.scheme:
15 abspath = os.path.abspath(os.path.join(base_dir, parsed_url.path)) 15 abspath = os.path.abspath(os.path.join(base_dir, parsed_url.path))
16 if os.path.exists(abspath): 16 if os.path.exists(abspath):
17 url = 'file://%s' % os.path.abspath(os.path.join(base_dir, url)) 17 url = 'file://%s' % os.path.abspath(os.path.join(base_dir, url))
18 else: 18 else:
19 raise Exception('URLs must be fully qualified: %s' % url) 19 raise Exception('URLs must be fully qualified: %s' % url)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 tab, obj.wait_for_element_with_text, callback_code), 87 tab, obj.wait_for_element_with_text, callback_code),
88 timeout, poll_interval) 88 timeout, poll_interval)
89 if hasattr(obj, 'wait_for_element_with_selector'): 89 if hasattr(obj, 'wait_for_element_with_selector'):
90 util.WaitFor(lambda: tab.EvaluateJavaScript( 90 util.WaitFor(lambda: tab.EvaluateJavaScript(
91 'document.querySelector(\'' + obj.wait_for_element_with_selector + 91 'document.querySelector(\'' + obj.wait_for_element_with_selector +
92 '\') != null'), timeout, poll_interval) 92 '\') != null'), timeout, poll_interval)
93 if hasattr(obj, 'wait_for_javascript_expression'): 93 if hasattr(obj, 'wait_for_javascript_expression'):
94 util.WaitFor( 94 util.WaitFor(
95 lambda: tab.EvaluateJavaScript(obj.wait_for_javascript_expression), 95 lambda: tab.EvaluateJavaScript(obj.wait_for_javascript_expression),
96 timeout, poll_interval) 96 timeout, poll_interval)
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/page/multi_page_benchmark_unittest_base.py ('k') | tools/telemetry/telemetry/page/page_action.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698