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

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

Issue 1782123002: [Telemetry] Remove new_tab benchmark & related page sets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update benchmark_smoke_unittest Created 4 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/data/new_tab_page_page_001.wpr.sha1 ('k') | 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
(Empty)
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
3 # found in the LICENSE file.
4 import time
5
6 from telemetry.page import page as page_module
7 from telemetry.page import shared_page_state
8 from telemetry import story
9
10 INTERACTION_NAME = 'Interaction.PageLoading'
11
12 # How long to wait for the page to finish rendering.
13 LOADING_DELAY_S = 5
14
15
16 class NewTabPagePage(page_module.Page):
17
18 def __init__(self, page_set):
19 super(NewTabPagePage, self).__init__(
20 name='newtabpagepage',
21 url='chrome://newtab',
22 shared_page_state_class=shared_page_state.SharedDesktopPageState,
23 page_set=page_set)
24 self.archive_data_file = 'data/new_tab_page_page.json'
25 self.script_to_evaluate_on_commit = (
26 "console.time('" + INTERACTION_NAME + "');")
27
28 def RunNavigateSteps(self, action_runner):
29 url = self.file_path_url_with_scheme if self.is_file else self.url
30 action_runner.Navigate(
31 url, script_to_evaluate_on_commit=self.script_to_evaluate_on_commit)
32 # We pause for a while so the async JS gets a chance to run.
33 time.sleep(LOADING_DELAY_S)
34 # TODO(beaudoin): We have no guarantee the page has fully rendered and the
35 # JS has fully executed at that point. The right way to do it would be to
36 # toggle a Javascript variable in the page code and to wait for it here.
37 # This should be done when window.performance.mark is supported and we
38 # migrate to it instead of calling console.timeEnd here. If the test is
39 # failing flakily, we should use a better heuristic.
40 action_runner.ExecuteJavaScript(
41 "console.timeEnd('" + INTERACTION_NAME + "');")
42
43
44 class NewTabPagePageSet(story.StorySet):
45 def __init__(self):
46 super(NewTabPagePageSet, self).__init__(
47 archive_data_file='data/new_tab_page_page.json',
48 cloud_storage_bucket=story.PUBLIC_BUCKET)
49 self.AddStory(NewTabPagePage(page_set=self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/data/new_tab_page_page_001.wpr.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698