Add ewk_view_fullscreen_exit to exit fullscreen mode
[framework/web/webkit-efl.git] / LayoutTests / inspector / tabbed-editors-history.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script type="text/javascript">
5 var test = function()
6 {
7     function dumpHistory(history)
8     {
9         InspectorTest.addResult("  history = " + JSON.stringify(history._serializeToObject()) + "");
10     }
11
12     function updateScrollAndSelectionAndDump(history, url, scrollLineNumber, selection)
13     {
14         history.updateScrollLineNumber(url, scrollLineNumber);
15         history.updateSelectionRange(url, selection);
16         dumpHistory(history);
17     }
18
19     function updateAndDump(history, urls)
20     {
21         history.update(urls);
22         dumpHistory(history);
23     }
24
25     function removeAndDump(history, url)
26     {
27         history.remove(url);
28         dumpHistory(history);
29     }
30
31     function url(index)
32     {
33         return "url_" + index;
34     }
35
36     var history = new WebInspector.TabbedEditorContainer.History([]);
37
38     dumpHistory(history);
39     // Emulate opening of several tabs.
40     updateAndDump(history, [url(1)]);
41     updateAndDump(history, [url(2), url(1)]);
42     updateAndDump(history, [url(3), url(2), url(1)]);
43     // Emulate switching between tabs.
44     updateAndDump(history, [url(2), url(3), url(1)]);
45     updateAndDump(history, [url(1), url(2), url(3)]);
46     // Emulate opening of several tabs from another page.
47     updateAndDump(history, [url(11)]);
48     updateAndDump(history, [url(12), url(11)]);
49     updateAndDump(history, [url(13), url(12), url(11)]);
50     // ... and switching between them.
51     updateAndDump(history, [url(12), url(13), url(11)]);
52     updateAndDump(history, [url(11), url(12), url(13)]);
53     updateScrollAndSelectionAndDump(history, url(11), 10, new WebInspector.TextRange(15, 5, 15, 10));
54     // Now close some tabs.
55     removeAndDump(history, url(11));
56     removeAndDump(history, url(13));
57     // Now open some other instead of them.
58     updateAndDump(history, [url(14), url(12)]);
59     updateAndDump(history, [url(15), url(14), url(12)]);
60     updateAndDump(history, [url(16), url(15), url(14), url(12)]);
61     // Close all of them one by one.
62     removeAndDump(history, url(16));
63     removeAndDump(history, url(15));
64     removeAndDump(history, url(14));
65     removeAndDump(history, url(12));
66     removeAndDump(history, url(1));
67     removeAndDump(history, url(2));
68     removeAndDump(history, url(3));
69
70     InspectorTest.completeTest();
71 }
72 </script>
73 </head>
74 <body onload="runTest()">
75 <p>Tests history saving logic in TabbedEditorContainer.</p>
76 <a href="https://bugs.webkit.org/show_bug.cgi?id=76912">Bug 76912</a>
77 </body>
78 </html>