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

Unified Diff: tools/telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: tools/telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py
diff --git a/tools/telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py b/tools/telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py
deleted file mode 100644
index b05b9cdbdb41cc43dbaf355ac935ae568c35b361..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/backends/chrome/tab_list_backend_unittest.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from telemetry.core import exceptions
-from telemetry import decorators
-from telemetry.testing import tab_test_case
-
-
-class TabListBackendTest(tab_test_case.TabTestCase):
- @decorators.Enabled('has tabs')
- def testNewTab(self):
- tabs = set(tab.id for tab in self.tabs)
- for _ in xrange(10):
- new_tab_id = self.tabs.New().id
- self.assertNotIn(new_tab_id, tabs)
- tabs.add(new_tab_id)
- new_tabs = set(tab.id for tab in self.tabs)
- self.assertEqual(tabs, new_tabs)
-
- @decorators.Enabled('has tabs')
- def testTabIdMatchesContextId(self):
- # Ensure that there are two tabs.
- while len(self.tabs) < 2:
- self.tabs.New()
-
- # Check that the tab.id matches context_id.
- tabs = []
- for context_id in self.tabs._tab_list_backend.IterContextIds():
- tab = self.tabs.GetTabById(context_id)
- self.assertEquals(tab.id, context_id)
- tabs.append(self.tabs.GetTabById(context_id))
-
- @decorators.Enabled('has tabs')
- def testTabIdStableAfterTabCrash(self):
- # Ensure that there are two tabs.
- while len(self.tabs) < 2:
- self.tabs.New()
-
- tabs = [t for t in self.tabs]
-
- # Crash the first tab.
- self.assertRaises(exceptions.DevtoolsTargetCrashException,
- lambda: tabs[0].Navigate('chrome://crash'))
-
- # Fetching the second tab by id should still work. Fetching the first tab
- # should raise an exception.
- self.assertEquals(tabs[1], self.tabs.GetTabById(tabs[1].id))
- self.assertRaises(KeyError, lambda: self.tabs.GetTabById(tabs[0].id))

Powered by Google App Engine
This is Rietveld 408576698