summaryrefslogtreecommitdiffstats
path: root/tools/perf/page_sets/alexa1-10000.py
blob: 5aa392ba4ab16a344cafe4c8ed70250bf8d0a420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os

from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story


__location__ = os.path.realpath(
      os.path.join(os.getcwd(), os.path.dirname(__file__)))

# Generated on 2013-09-03 13:59:53.459117 by rmistry using
# create_page_set.py.
_TOP_10000_ALEXA_FILE = os.path.join(__location__, 'alexa1-10000-urls.json')


class Alexa1To10000Page(page_module.Page):

  def __init__(self, url, page_set):
    super(Alexa1To10000Page, self).__init__(
        url=url, page_set=page_set,
        shared_page_state_class=shared_page_state.SharedDesktopPageState)

  def RunPageInteractions(self, action_runner):
    with action_runner.CreateGestureInteraction('ScrollAction'):
      action_runner.ScrollPage()


class Alexa1To10000PageSet(story.StorySet):
  """ Top 1-10000 Alexa global.
      Generated on 2013-09-03 13:59:53.459117 by rmistry using
      create_page_set.py.
  """

  def __init__(self):
    super(Alexa1To10000PageSet, self).__init__()

    with open(_TOP_10000_ALEXA_FILE) as f:
      urls_list = json.load(f)
    for url in urls_list:
      self.AddStory(Alexa1To10000Page(url, self))