Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / indexeddb / transaction-promise-console.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../console-test.js"></script>
5 <script>
6 function test()
7 {
8     testRunner.waitUntilDone();
9     testRunner.showWebInspector();
10
11     var dbname = location.href;
12     indexedDB.deleteDatabase(dbname).onsuccess = function() {
13
14         var openRequest = indexedDB.open(dbname);
15         openRequest.onupgradeneeded = function() {
16             openRequest.result.createObjectStore('store');
17         };
18         openRequest.onsuccess = function(event) {
19             var db = event.target.result;
20             Promise.resolve().then(function() {
21                 tx = db.transaction('store');
22                 InspectorTest.evaluateInConsole("1 + 2");
23                 try {
24                     tx.objectStore('store').get(0);
25                     InspectorTest.addResult("PASS: Transaction is still active");
26                 } catch (ex) {
27                     InspectorTest.addResult("FAIL: " + ex.message);
28                 } finally {
29                     InspectorTest.completeTest();
30                 }
31             });
32         };
33     };
34 }
35
36 </script>
37 </head>
38 <body onload="runTest()">
39 <p>Ensure transactions created within Promise callbacks are not deactivated due to console activity</p>
40 </body>
41 </html>