Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 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 from telemetry import decorators | |
| 5 from telemetry.testing import tab_test_case | |
| 6 | |
| 7 | |
| 8 _RECORD_BUTTON_SELECTOR_FUNC = ''' | |
| 9 }''' | |
|
sullivan
2016/07/27 12:40:39
What's this for?
nednguyen
2016/07/27 12:56:52
Removed.
| |
| 10 | |
| 11 | |
| 12 class AboutTracingIntegrationTest(tab_test_case.TabTestCase): | |
| 13 | |
| 14 @decorators.Disabled('android') | |
| 15 def testBasicTraceRecording(self): | |
| 16 action_runner = self._tab.action_runner | |
| 17 action_runner.Navigate('chrome://tracing') | |
| 18 | |
| 19 # Click 'record' to trigger record selection diaglog. | |
| 20 action_runner.WaitForElement(element_function='''function() { | |
| 21 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.
| |
| 22 getElementById('record-button');}''') | |
| 23 action_runner.ExecuteJavaScript(''' | |
| 24 document.querySelector('tr-ui-timeline-view').shadowRoot. | |
| 25 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.
| |
| 26 | |
| 27 # Wait for record selection diaglog to pop up, then click record. | |
| 28 action_runner.WaitForElement(selector='.overlay') | |
| 29 action_runner.ExecuteJavaScript(''' | |
| 30 document.querySelector('.overlay').shadowRoot. | |
| 31 querySelectorAll('button')[0].click()''') | |
| 32 | |
| 33 # Stop recording after 1 seconds. | |
| 34 action_runner.Wait(1) | |
| 35 action_runner.ExecuteJavaScript(''' | |
| 36 document.querySelector('.overlay'). | |
| 37 querySelectorAll('button')[0].click()''') | |
| 38 | |
| 39 # Make sure that we can see the browser track. | |
| 40 action_runner.WaitForElement(selector='div[title~="Browser"]') | |
| OLD | NEW |