Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / indexeddb / pending-version-change-stuck.html
blob3824925d726415ca878cd60991c591eee475f01d
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/shared.js"></script>
5 </head>
6 <body>
7 <script>
9 description("Implicitly terminating worker with blocked setVersion call should allow later open calls to proceed");
11 function test()
13 dbname = self.location.pathname.substring(1 + self.location.pathname.lastIndexOf("/"));
14 evalAndLog("request = indexedDB.open(\"" + dbname + "\")");
15 request.onblocked = unexpectedBlockedCallback;
16 request.onerror = unexpectedErrorCallback;
17 if (self.location.search == "?second") {
18 request.onsuccess = function() {
19 testPassed("Open worked after page reload.");
20 finishJSTest();
22 } else {
23 request.onsuccess = startTheWorker;
27 function startTheWorker()
29 worker = startWorker("resources/pending-version-change-stuck.js?" + encodeURI(dbname));
30 worker.onerror = function(e) {
31 testFailed(e.message);
32 finishJSTest();
34 originalOnMessage = worker.onmessage;
35 worker.onmessage = function(event) {
36 if (event.data == "gotblocked")
37 self.location = self.location + "?second";
38 else
39 originalOnMessage(event);
43 test();
45 </script>
46 </body>
47 </html>