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

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

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 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 | « tools/perf/page_sets/blob_workshop.py ('k') | tools/perf/page_sets/google_pages.py » ('j') | 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 from telemetry.page import page as page_module 4 from telemetry.page import page as page_module
5 from telemetry import story 5 from telemetry import story
6 6
7 7
8 class DummyPage(page_module.Page): 8 class DummyPage(page_module.Page):
9 9
10 def __init__(self, page_set): 10 def __init__(self, page_set):
11 super(DummyPage, self).__init__( 11 super(DummyPage, self).__init__(
12 url='file://dummy_pages/dummy_page.html', 12 url='file://dummy_pages/dummy_page.html',
13 page_set=page_set) 13 page_set=page_set)
14 14
15 def RunPageInteractions(self, action_runner): 15 def RunPageInteractions(self, action_runner):
16 assert action_runner.EvaluateJavaScript2('1 + window.__dummy_value') == 2 16 assert action_runner.EvaluateJavaScript('1 + window.__dummy_value') == 2
17 17
18 18
19 class BrokenDummyPage(page_module.Page): 19 class BrokenDummyPage(page_module.Page):
20 20
21 def __init__(self, page_set): 21 def __init__(self, page_set):
22 super(BrokenDummyPage, self).__init__( 22 super(BrokenDummyPage, self).__init__(
23 url='file://dummy_pages/dummy_page.html', 23 url='file://dummy_pages/dummy_page.html',
24 name='Broken dummy page', 24 name='Broken dummy page',
25 page_set=page_set) 25 page_set=page_set)
26 26
27 def RunPageInteractions(self, action_runner): 27 def RunPageInteractions(self, action_runner):
28 # The call below should raise an AssertionError 28 # The call below should raise an AssertionError
29 assert action_runner.EvaluateJavaScript2('1 + window.__dummy_value') == 3 29 assert action_runner.EvaluateJavaScript('1 + window.__dummy_value') == 3
30 30
31 31
32 class DummyStorySet(story.StorySet): 32 class DummyStorySet(story.StorySet):
33 33
34 def __init__(self): 34 def __init__(self):
35 super(DummyStorySet, self).__init__() 35 super(DummyStorySet, self).__init__()
36 self.AddStory(DummyPage(self)) 36 self.AddStory(DummyPage(self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/blob_workshop.py ('k') | tools/perf/page_sets/google_pages.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698