diff options
Diffstat (limited to 'chrome/test/functional')
-rwxr-xr-x | chrome/test/functional/indexeddb.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/test/functional/indexeddb.py b/chrome/test/functional/indexeddb.py index 5e4e560..162aa9d 100755 --- a/chrome/test/functional/indexeddb.py +++ b/chrome/test/functional/indexeddb.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -59,5 +59,27 @@ class IndexedDBTest(pyauto.PyUITest): expect_retval='pass - part3 - rolled back'), msg='VERSION_CHANGE not completely aborted') + def testConnectionsClosedOnTabClose(self): + """Verify that open DB connections are closed when a tab is destroyed.""" + + url = self.GetHttpURLForDataPath('indexeddb', 'version_change_blocked.html') + + self.NavigateToURL(url + '#tab1') + pid = self.GetBrowserInfo()['windows'][0]['tabs'][0]['renderer_pid'] + self.assertTrue(self.WaitUntil(self.GetActiveTabTitle, + expect_retval='setVersion(1) complete'), + msg='Version change failed') + + # Start to a different URL to force a new renderer process + self.AppendTab(pyauto.GURL('about:blank')) + self.NavigateToURL(url + '#tab2') + self.assertTrue(self.WaitUntil(self.GetActiveTabTitle, + expect_retval='setVersion(2) blocked'), + msg='Version change not blocked as expected') + self.KillRendererProcess(pid) + self.assertTrue(self.WaitUntil(self.GetActiveTabTitle, + expect_retval='setVersion(2) complete'), + msg='Version change never unblocked') + if __name__ == '__main__': pyauto_functional.Main() |