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

Unified Diff: tools/perf/core/about_tracing_integration_test.py

Issue 2189603002: [tools/perf] Add integration test for about://tracing UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/core/about_tracing_integration_test.py
diff --git a/tools/perf/core/about_tracing_integration_test.py b/tools/perf/core/about_tracing_integration_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..d41e4e2d4904cfea88b4317cfd285cd2af9fa43c
--- /dev/null
+++ b/tools/perf/core/about_tracing_integration_test.py
@@ -0,0 +1,40 @@
+# Copyright 2016 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.
+from telemetry import decorators
+from telemetry.testing import tab_test_case
+
+
+_RECORD_BUTTON_SELECTOR_FUNC = '''
+}'''
sullivan 2016/07/27 12:40:39 What's this for?
nednguyen 2016/07/27 12:56:52 Removed.
+
+
+class AboutTracingIntegrationTest(tab_test_case.TabTestCase):
+
+ @decorators.Disabled('android')
+ def testBasicTraceRecording(self):
+ action_runner = self._tab.action_runner
+ action_runner.Navigate('chrome://tracing')
+
+ # Click 'record' to trigger record selection diaglog.
+ action_runner.WaitForElement(element_function='''function() {
+ return document.querySelector('tr-ui-timeline-view').shadowRoot.
sullivan 2016/07/27 12:40:39 I wanted to check that you tested this at ToT? The
nednguyen 2016/07/27 12:56:52 Done.
+ getElementById('record-button');}''')
+ action_runner.ExecuteJavaScript('''
+ document.querySelector('tr-ui-timeline-view').shadowRoot.
+ getElementById('record-button').click();''')
sullivan 2016/07/27 12:40:39 Why not use the ClickElement method in action_runn
nednguyen 2016/07/27 12:56:52 Done.
+
+ # Wait for record selection diaglog to pop up, then click record.
+ action_runner.WaitForElement(selector='.overlay')
+ action_runner.ExecuteJavaScript('''
+ document.querySelector('.overlay').shadowRoot.
+ querySelectorAll('button')[0].click()''')
+
+ # Stop recording after 1 seconds.
+ action_runner.Wait(1)
+ action_runner.ExecuteJavaScript('''
+ document.querySelector('.overlay').
+ querySelectorAll('button')[0].click()''')
+
+ # Make sure that we can see the browser track.
+ action_runner.WaitForElement(selector='div[title~="Browser"]')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698