summaryrefslogtreecommitdiffstats
path: root/content/test
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-12 19:36:16 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-12 19:36:16 +0000
commit12ce87e619767b437a539f9736fe489a7655aaa1 (patch)
treec27cfe9fe9b47321bac9208b2051d3db66161770 /content/test
parent08881f9a11b7f2a9b22af4306dc362373c2f22ac (diff)
downloadchromium_src-12ce87e619767b437a539f9736fe489a7655aaa1.zip
chromium_src-12ce87e619767b437a539f9736fe489a7655aaa1.tar.gz
chromium_src-12ce87e619767b437a539f9736fe489a7655aaa1.tar.bz2
IndexedDB: Test for "close" event when connection is force-closed.
The event is implemented in Blink in http://crrev.com/18042007 - this is just test. BUG=249470 R=dgrogan@chromium.org Review URL: https://chromiumcodereview.appspot.com/18660012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r--content/test/data/indexeddb/force_close_event.html10
-rw-r--r--content/test/data/indexeddb/force_close_event.js22
2 files changed, 32 insertions, 0 deletions
diff --git a/content/test/data/indexeddb/force_close_event.html b/content/test/data/indexeddb/force_close_event.html
new file mode 100644
index 0000000..bd95cf7
--- /dev/null
+++ b/content/test/data/indexeddb/force_close_event.html
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>IndexedDB force close event test</title>
+ <script type="text/javascript" src="common.js"></script>
+ <script type="text/javascript" src="force_close_event.js"></script>
+ </head>
+ <body onLoad="test()">
+ <div id="status">Starting...</div>
+ </body>
+</html>
diff --git a/content/test/data/indexeddb/force_close_event.js b/content/test/data/indexeddb/force_close_event.js
new file mode 100644
index 0000000..a714bc9
--- /dev/null
+++ b/content/test/data/indexeddb/force_close_event.js
@@ -0,0 +1,22 @@
+// Copyright 2013 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.
+
+function test() {
+ indexedDBTest(onUpgradeNeeded, onOpenSuccess);
+}
+
+function onUpgradeNeeded(e) {
+}
+
+function onOpenSuccess(e) {
+ // Don't let GC claim the connection
+ window.db = e.target.result;
+ window.db.onclose = onDatabaseClose;
+ document.title = 'connection ready';
+}
+
+function onDatabaseClose(e)
+{
+ document.title = 'connection closed';
+}