Add ewk_view_fullscreen_exit to exit fullscreen mode
[framework/web/webkit-efl.git] / LayoutTests / inspector / storage-panel-dom-storage.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function populateDOMStorage()
7 {
8     localStorage.clear();
9     sessionStorage.clear();
10     localStorage["resource-history"] = "{}"; // This mitigates file:// localstorage conflict.
11     // Fill local and session storage with some random strings.
12     for (var i = 0; i < 10; i++) {
13         localStorage["a" + i] = "=value" + i + ", ";
14         sessionStorage["b" + i] = "=value" + (i+10) + ", ";
15     }
16 }
17
18 function test()
19 {
20     WebInspector.showPanel("resources");
21
22     InspectorTest.evaluateInPage("populateDOMStorage()", function(result) {
23         InspectorTest.addResult("Populated local and session storage");
24     });
25     function name(storage) {
26         return storage.isLocalStorage ? "Local storage" : "Session storage";
27     }
28
29     function dumpDataGridContent(dataGrid)
30     {
31         var nodes = dataGrid.rootNode().children;
32         var rows = [];
33         for (var i = 0; i < nodes.length; ++i) {
34             var node = nodes[i];
35             rows.push(node._data[0] + node._data[1]);
36         }
37         rows.sort();
38         InspectorTest.addResult("KeyValue pairs: " + rows.join(''));
39     }
40
41     InspectorTest.runAfterPendingDispatches(function() {
42         var storages = WebInspector.panels.resources._domStorage;
43         if (storages) {
44             for (var i = 0; i < storages.length; i++) {
45                 var storage = storages[i];
46                 WebInspector.inspectorView.currentPanel().showDOMStorage(storage);
47                 InspectorTest.addResult("Did show: " + name(storage));
48             }
49         } else
50             InspectorTest.addResult("FAIL: no DOM storages found.");
51
52         InspectorTest.runAfterPendingDispatches(function() {
53             var storages = WebInspector.panels.resources._domStorage;
54             for (var i = 0; i < storages.length; i++) {
55                 var storage = storages[i];
56                 InspectorTest.addResult(name(storage) + " content: ");
57                 dumpDataGridContent(storage._domStorageView._dataGrid);
58             }
59             InspectorTest.addResult("DONE");
60             InspectorTest.completeTest();
61         });
62     });
63 }
64
65 </script>
66 </head>
67
68 <body onload="runTest()">
69 <p>
70 Test that storage panel is present and that it contains correct data for local and session DOM storages.
71 </p>
72
73 </body>
74 </html>