Chromium Code Reviews| Index: chrome/test/functional/indexeddb.py |
| diff --git a/chrome/test/functional/indexeddb.py b/chrome/test/functional/indexeddb.py |
| index df9b45c684d7d3b7bd9a9e396aab5a29827b3855..b81ece972a50b650c397c2d1040a6cef291c21e9 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 = """ |
| @@ -42,5 +47,28 @@ 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.GetFileURLForDataPath('indexeddb', 'version_change_crash.html') |
|
Nirnimesh
2011/11/04 22:25:09
maybe use GetHttpUrlForDataPath? (here and above a
|
| + |
| + self.NavigateToURL(url + '#part1') |
| + self.WaitUntil(lambda: self._GetTestResult() == 'part1 - complete') |
|
Nirnimesh
2011/11/04 22:25:09
you need to wrap this inside self.assertTrue()
|
| + |
| + self.RestartBrowser(clear_profile=False) |
| + |
| + self.NavigateToURL(url + '#part2') |
| + self.WaitUntil(lambda: self._GetTestResult() != 'part2 - crash me') |
| + self._CrashBrowser() |
| + |
| + self.RestartBrowser(clear_profile=False) |
|
Nirnimesh
2011/11/04 22:25:09
RestartBrowser works by quitting the current brows
|
| + |
| + self.NavigateToURL(url + '#part3') |
| + self._WaitForTestResult() |
| + self.assertEqual(self._GetTestResult(), |
| + 'part3 - pass', |
| + msg='VERSION_CHANGE not completely aborted') |
| + |
| if __name__ == '__main__': |
| pyauto_functional.Main() |