Debian Codegraph @

tools/skp/page_sets/skia_googlecalendar_desktop.py

raw
1 # Copyright 2019 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 # pylint: disable=W0401,W0614
5
6 import os
7
8 from page_sets.login_helpers import google_login
9
10 from telemetry import story
11 from telemetry.page import page as page_module
12 from telemetry.page import shared_page_state
13 from telemetry.util import wpr_modes
14
15
16 class SkiaDesktopPage(page_module.Page):
17
18 def __init__(self, url, page_set):
19 super(SkiaDesktopPage, self).__init__(
20 url=url,
21 name=url,
22 page_set=page_set,
23 shared_page_state_class=shared_page_state.SharedDesktopPageState)
24 self.archive_data_file = 'data/skia_googlecalendar_desktop.json'
25
26 def RunNavigateSteps(self, action_runner):
27 if self.wpr_mode != wpr_modes.WPR_REPLAY:
28 credentials_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),
29 'data/credentials.json')
30 google_login.BaseLoginGoogle(action_runner, 'google', credentials_path)
31 action_runner.Wait(15)
32 action_runner.Navigate(self.url)
33 action_runner.Wait(15)
34
35
36 class SkiaGooglecalendarDesktopPageSet(story.StorySet):
37 """ Pages designed to represent the median, not highly optimized web """
38
39 def __init__(self):
40 super(SkiaGooglecalendarDesktopPageSet, self).__init__(
41 archive_data_file='data/skia_googlecalendar_desktop.json')
42
43 urls_list = [
44 # go/skia-skps-3-2019
45 'https://www.google.com/calendar/',
46 ]
47
48 for url in urls_list:
49 self.AddStory(SkiaDesktopPage(url, self))