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

Side by Side Diff: tools/perf/page_sets/tough_ad_cases.py

Issue 1154243006: Disable deterministic Javascript for Swiffy benchmark pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 4
5 from telemetry.page import page as page_module 5 from telemetry.page import page as page_module
6 from telemetry.page import page_set as page_set_module 6 from telemetry.page import page_set as page_set_module
7 7
8 8
9 class SwiffyPage(page_module.Page): 9 class SwiffyPage(page_module.Page):
10 10
11 def __init__(self, url, page_set): 11 def __init__(self, url, page_set):
12 super(SwiffyPage, self).__init__(url=url, page_set=page_set) 12 super(SwiffyPage, self).__init__(url=url, page_set=page_set,
13 make_javascript_deterministic=False)
13 14
14 def RunNavigateSteps(self, action_runner): 15 def RunNavigateSteps(self, action_runner):
15 super(SwiffyPage, self).RunNavigateSteps(action_runner) 16 super(SwiffyPage, self).RunNavigateSteps(action_runner)
16 # Swiffy overwrites toString() to return a constant string, so "undo" that 17 # Swiffy overwrites toString() to return a constant string, so "undo" that
17 # here so that we don't think it has stomped over console.time. 18 # here so that we don't think it has stomped over console.time.
18 action_runner.EvaluateJavaScript( 19 action_runner.EvaluateJavaScript(
19 'Function.prototype.toString = function() { return "[native code]"; }') 20 'Function.prototype.toString = function() { return "[native code]"; }')
20 # Make sure we have a reasonable viewport for mobile. 21 # Make sure we have a reasonable viewport for mobile.
21 viewport_js = ( 22 viewport_js = (
22 'var meta = document.createElement("meta");' 23 'var meta = document.createElement("meta");'
(...skipping 28 matching lines...) Expand all
51 'shapes-CICAgMDO7cfIzwEQ1AMYPCgBMghqY8tqyRCArQ.swiffy72.html', 52 'shapes-CICAgMDO7cfIzwEQ1AMYPCgBMghqY8tqyRCArQ.swiffy72.html',
52 'CICAgIDQ2Pb-MxCsAhj6ASgBMgi5DLoSO0gPbQ.swiffy72.html', 53 'CICAgIDQ2Pb-MxCsAhj6ASgBMgi5DLoSO0gPbQ.swiffy72.html',
53 'CICAgKCN39CopQEQoAEY2AQoATIID59gK5hjjIg.swiffy72.html', 54 'CICAgKCN39CopQEQoAEY2AQoATIID59gK5hjjIg.swiffy72.html',
54 'CICAgKCNj4HgyAEQeBjYBCgBMgjQpPkOjyWNdw.1.swiffy72.html', 55 'CICAgKCNj4HgyAEQeBjYBCgBMgjQpPkOjyWNdw.1.swiffy72.html',
55 'clip-paths-CILZhLqO_-27bxB4GNgEKAEyCC46kMLBXnMT.swiffy72.html', 56 'clip-paths-CILZhLqO_-27bxB4GNgEKAEyCC46kMLBXnMT.swiffy72.html',
56 'CICAgMDOrcnRGRB4GNgEKAEyCP_ZBSfwUFsj.swiffy72.html', 57 'CICAgMDOrcnRGRB4GNgEKAEyCP_ZBSfwUFsj.swiffy72.html',
57 ] 58 ]
58 for page_name in swiffy_pages: 59 for page_name in swiffy_pages:
59 url = base_url + '/' + page_name 60 url = base_url + '/' + page_name
60 self.AddUserStory(SwiffyPage(url, self)) 61 self.AddUserStory(SwiffyPage(url, self))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698