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

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

Issue 8341092: Verify that VERSION_CHANGE transactions are rolled back after crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: incorporating feedback Created 9 years, 1 month 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/data/indexeddb/version_change_crash.js ('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 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()
« no previous file with comments | « chrome/test/data/indexeddb/version_change_crash.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698