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

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

Issue 447633002: Forward {Will/Did}StartBrowser calls to page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 75ae0160b37f397bc6fafa8522b45f924dd74057..4a3925aa5c350e34bc00fc15fb4b229dce360f8f 100644
--- a/tools/telemetry/telemetry/page/record_wpr_unittest.py
+++ b/tools/telemetry/telemetry/page/record_wpr_unittest.py
@@ -67,6 +67,11 @@ class MockPageTest(page_test.PageTest):
def ValidatePage(self, page, tab, results):
self.func_calls.append('ValidatePage')
+ def WillStartBrowser(self, browser):
+ self.func_calls.append('WillStartBrowser')
+
+ def DidStartBrowser(self, browser):
+ self.func_calls.append('DidStartBrowser')
class MockBenchmark(benchmark.Benchmark):
test = MockPageTest
@@ -188,3 +193,13 @@ class RecordWprUnitTests(tab_test_case.TabTestCase):
self.assertTrue('RunFoo' in action_names_to_run)
self.assertTrue('RunBar' in action_names_to_run)
self.assertFalse('RunBaz' in action_names_to_run)
+
+ # When the RecorderPageTest WillStartBrowser/DidStartBrowser function is
+ # called, it forwards the call to the PageTest
+ def testRecorderPageTest_BrowserMethods(self):
+ record_page_test = record_wpr.RecorderPageTest([])
+ record_page_test.page_test = MockBenchmark().test()
+ record_page_test.WillStartBrowser(self._tab.browser)
+ record_page_test.DidStartBrowser(self._tab.browser)
+ 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