• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6import os
7
8from page_sets.login_helpers import google_login
9
10from telemetry import story
11from telemetry.page import page as page_module
12from telemetry.page import shared_page_state
13from telemetry.util import wpr_modes
14
15
16class 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_googledocs_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
36class SkiaGoogledocsDesktopPageSet(story.StorySet):
37  """ Pages designed to represent the median, not highly optimized web """
38
39  def __init__(self):
40    super(SkiaGoogledocsDesktopPageSet, self).__init__(
41      archive_data_file='data/skia_googledocs_desktop.json')
42
43    urls_list = [
44      # go/skia-skps-3-2019
45      ('https://docs.google.com/document/d/'
46       '1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfTpAPUSX3_s4/view'),
47    ]
48
49    for url in urls_list:
50      self.AddStory(SkiaDesktopPage(url, self))
51