summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 23:09:03 +0000
committernednguyen@google.com <nednguyen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 23:09:03 +0000
commit415247bf2eac6fe24ec2cd707f27f0cbd36baf4a (patch)
tree4b9825c964f747fb1d83b25e4355289c47a8340d
parent93c28791b9b7f0a17acf851b0e8d76027d44a384 (diff)
downloadchromium_src-415247bf2eac6fe24ec2cd707f27f0cbd36baf4a.zip
chromium_src-415247bf2eac6fe24ec2cd707f27f0cbd36baf4a.tar.gz
chromium_src-415247bf2eac6fe24ec2cd707f27f0cbd36baf4a.tar.bz2
Convert 8 more page sets in perf/page_sets to python.
BUG=239179 Review URL: https://codereview.chromium.org/243503002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264883 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/perf/benchmarks/endure.py8
-rw-r--r--tools/perf/benchmarks/image_decoding.py4
-rw-r--r--tools/perf/benchmarks/media.py2
-rw-r--r--tools/perf/benchmarks/smoothness.py2
-rw-r--r--tools/perf/benchmarks/tab_switching.py2
-rw-r--r--tools/perf/page_sets/browser_control.json12
-rw-r--r--tools/perf/page_sets/browser_control.py32
-rw-r--r--tools/perf/page_sets/browser_control_click.json21
-rw-r--r--tools/perf/page_sets/browser_control_click.py58
-rw-r--r--tools/perf/page_sets/calendar_forward_backward.json46
-rw-r--r--tools/perf/page_sets/calendar_forward_backward.py163
-rw-r--r--tools/perf/page_sets/five_blank_pages.json10
-rw-r--r--tools/perf/page_sets/five_blank_pages.py17
-rw-r--r--tools/perf/page_sets/image_decoding_measurement.json15
-rw-r--r--tools/perf/page_sets/image_decoding_measurement.py45
-rw-r--r--tools/perf/page_sets/indexeddb_offline.json24
-rw-r--r--tools/perf/page_sets/indexeddb_offline.py72
-rw-r--r--tools/perf/page_sets/maps.json16
-rw-r--r--tools/perf/page_sets/maps.py35
-rw-r--r--tools/perf/page_sets/media_cns_cases.json139
-rw-r--r--tools/perf/page_sets/media_cns_cases.py136
21 files changed, 567 insertions, 292 deletions
diff --git a/tools/perf/benchmarks/endure.py b/tools/perf/benchmarks/endure.py
index f480931..7cbffff 100644
--- a/tools/perf/benchmarks/endure.py
+++ b/tools/perf/benchmarks/endure.py
@@ -29,15 +29,15 @@ class _EndureBenchmark(test.Test):
class EndureCalendarForwardBackward(_EndureBenchmark):
- page_set = 'page_sets/calendar_forward_backward.json'
+ page_set = 'page_sets/calendar_forward_backward.py'
class EndureBrowserControl(_EndureBenchmark):
- page_set = 'page_sets/browser_control.json'
+ page_set = 'page_sets/browser_control.py'
class EndureBrowserControlClick(_EndureBenchmark):
- page_set = 'page_sets/browser_control_click.json'
+ page_set = 'page_sets/browser_control_click.py'
class EndureGmailAltThreadlistConversation(_EndureBenchmark):
@@ -53,7 +53,7 @@ class EndureGmailExpandCollapseConversation(_EndureBenchmark):
class EndureIndexedDBOffline(_EndureBenchmark):
- page_set = 'page_sets/indexeddb_offline.json'
+ page_set = 'page_sets/indexeddb_offline.py'
class EndurePlusAltPostsPhotos(_EndureBenchmark):
diff --git a/tools/perf/benchmarks/image_decoding.py b/tools/perf/benchmarks/image_decoding.py
index c83f88b..7611f58 100644
--- a/tools/perf/benchmarks/image_decoding.py
+++ b/tools/perf/benchmarks/image_decoding.py
@@ -9,5 +9,5 @@ from measurements import image_decoding
class ImageDecodingToughImageCases(test.Test):
test = image_decoding.ImageDecoding
- # TODO: Rename this page set to tough_image_cases.json
- page_set = 'page_sets/image_decoding_measurement.json'
+ # TODO: Rename this page set to tough_image_cases.py
+ page_set = 'page_sets/image_decoding_measurement.py'
diff --git a/tools/perf/benchmarks/media.py b/tools/perf/benchmarks/media.py
index e784a21..5237c34 100644
--- a/tools/perf/benchmarks/media.py
+++ b/tools/perf/benchmarks/media.py
@@ -30,7 +30,7 @@ class Media(test.Test):
class MediaNetworkSimulation(test.Test):
"""Obtains media metrics under different network simulations."""
test = media.Media
- page_set = 'page_sets/media_cns_cases.json'
+ page_set = 'page_sets/media_cns_cases.py'
class MediaAndroid(test.Test):
diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py
index f0cc1dd..ea4bfc7 100644
--- a/tools/perf/benchmarks/smoothness.py
+++ b/tools/perf/benchmarks/smoothness.py
@@ -28,7 +28,7 @@ class SmoothnessToughWebGLCases(test.Test):
class SmoothnessMaps(test.Test):
test = smoothness.Smoothness
- page_set = 'page_sets/maps.json'
+ page_set = 'page_sets/maps.py'
class SmoothnessKeyMobileSites(test.Test):
diff --git a/tools/perf/benchmarks/tab_switching.py b/tools/perf/benchmarks/tab_switching.py
index 132cd24..d04cafe 100644
--- a/tools/perf/benchmarks/tab_switching.py
+++ b/tools/perf/benchmarks/tab_switching.py
@@ -13,7 +13,7 @@ class TabSwitchingTop10(test.Test):
class TabSwitchingFiveBlankTabs(test.Test):
test = tab_switching.TabSwitching
- page_set = 'page_sets/five_blank_pages.json'
+ page_set = 'page_sets/five_blank_pages.py'
options = {'pageset_repeat': 10}
class TabSwitchingToughEnergyCases(test.Test):
diff --git a/tools/perf/page_sets/browser_control.json b/tools/perf/page_sets/browser_control.json
deleted file mode 100644
index 1ac76a7..0000000
--- a/tools/perf/page_sets/browser_control.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "description": "Chrome Endure control test for the browser.",
- "user_agent_type": "desktop",
- "pages": [
- {
- "url": "file://endure/browser_control.html",
- "name": "browser_control",
- "why": "Continually attach and detach a DOM tree from a basic document.",
- "endure": { "action": "wait", "seconds": 2 }
- }
- ]
-}
diff --git a/tools/perf/page_sets/browser_control.py b/tools/perf/page_sets/browser_control.py
new file mode 100644
index 0000000..3bf327e
--- /dev/null
+++ b/tools/perf/page_sets/browser_control.py
@@ -0,0 +1,32 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class BrowserControlPage(page_module.PageWithDefaultRunNavigate):
+ """ Why: Continually attach and detach a DOM tree from a basic document. """
+
+ def __init__(self, page_set):
+ super(BrowserControlPage, self).__init__(
+ url='file://endure/browser_control.html',
+ page_set=page_set)
+ self.user_agent_type = 'desktop'
+ self.name = 'browser_control'
+
+ def RunEndure(self, action_runner):
+ action_runner.RunAction(WaitAction({'seconds': 2}))
+
+
+class BrowserControlPageSet(page_set_module.PageSet):
+
+ """ Chrome Endure control test for the browser. """
+
+ def __init__(self):
+ super(BrowserControlPageSet, self).__init__(
+ user_agent_type='desktop')
+
+ self.AddPage(BrowserControlPage(self))
diff --git a/tools/perf/page_sets/browser_control_click.json b/tools/perf/page_sets/browser_control_click.json
deleted file mode 100644
index 845ded6..0000000
--- a/tools/perf/page_sets/browser_control_click.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "description": "Chrome Endure control test for the browser.",
- "user_agent_type": "desktop",
- "pages": [
- {
- "url": "file://endure/browser_control_click.html",
- "name": "browser_control_click",
- "why": "Use a JavaScript .click() call to attach and detach a DOM tree from a basic document.",
- "navigate_steps": [
- { "action": "navigate" },
- { "action": "wait", "condition": "element", "xpath": "id(\"attach\")" }
- ],
- "endure": [
- { "action": "javascript_click", "xpath": "id(\"attach\")" },
- { "action": "wait", "seconds": 0.5 },
- { "action": "javascript_click", "xpath": "id(\"detach\")" },
- { "action": "wait", "seconds": 0.5 }
- ]
- }
- ]
-}
diff --git a/tools/perf/page_sets/browser_control_click.py b/tools/perf/page_sets/browser_control_click.py
new file mode 100644
index 0000000..b6e1015
--- /dev/null
+++ b/tools/perf/page_sets/browser_control_click.py
@@ -0,0 +1,58 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class BrowserControlClickPage(page_module.PageWithDefaultRunNavigate):
+
+ """ Why: Use a JavaScript .click() call to attach and detach a DOM tree
+ from a basic document.
+ """
+
+ def __init__(self, page_set):
+ super(BrowserControlClickPage, self).__init__(
+ url='file://endure/browser_control_click.html',
+ page_set=page_set)
+ self.user_agent_type = 'desktop'
+ self.name = 'browser_control_click'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(WaitAction(
+ {
+ 'xpath': 'id("attach")',
+ 'condition': 'element'
+ }))
+
+ def RunEndure(self, action_runner):
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'xpath': 'id("attach")'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 0.5
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'xpath': 'id("detach")'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 0.5
+ }))
+
+
+class BrowserControlClickPageSet(page_set_module.PageSet):
+
+ """ Chrome Endure control test for the browser. """
+
+ def __init__(self):
+ super(BrowserControlClickPageSet, self).__init__(
+ user_agent_type='desktop')
+
+ self.AddPage(BrowserControlClickPage(self))
diff --git a/tools/perf/page_sets/calendar_forward_backward.json b/tools/perf/page_sets/calendar_forward_backward.json
deleted file mode 100644
index a3b48e1..0000000
--- a/tools/perf/page_sets/calendar_forward_backward.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "description": "Chrome Endure test for Google Calendar.",
- "archive_data_file": "data/calendar_forward_backward.json",
- "credentials_path": "data/credentials.json",
- "user_agent_type": "desktop",
- "pages": [
- {
- "url": "https://www.google.com/calendar/",
- "name": "calendar_forward_backward",
- "why": "Click forward(4x) and backwards(4x) repeatedly",
- "credentials": "google",
- "navigate_steps" : [
- { "action": "navigate" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navForward\"]" },
- { "action": "javascript", "expression": "(function() { var elem = document.createElement('meta');elem.name='viewport';elem.content='initial-scale=1';document.body.appendChild(elem); })();" }
- ],
- "endure": [
- { "action": "javascript_click", "selector": "div[class~=\"navForward\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navForward\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navForward\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navForward\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navForward\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navForward\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navForward\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navBack\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navBack\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navBack\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navBack\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navBack\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navBack\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navBack\"]" },
- { "action": "javascript_click", "selector": "div[class~=\"navBack\"]" },
- { "action": "wait", "seconds": 2 },
- { "action": "wait", "condition": "element", "selector": "div[class~=\"navForward\"]" }
- ]
- }
- ]
-}
diff --git a/tools/perf/page_sets/calendar_forward_backward.py b/tools/perf/page_sets/calendar_forward_backward.py
new file mode 100644
index 0000000..b8b6825
--- /dev/null
+++ b/tools/perf/page_sets/calendar_forward_backward.py
@@ -0,0 +1,163 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class CalendarForwardBackwardPage(page_module.PageWithDefaultRunNavigate):
+
+ """ Why: Click forward(4x) and backwards(4x) repeatedly """
+
+ def __init__(self, page_set):
+ super(CalendarForwardBackwardPage, self).__init__(
+ url='https://www.google.com/calendar/',
+ page_set=page_set)
+ self.credentials_path = 'data/credentials.json'
+ self.credentials = 'google'
+ self.user_agent_type = 'desktop'
+ self.archive_data_file = 'data/calendar_forward_backward.json'
+ self.name = 'calendar_forward_backward'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(JavascriptAction(
+ {
+ 'expression': '''
+ (function() {
+ var elem = document.createElement('meta');
+ elem.name='viewport';
+ elem.content='initial-scale=1';
+ document.body.appendChild(elem);
+ })();'''
+ }))
+
+ def RunEndure(self, action_runner):
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navForward"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'div[class~="navBack"]'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 2
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'div[class~="navForward"]'
+ }))
+
+
+class CalendarForwardBackwardPageSet(page_set_module.PageSet):
+
+ """ Chrome Endure test for Google Calendar. """
+
+ def __init__(self):
+ super(CalendarForwardBackwardPageSet, self).__init__(
+ credentials_path='data/credentials.json',
+ user_agent_type='desktop',
+ archive_data_file='data/calendar_forward_backward.json')
+
+ self.AddPage(CalendarForwardBackwardPage(self))
diff --git a/tools/perf/page_sets/five_blank_pages.json b/tools/perf/page_sets/five_blank_pages.json
deleted file mode 100644
index 9b1de59..0000000
--- a/tools/perf/page_sets/five_blank_pages.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "description": "Five blank pages.",
- "pages": [
- { "url": "file://blank_page/blank_page.html" },
- { "url": "file://blank_page/blank_page.html" },
- { "url": "file://blank_page/blank_page.html" },
- { "url": "file://blank_page/blank_page.html" },
- { "url": "file://blank_page/blank_page.html" }
- ]
-}
diff --git a/tools/perf/page_sets/five_blank_pages.py b/tools/perf/page_sets/five_blank_pages.py
new file mode 100644
index 0000000..eec1a92
--- /dev/null
+++ b/tools/perf/page_sets/five_blank_pages.py
@@ -0,0 +1,17 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+class FiveBlankPagesPageSet(page_set_module.PageSet):
+
+ """ Five blank pages. """
+
+ def __init__(self):
+ super(FiveBlankPagesPageSet, self).__init__()
+ for _ in xrange(5):
+ self.AddPage(page_module.PageWithDefaultRunNavigate(
+ 'file://blank_page/blank_page.html', self))
diff --git a/tools/perf/page_sets/image_decoding_measurement.json b/tools/perf/page_sets/image_decoding_measurement.json
deleted file mode 100644
index 0b09e95..0000000
--- a/tools/perf/page_sets/image_decoding_measurement.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "description": "A directed benchmark of image decoding performance",
- "navigate_steps": [
- { "action": "navigate" },
- { "action": "javascript", "expression": "runBenchmark();" },
- { "action": "wait", "javascript": "isDone" }
- ],
- "image_decoding_measurement_limit_results_to_min_iterations": true,
- "pages": [
- { "url": "file://../../../chrome/test/data/image_decoding/image_decoding.html?gif" },
- { "url": "file://../../../chrome/test/data/image_decoding/image_decoding.html?jpg" },
- { "url": "file://../../../chrome/test/data/image_decoding/image_decoding.html?png" },
- { "url": "file://../../../chrome/test/data/image_decoding/image_decoding.html?webp" }
- ]
-}
diff --git a/tools/perf/page_sets/image_decoding_measurement.py b/tools/perf/page_sets/image_decoding_measurement.py
new file mode 100644
index 0000000..4ee3267
--- /dev/null
+++ b/tools/perf/page_sets/image_decoding_measurement.py
@@ -0,0 +1,45 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class ImageDecodingMeasurementPage(page_module.PageWithDefaultRunNavigate):
+
+ def __init__(self, url, page_set):
+ super(ImageDecodingMeasurementPage, self).__init__(url=url,
+ page_set=page_set)
+ self.image_decoding_measurement_limit_results_to_min_iterations = True
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(JavascriptAction(
+ {
+ 'expression': 'runBenchmark();'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'javascript': 'isDone'
+ }))
+
+
+class ImageDecodingMeasurementPageSet(page_set_module.PageSet):
+
+ """ A directed benchmark of image decoding performance """
+
+ def __init__(self):
+ super(ImageDecodingMeasurementPageSet, self).__init__()
+ self.image_decoding_measurement_limit_results_to_min_iterations = True
+
+ urls_list = [
+ 'file://../../../chrome/test/data/image_decoding/image_decoding.html?gif',
+ 'file://../../../chrome/test/data/image_decoding/image_decoding.html?jpg',
+ 'file://../../../chrome/test/data/image_decoding/image_decoding.html?png',
+ 'file://../../../chrome/test/data/image_decoding/image_decoding.html?webp'
+ ]
+
+ for url in urls_list:
+ self.AddPage(ImageDecodingMeasurementPage(url, self))
diff --git a/tools/perf/page_sets/indexeddb_offline.json b/tools/perf/page_sets/indexeddb_offline.json
deleted file mode 100644
index 0c349ae..0000000
--- a/tools/perf/page_sets/indexeddb_offline.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "description": "Chrome Endure test for IndexedDB.",
- "user_agent_type": "desktop",
- "pages": [
- {
- "url": "file://endure/indexeddb_app.html",
- "name": "indexeddb_offline",
- "why": "Simulates user input while offline and sync while online.",
- "navigate_steps": [
- { "action": "navigate" },
- { "action": "wait", "condition": "element", "text": "initialized" }
- ],
- "endure": [
- { "action": "wait", "condition": "element", "selector": "button[id=\"online\"]:not(disabled)" },
- { "action": "javascript_click", "selector": "button[id=\"online\"]:not(disabled)" },
- { "action": "wait", "condition": "element", "xpath": "id(\"state\")[text()=\"online\"]" },
- { "action": "wait", "seconds": 1 },
- { "action": "wait", "condition": "element", "selector": "button[id=\"offline\"]:not(disabled)" },
- { "action": "javascript_click", "selector": "button[id=\"offline\"]:not(disabled)" },
- { "action": "wait", "condition": "element", "xpath": "id(\"state\")[text()=\"offline\"]" }
- ]
- }
- ]
-}
diff --git a/tools/perf/page_sets/indexeddb_offline.py b/tools/perf/page_sets/indexeddb_offline.py
new file mode 100644
index 0000000..e322b16
--- /dev/null
+++ b/tools/perf/page_sets/indexeddb_offline.py
@@ -0,0 +1,72 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class IndexeddbOfflinePage(page_module.PageWithDefaultRunNavigate):
+
+ """ Why: Simulates user input while offline and sync while online. """
+
+ def __init__(self, page_set):
+ super(IndexeddbOfflinePage, self).__init__(
+ url='file://endure/indexeddb_app.html',
+ page_set=page_set)
+ self.user_agent_type = 'desktop'
+ self.name = 'indexeddb_offline'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(WaitAction(
+ {
+ 'text': 'initialized',
+ 'condition': 'element'
+ }))
+
+ def RunEndure(self, action_runner):
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'button[id="online"]:not(disabled)'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'button[id="online"]:not(disabled)'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'xpath': 'id("state")[text()="online"]',
+ 'condition': 'element'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ "seconds": 1
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'condition': 'element',
+ 'selector': 'button[id="offline"]:not(disabled)'
+ }))
+ action_runner.RunAction(ClickElementAction(
+ {
+ 'selector': 'button[id="offline"]:not(disabled)'
+ }))
+ action_runner.RunAction(WaitAction(
+ {
+ 'xpath': 'id("state")[text()="offline"]',
+ 'condition': 'element'
+ }))
+
+
+class IndexeddbOfflinePageSet(page_set_module.PageSet):
+
+ """ Chrome Endure test for IndexedDB. """
+
+ def __init__(self):
+ super(IndexeddbOfflinePageSet, self).__init__(
+ user_agent_type='desktop')
+
+ self.AddPage(IndexeddbOfflinePage(self))
diff --git a/tools/perf/page_sets/maps.json b/tools/perf/page_sets/maps.json
deleted file mode 100644
index d3b8f85..0000000
--- a/tools/perf/page_sets/maps.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "description": "Google Maps examples",
- "archive_data_file": "data/maps.json",
- "make_javascript_deterministic": false,
- "navigate_steps": [
- { "action": "navigate" },
- { "action": "wait", "seconds": 3 }
- ],
- "smoothness": { "action": "wait", "javascript": "window.testDone" },
- "pages": [
- {
- "name": "Maps.maps_001",
- "url":"http://localhost:10020/tracker.html"
- }
- ]
-}
diff --git a/tools/perf/page_sets/maps.py b/tools/perf/page_sets/maps.py
new file mode 100644
index 0000000..ca56029
--- /dev/null
+++ b/tools/perf/page_sets/maps.py
@@ -0,0 +1,35 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class MapsPage(page_module.PageWithDefaultRunNavigate):
+
+ def __init__(self, page_set):
+ super(MapsPage, self).__init__(
+ url='http://localhost:10020/tracker.html',
+ page_set=page_set)
+ self.archive_data_file = 'data/maps.json'
+ self.name = 'Maps.maps_001'
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(WaitAction({'seconds': 3}))
+
+ def RunSmoothness(self, action_runner):
+ action_runner.RunAction(WaitAction({'javascript': 'window.testDone'}))
+
+
+class MapsPageSet(page_set_module.PageSet):
+
+ """ Google Maps examples """
+
+ def __init__(self):
+ super(MapsPageSet, self).__init__(
+ archive_data_file='data/maps.json')
+
+ self.AddPage(MapsPage(self))
diff --git a/tools/perf/page_sets/media_cns_cases.json b/tools/perf/page_sets/media_cns_cases.json
deleted file mode 100644
index 1cf20a7..0000000
--- a/tools/perf/page_sets/media_cns_cases.json
+++ /dev/null
@@ -1,139 +0,0 @@
-{
- "description": "Media benchmark on network constrained conditions.",
- "media_metrics": {"action": "play-action"},
- "add_browser_metrics": true,
- "play-action": [
- { "action": "play",
- "wait_for_playing": true,
- "wait_for_ended": true
- }
- ],
- "seek_before_and_after_playhead": [
- { "action": "play",
- "wait_for_playing": true,
- "wait_for_ended": false
- },
- { "_comment": "Wait for 1 second so that we know the play-head is at ~1s.",
- "action": "wait", "seconds": 1
- },
- { "_comment": "Seek to before the play-head location.",
- "action": "seek",
- "wait_for_seeked": true,
- "seek_time": "0.5",
- "seek_label": "seek_warm"
- },
- { "_comment": "Seek to after the play-head location.",
- "action": "seek",
- "wait_for_seeked": true,
- "seek_time": 15,
- "seek_label": "seek_cold"
- }
- ],
- "pages": [
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_webm&src=tulip2.webm&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_webm&src=tulip2.webm&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_webm&src=tulip2.webm&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_ogv&src=tulip2.ogv&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_ogv&src=tulip2.ogv&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_ogv&src=tulip2.ogv&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_mp4&src=tulip2.mp4&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_mp4&src=tulip2.mp4&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_mp4&src=tulip2.mp4&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_wav&src=tulip2.wav&type=audio&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_wav&src=tulip2.wav&type=audio&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_wav&src=tulip2.wav&type=audio&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_ogg&src=tulip2.ogg&type=audio&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_ogg&src=tulip2.ogg&type=audio&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_ogg&src=tulip2.ogg&type=audio&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_mp3&src=tulip2.mp3&type=audio&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_mp3&src=tulip2.mp3&type=audio&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_mp3&src=tulip2.mp3&type=audio&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=no_constraints_m4a&src=tulip2.m4a&type=audio&net=none"
- },
- {
- "url": "file://tough_video_cases/video.html?id=cable_m4a&src=tulip2.m4a&type=audio&net=cable"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_m4a&src=tulip2.m4a&type=audio&net=wifi"
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_mp3&src=tulip2.mp3&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_m4a&src=tulip2.m4a&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_ogg&src=tulip2.ogg&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_wav&src=tulip2.wav&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_mp4&src=tulip2.mp4&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_ogv&src=tulip2.ogv&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- },
- {
- "url": "file://tough_video_cases/video.html?id=wifi_webm&src=tulip2.webm&type=audio&net=wifi",
- "skip_basic_metrics": true,
- "add_browser_metrics": false,
- "media_metrics": {"action": "seek_before_and_after_playhead"}
- }
- ]
-}
diff --git a/tools/perf/page_sets/media_cns_cases.py b/tools/perf/page_sets/media_cns_cases.py
new file mode 100644
index 0000000..7e90902
--- /dev/null
+++ b/tools/perf/page_sets/media_cns_cases.py
@@ -0,0 +1,136 @@
+# 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.
+# pylint: disable=W0401,W0614
+from telemetry.page.actions.all_page_actions import *
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class BasicPlayPage(page_module.PageWithDefaultRunNavigate):
+
+ def __init__(self, url, page_set):
+ super(BasicPlayPage, self).__init__(url=url, page_set=page_set)
+ self.add_browser_metrics = True
+
+ def PlayAction(self, action_runner):
+ action_runner.RunAction(PlayAction(
+ {
+ 'wait_for_playing': True,
+ 'wait_for_ended': True
+ }))
+
+ def RunMediaMetrics(self, action_runner):
+ self.PlayAction(action_runner)
+
+ def SeekBeforeAndAfterPlayhead(self, action_runner):
+ action_runner.RunAction(PlayAction(
+ {
+ 'wait_for_playing': True,
+ 'wait_for_ended': False
+ }))
+ # Wait for 1 second so that we know the play-head is at ~1s.
+ action_runner.RunAction(WaitAction(
+ {
+ 'seconds': 1
+ }))
+ # Seek to before the play-head location.
+ action_runner.RunAction(SeekAction(
+ {
+ 'seek_time': '0.5',
+ 'wait_for_seeked': True,
+ 'seek_label': 'seek_warm'
+ }))
+ # Seek to after the play-head location.
+ action_runner.RunAction(SeekAction(
+ {
+ 'seek_time': 15,
+ 'wait_for_seeked': True,
+ 'seek_label': 'seek_cold'
+ }))
+
+class SeekBeforeAndAfterPlayheadPage(BasicPlayPage):
+
+ def __init__(self, url, page_set):
+ super(SeekBeforeAndAfterPlayheadPage, self).__init__(url=url,
+ page_set=page_set)
+ self.add_browser_metrics = False
+
+ def RunMediaMetrics(self, action_runner):
+ self.SeekBeforeAndAfterPlayhead(action_runner)
+
+
+class MediaCnsCasesPageSet(page_set_module.PageSet):
+
+ """ Media benchmark on network constrained conditions. """
+
+ def __init__(self):
+ super(MediaCnsCasesPageSet, self).__init__()
+
+ urls_list = [
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_webm&src=tulip2.webm&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_webm&src=tulip2.webm&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_webm&src=tulip2.webm&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_ogv&src=tulip2.ogv&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_ogv&src=tulip2.ogv&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_ogv&src=tulip2.ogv&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_mp4&src=tulip2.mp4&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_mp4&src=tulip2.mp4&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_mp4&src=tulip2.mp4&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_wav&src=tulip2.wav&type=audio&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_wav&src=tulip2.wav&type=audio&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_wav&src=tulip2.wav&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_ogg&src=tulip2.ogg&type=audio&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_ogg&src=tulip2.ogg&type=audio&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_ogg&src=tulip2.ogg&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_mp3&src=tulip2.mp3&type=audio&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_mp3&src=tulip2.mp3&type=audio&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_mp3&src=tulip2.mp3&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=no_constraints_m4a&src=tulip2.m4a&type=audio&net=none',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=cable_m4a&src=tulip2.m4a&type=audio&net=cable',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_m4a&src=tulip2.m4a&type=audio&net=wifi'
+ ]
+
+ for url in urls_list:
+ self.AddPage(BasicPlayPage(url, self))
+
+ urls_list2 = [
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_mp3&src=tulip2.mp3&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_m4a&src=tulip2.m4a&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_ogg&src=tulip2.ogg&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_wav&src=tulip2.wav&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_mp4&src=tulip2.mp4&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_ogv&src=tulip2.ogv&type=audio&net=wifi',
+ # pylint: disable=C0301
+ 'file://tough_video_cases/video.html?id=wifi_webm&src=tulip2.webm&type=audio&net=wifi'
+ ]
+
+ for url in urls_list2:
+ self.AddPage(SeekBeforeAndAfterPlayheadPage(url, self))