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

Unified Diff: tools/telemetry/telemetry/core/tab_unittest.py

Issue 449753002: Improve error reporting when indexing tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments explain what to do with exceptions 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
Index: tools/telemetry/telemetry/core/tab_unittest.py
diff --git a/tools/telemetry/telemetry/core/tab_unittest.py b/tools/telemetry/telemetry/core/tab_unittest.py
index 6f1389ade9be07baf89d742b5d73cf057c483cb9..f99191bcdcc099a4880c7df4017e949951014971 100644
--- a/tools/telemetry/telemetry/core/tab_unittest.py
+++ b/tools/telemetry/telemetry/core/tab_unittest.py
@@ -65,6 +65,23 @@ class TabTest(tab_test_case.TabTestCase):
self.assertRaises(exceptions.TabCrashException,
lambda: self._tab.Navigate('chrome://crash',
timeout=5))
+ super(TabTest, self).tearDownClass()
+ super(TabTest, self).setUpClass()
+
+ def testIndexTab(self):
+ self._browser.tabs.New()
+ self.assertRaises(exceptions.TabCrashException,
+ lambda: self._tab.Navigate('chrome://crash',
+ timeout=5))
+ self.assertRaises(exceptions.TabIndexError,
+ lambda: self._browser.tabs[2])
+ self.assertRaises(exceptions.TabCrashException,
+ lambda: self._browser.tabs[0])
+ self.assertRaises(exceptions.TabCrashException,
+ lambda: self._browser.tabs[1])
+ self._browser.Close()
+ super(TabTest, self).tearDownClass()
+ super(TabTest, self).setUpClass()
@benchmark.Enabled('has tabs')
def testActivateTab(self):
« no previous file with comments | « tools/telemetry/telemetry/core/exceptions.py ('k') | tools/telemetry/telemetry/page/page_runner_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698