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