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

Unified Diff: chrome/test/functional/indexeddb.py

Issue 8892021: Try to address flaxy IndexedDB pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't need lambda expressions Created 9 years 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 | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/indexeddb.py
diff --git a/chrome/test/functional/indexeddb.py b/chrome/test/functional/indexeddb.py
index cb8d371a653d4ecc92b0a402a88664704212779e..5e4e5609f9ee5e26d2bfd63d7118798c280b148f 100755
--- a/chrome/test/functional/indexeddb.py
+++ b/chrome/test/functional/indexeddb.py
@@ -15,36 +15,21 @@ class IndexedDBTest(pyauto.PyUITest):
crash_url = 'about:inducebrowsercrashforrealz'
self.NavigateToURL(crash_url)
- def _GetTestResult(self):
- """Returns the result of an asynchronous test"""
- js = """
- window.domAutomationController.send(window.testResult);
- """
- return self.ExecuteJavascript(js)
-
- def _WaitForTestResult(self):
- """Waits until a non-empty asynchronous test result is recorded"""
- self.assertTrue(self.WaitUntil(lambda: self._GetTestResult() != '',
- timeout=120),
- msg='Test did not finish')
-
def testIndexedDBNullKeyPathPersistence(self):
"""Verify null key path persists after restarting browser."""
url = self.GetHttpURLForDataPath('indexeddb', 'bug_90635.html')
- self.NavigateToURL(url)
- self._WaitForTestResult()
- self.assertEqual(self._GetTestResult(),
- 'pass - first run',
- msg='Key paths had unexpected values')
+ self.NavigateToURL(url + '#part1')
+ self.assertTrue(self.WaitUntil(self.GetActiveTabTitle,
+ expect_retval='pass - first run'),
+ msg='Key paths had unexpected values')
self.RestartBrowser(clear_profile=False)
- self.NavigateToURL(url)
- self._WaitForTestResult()
- self.assertEqual(self._GetTestResult(),
- 'pass - second run',
+ self.NavigateToURL(url + '#part2')
+ self.assertTrue(self.WaitUntil(self.GetActiveTabTitle,
+ expect_retval='pass - second run'),
msg='Key paths had unexpected values')
def testVersionChangeCrashResilience(self):
@@ -54,23 +39,25 @@ class IndexedDBTest(pyauto.PyUITest):
url = self.GetHttpURLForDataPath('indexeddb', 'version_change_crash.html')
self.NavigateToURL(url + '#part1')
- self.assertTrue(self.WaitUntil(
- lambda: self._GetTestResult() == 'part1 - complete'))
+ self.assertTrue(self.WaitUntil(self.GetActiveTabTitle,
+ expect_retval='pass - part1 - complete'),
+ msg='Failed to prepare database')
self.RestartBrowser(clear_profile=False)
self.NavigateToURL(url + '#part2')
- self.assertTrue(self.WaitUntil(
- lambda: self._GetTestResult() != 'part2 - crash me'))
+ self.assertTrue(self.WaitUntil(self.GetActiveTabTitle,
+ expect_retval='pass - part2 - crash me'),
+ msg='Failed to start transaction')
+
self._CrashBrowser()
self.RestartBrowser(clear_profile=False)
self.NavigateToURL(url + '#part3')
- self._WaitForTestResult()
- self.assertEqual(self._GetTestResult(),
- 'part3 - pass',
- msg='VERSION_CHANGE not completely aborted')
+ self.assertTrue(self.WaitUntil(self.GetActiveTabTitle,
+ expect_retval='pass - part3 - rolled back'),
+ msg='VERSION_CHANGE not completely aborted')
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « chrome/test/functional/PYAUTO_TESTS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698