WebCore: Adding support for the optional creation callback that could be
[WebKit-https.git] / LayoutTests / storage / open-database-creation-callback-isolated-world.html
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 function done()
8 {
9     if (window.layoutTestController)
10         layoutTestController.notifyDone();
11 }
12
13 function creationCallback(db)
14 {
15     alert("FAIL: Visible in isolated world.");
16     done();
17 }
18
19 document.body.foo = "FAIL: document.body.foo visible in isolated world.";
20
21 if (window.layoutTestController) {
22     layoutTestController.clearAllDatabases();
23     layoutTestController.dumpAsText();
24     layoutTestController.waitUntilDone();
25     layoutTestController.evaluateScriptInIsolatedWorld(
26         0,
27         "function creationCallback(db)\n" +
28         "{\n" +
29         "    alert(document.body.foo);\n" +
30         "    window.location='javascript:done()';\n" +
31         "}\n" +
32         "var db = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld', '1.0', '', 1, creationCallback);");
33 }
34 </script>
35 </body>
36 </html>