OLD | NEW |
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 Loading... |
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)) |
OLD | NEW |