Index: chrome/test/functional/indexeddb.py |
diff --git a/chrome/test/functional/indexeddb.py b/chrome/test/functional/indexeddb.py |
index df9b45c684d7d3b7bd9a9e396aab5a29827b3855..94ae9d861eaf53bf29d7ce0af6ff076556a97290 100644 |
--- a/chrome/test/functional/indexeddb.py |
+++ b/chrome/test/functional/indexeddb.py |
@@ -10,6 +10,11 @@ import pyauto |
class IndexedDBTest(pyauto.PyUITest): |
"""Test of IndexedDB.""" |
+ def _CrashBrowser(self): |
+ """Crashes the browser by navigating to special URL""" |
+ crash_url = 'about:inducebrowsercrashforrealz' |
+ self.NavigateToURL(crash_url) |
+ |
def _GetTestResult(self): |
"""Returns the result of an asynchronous test""" |
js = """ |
@@ -26,7 +31,7 @@ class IndexedDBTest(pyauto.PyUITest): |
def testIndexedDBNullKeyPathPersistence(self): |
"""Verify null key path persists after restarting browser.""" |
- url = self.GetFileURLForDataPath('indexeddb', 'bug_90635.html') |
+ url = self.GetHttpURLForDataPath('indexeddb', 'bug_90635.html') |
self.NavigateToURL(url) |
self._WaitForTestResult() |
@@ -42,5 +47,30 @@ class IndexedDBTest(pyauto.PyUITest): |
'pass - second run', |
msg='Key paths had unexpected values') |
+ def testVersionChangeCrashResilience(self): |
+ """Verify that a VERSION_CHANGE transaction is rolled back |
+ after a renderer/browser crash""" |
+ |
+ url = self.GetHttpURLForDataPath('indexeddb', 'version_change_crash.html') |
+ |
+ self.NavigateToURL(url + '#part1') |
+ self.assertTrue(self.WaitUntil( |
+ lambda: self._GetTestResult() == 'part1 - complete')) |
+ |
+ self.RestartBrowser(clear_profile=False) |
+ |
+ self.NavigateToURL(url + '#part2') |
+ self.assertTrue(self.WaitUntil( |
+ lambda: self._GetTestResult() != 'part2 - crash me')) |
+ 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') |
+ |
if __name__ == '__main__': |
pyauto_functional.Main() |