Chromium Code Reviews| Index: tools/perf/core/minidump_unittest.py |
| diff --git a/tools/perf/core/minidump_unittest.py b/tools/perf/core/minidump_unittest.py |
| index bc3dfe09ec7a3603a1d6ad986edb50694e5aefa0..893813f571dda406c9a029ff34b99757e43854f7 100644 |
| --- a/tools/perf/core/minidump_unittest.py |
| +++ b/tools/perf/core/minidump_unittest.py |
| @@ -12,6 +12,8 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): |
| @decorators.Isolated |
| @decorators.Enabled('mac') |
| def testSymbolizeMinidump(self): |
| + # Wait for the browser to restart fully before crashing |
| + self._loadPageAndWait('var sam = "car";', 'sam') |
| self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) |
| crash_minidump_path = self._browser.GetMostRecentMinidumpPath() |
| self.assertIsNotNone(crash_minidump_path) |
| @@ -39,6 +41,8 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): |
| @decorators.Isolated |
| @decorators.Enabled('mac') |
| def testMultipleCrashMinidumps(self): |
| + # Wait for the browser to restart fully before crashing |
| + self._loadPageAndWait('var cat = "dog";', 'cat') |
| self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) |
| first_crash_path = self._browser.GetMostRecentMinidumpPath() |
| @@ -59,12 +63,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): |
| self._RestartBrowser() |
| # Start a new tab in the restarted browser |
| - new_tab = self._browser.tabs.New() |
| - new_tab.Navigate('http://www.google.com/', |
| - script_to_evaluate_on_commit='var foo = "bar";') |
| - # Wait until the javascript has run ensuring that |
| - # the new browser has restarted before we crash it again |
| - util.WaitFor(lambda: new_tab.EvaluateJavaScript('foo'), 60) |
| + self._loadPageAndWait('var foo = "bar";', 'foo') |
| self._browser.tabs.New().Navigate('chrome://gpucrash', timeout=5) |
| second_crash_path = self._browser.GetMostRecentMinidumpPath() |
| @@ -100,3 +99,11 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): |
| + ''.join(after_symbolize_all_unsymbolized_paths)) |
| #self.assertEquals(after_symbolize_all_unsymbolized_paths, |
| # [first_crash_path]) |
| + |
| + def _loadPageAndWait(self, script, value): |
|
nednguyen
2016/07/28 15:44:47
nits: _LoadPageThenWait(self, script, value):
Our
eyaich
2016/07/28 15:55:52
Done.
|
| + new_tab = self._browser.tabs.New() |
| + new_tab.Navigate('http://www.google.com/', |
|
nednguyen
2016/07/28 15:44:48
http://www.google.com would probably hit real netw
eyaich
2016/07/28 15:55:52
I think we actually want to hit a real web page an
eyaich
2016/07/28 16:59:02
Talked offline, I have changed this now. Done.
|
| + script_to_evaluate_on_commit=script) |
| + # Wait until the javascript has run ensuring that |
| + # the new browser has restarted before we crash it again |
| + util.WaitFor(lambda: new_tab.EvaluateJavaScript(value), 60) |