3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script type="text/javascript">
7 function dumpHistory(history)
9 InspectorTest.addResult(" history = [" + String(history._urls) + "]");
12 function updateAndDump(history, urls)
18 function removeAndDump(history, url)
26 return "url_" + index;
29 var history = new WebInspector.TabbedEditorContainer.History([]);
32 // Emulate opening of several tabs.
33 updateAndDump(history, [url(1)]);
34 updateAndDump(history, [url(2), url(1)]);
35 updateAndDump(history, [url(3), url(2), url(1)]);
36 // Emulate switching between tabs.
37 updateAndDump(history, [url(2), url(3), url(1)]);
38 updateAndDump(history, [url(1), url(2), url(3)]);
39 // Emulate opening of several tabs from another page.
40 updateAndDump(history, [url(11)]);
41 updateAndDump(history, [url(12), url(11)]);
42 updateAndDump(history, [url(13), url(12), url(11)]);
43 // ... and switching between them.
44 updateAndDump(history, [url(12), url(13), url(11)]);
45 updateAndDump(history, [url(11), url(12), url(13)]);
46 // Now close some tabs.
47 removeAndDump(history, url(11));
48 removeAndDump(history, url(13));
49 // Now open some other instead of them.
50 updateAndDump(history, [url(14), url(12)]);
51 updateAndDump(history, [url(15), url(14), url(12)]);
52 updateAndDump(history, [url(16), url(15), url(14), url(12)]);
53 // Close all of them one by one.
54 removeAndDump(history, url(16));
55 removeAndDump(history, url(15));
56 removeAndDump(history, url(14));
57 removeAndDump(history, url(12));
58 removeAndDump(history, url(1));
59 removeAndDump(history, url(2));
60 removeAndDump(history, url(3));
62 InspectorTest.completeTest();
66 <body onload="runTest()">
67 <p>Tests history saving logic in TabbedEditorContainer.</p>
68 <a href="https://bugs.webkit.org/show_bug.cgi?id=76912">Bug 76912</a>