Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / websql / open-database-creation-callback-isolated-world.html
blob66e20d1b31ac5bc4c6413cf0f41c6df767c7244c
1 <!DOCTYPE html>
2 <html>
3 <body>
4 This test tests that the openDatabase() creation callback is called in the right world.
5 <div id="console"></div>
6 <script>
7 var creationCallbacksExecuted = 0;
8 function done()
10 if ((++creationCallbacksExecuted == 2) && (window.testRunner))
11 testRunner.notifyDone();
14 function creationCallback1(db)
16 alert("FAIL: Visible in isolated world.");
17 done();
20 function creationCallback2(db)
22 alert(document.body.bar);
23 done();
26 document.body.foo = "FAIL: document.body.foo visible in isolated world.";
27 document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
29 if (window.testRunner) {
30 testRunner.clearAllDatabases();
31 testRunner.dumpAsText();
32 testRunner.waitUntilDone();
33 testRunner.evaluateScriptInIsolatedWorld(
35 "function creationCallback1(db)\n" +
36 "{\n" +
37 " alert(document.body.foo);\n" +
38 " window.location='javascript:done()';\n" +
39 "}\n" +
40 "var db1 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld', '1.0', '', 1, creationCallback1);");
42 var db2 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld2', '1.0', '', 1, creationCallback2);
44 </script>
45 </body>
46 </html>