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

Unified Diff: chrome/test/chromedriver/test/run_py_tests.py

Issue 868153002: [chromedriver] Make testConsoleLogSources handle missing favicon error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | chrome/test/data/chromedriver/console_log.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/test/run_py_tests.py
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py
index 7de022f6c94ddb8643b3fb90fbd4a006055c691e..68340696622026f87a3f0def65f7a667366e22dd 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -726,9 +726,22 @@ class ChromeDriverTest(ChromeDriverBaseTest):
def testConsoleLogSources(self):
self._driver.Load(self.GetHttpUrlForFile('/chromedriver/console_log.html'))
logs = self._driver.GetLog('browser')
- self.assertEquals(len(logs), 2)
- self.assertEquals(logs[0]['source'], 'network')
- self.assertEquals(logs[1]['source'], 'javascript')
+
+ self.assertEqual('network', logs[0]['source'])
+ self.assertTrue('nonexistent.png' in logs[0]['message'])
+ self.assertTrue('404' in logs[0]['message'])
+
+ self.assertEqual('javascript', logs[1]['source'])
+ self.assertTrue('TypeError' in logs[1]['message'])
+
+ # Sometimes, we also get an error for a missing favicon.
stgao 2015/01/23 19:45:55 Just FYI: another idea is to add a dummy favicon t
+ if len(logs) > 2:
+ self.assertEqual('network', logs[2]['source'])
+ self.assertTrue('favicon.ico' in logs[2]['message'])
+ self.assertTrue('404' in logs[2]['message'])
+ self.assertEqual(3, len(logs))
+ else:
+ self.assertEqual(2, len(logs))
def testAutoReporting(self):
self.assertFalse(self._driver.IsAutoReporting())
« no previous file with comments | « no previous file | chrome/test/data/chromedriver/console_log.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698