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

Unified Diff: tools/telemetry/telemetry/page/record_wpr_unittest.py

Issue 1138763004: Fix record_wpr to allow page tests to customize browser options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests Created 5 years, 7 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 | « tools/telemetry/telemetry/page/record_wpr.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/record_wpr_unittest.py
diff --git a/tools/telemetry/telemetry/page/record_wpr_unittest.py b/tools/telemetry/telemetry/page/record_wpr_unittest.py
index 9642d5a104c8a9f9a51880f0ff71a981fc945290..9bfef35bb8be1e68d3aa9be75d93d3e6455c3dcf 100644
--- a/tools/telemetry/telemetry/page/record_wpr_unittest.py
+++ b/tools/telemetry/telemetry/page/record_wpr_unittest.py
@@ -46,6 +46,9 @@ class MockPageTest(page_test.PageTest):
self._action_name_to_run = "RunPageInteractions"
self.func_calls = []
+ def CustomizeBrowserOptions(self, options):
+ self.func_calls.append('CustomizeBrowserOptions')
+
def WillNavigateToPage(self, page, tab):
self.func_calls.append('WillNavigateToPage')
@@ -189,12 +192,18 @@ class RecordWprUnitTests(tab_test_case.TabTestCase):
self.assertEqual(wpr_modes.WPR_RECORD,
wpr_recorder.options.browser_options.wpr_mode)
- # When the RecorderPageTest WillStartBrowser/DidStartBrowser function is
- # called, it forwards the call to the PageTest
+ # When the RecorderPageTest CustomizeBrowserOptions/WillStartBrowser/
+ # DidStartBrowser function is called, it forwards the call to the PageTest
def testRecorderPageTest_BrowserMethods(self):
+ flags = ['--mock-benchmark-url', self._url]
record_page_test = record_wpr.RecorderPageTest()
record_page_test.page_test = MockBenchmark().test()
+ wpr_recorder = record_wpr.WprRecorder(self._test_data_dir, MockBenchmark(),
+ flags)
+ record_page_test.CustomizeBrowserOptions(wpr_recorder.options)
record_page_test.WillStartBrowser(self._tab.browser.platform)
record_page_test.DidStartBrowser(self._tab.browser)
+ self.assertTrue(
+ 'CustomizeBrowserOptions' in record_page_test.page_test.func_calls)
self.assertTrue('WillStartBrowser' in record_page_test.page_test.func_calls)
self.assertTrue('DidStartBrowser' in record_page_test.page_test.func_calls)
« no previous file with comments | « tools/telemetry/telemetry/page/record_wpr.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698