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

Unified Diff: telemetry/telemetry/internal/browser/tab_unittest.py

Issue 2453073002: [Telemetry] Move from telemetry WaitFor to py_utils WaitFor (Closed)
Patch Set: [Telemetry] Move from telemetry WaitFor to py_utils WaitFor Created 4 years, 2 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: telemetry/telemetry/internal/browser/tab_unittest.py
diff --git a/telemetry/telemetry/internal/browser/tab_unittest.py b/telemetry/telemetry/internal/browser/tab_unittest.py
index a9f3b9089fde26ea57eed8dc5a407aee3890244d..2692998b4e179eb60b21939a3f77f67ded382088 100644
--- a/telemetry/telemetry/internal/browser/tab_unittest.py
+++ b/telemetry/telemetry/internal/browser/tab_unittest.py
@@ -7,7 +7,6 @@ import tempfile
import time
from telemetry.core import exceptions
-from telemetry.core import util
from telemetry import decorators
from telemetry.internal.image_processing import video
from telemetry.testing import tab_test_case
@@ -16,6 +15,8 @@ from telemetry.timeline import tracing_config
from telemetry.util import image_util
from telemetry.util import rgba_color
+import py_utils
+
def _IsDocumentVisible(tab):
return not tab.EvaluateJavaScript('document.hidden || document.webkitHidden')
@@ -77,7 +78,7 @@ class TabTest(tab_test_case.TabTestCase):
setTimeout(buggyReference, 200);""")
self._tab.WaitForJavaScriptExpression(
'window.__set_timeout_called === true', 5)
- with self.assertRaises(exceptions.TimeoutException) as context:
+ with self.assertRaises(py_utils.TimeoutException) as context:
self._tab.WaitForJavaScriptExpression(
'window.__one === 1', 1)
self.assertIn(
@@ -87,13 +88,13 @@ class TabTest(tab_test_case.TabTestCase):
@decorators.Enabled('has tabs')
def testActivateTab(self):
- util.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
+ py_utils.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
new_tab = self._browser.tabs.New()
new_tab.Navigate('about:blank')
- util.WaitFor(lambda: _IsDocumentVisible(new_tab), timeout=5)
+ py_utils.WaitFor(lambda: _IsDocumentVisible(new_tab), timeout=5)
self.assertFalse(_IsDocumentVisible(self._tab))
self._tab.Activate()
- util.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
+ py_utils.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
self.assertFalse(_IsDocumentVisible(new_tab))
def testTabUrl(self):
« no previous file with comments | « telemetry/telemetry/internal/browser/browser_unittest.py ('k') | telemetry/telemetry/internal/browser/web_contents.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698