Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / snippet-storage.html
blob38c9aad9c3c67945180beebe5b8cdc56cc4cab26
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5 function test()
7 var settingPrefix = "test";
8 var namePrefix = "Test snippet #";
9 var snippetStorage = new WebInspector.SnippetStorage(settingPrefix, namePrefix);
11 function dumpSnippets(snippets)
13 for (var i = 0; i < snippets.length; ++i) {
14 var snippet = snippets[i];
15 InspectorTest.addResult(" Snippet: id = " + snippet.id + ", name = '" + snippet.name + "', content = '" + snippet.content + "'.");
19 function dumpSavedSnippets()
21 InspectorTest.addResult("Dumping saved snippets:");
22 dumpSnippets(snippetStorage._snippetsSetting.get());
25 function dumpStorageSnippets()
27 InspectorTest.addResult("Dumping storage snippets:");
28 dumpSnippets(snippetStorage.snippets);
31 dumpSavedSnippets();
32 dumpStorageSnippets();
33 var snippet = snippetStorage.createSnippet();
34 InspectorTest.addResult("Snippet created.");
35 dumpSavedSnippets();
36 dumpStorageSnippets();
37 snippet.name = "New snippet name";
38 InspectorTest.addResult("Snippet renamed.");
39 dumpSavedSnippets();
40 dumpStorageSnippets();
41 snippet.content = "New snippet content";
42 InspectorTest.addResult("Snippet content changed.");
43 dumpSavedSnippets();
44 dumpStorageSnippets();
45 var anotherSnippet = snippetStorage.createSnippet();
46 InspectorTest.addResult("Another snippet created.");
47 dumpSavedSnippets();
48 dumpStorageSnippets();
49 snippetStorage.deleteSnippet(snippet);
50 InspectorTest.addResult("Snippet deleted.");
51 dumpSavedSnippets();
52 dumpStorageSnippets();
53 snippetStorage.deleteSnippet(anotherSnippet);
54 InspectorTest.addResult("Another snippet deleted.");
55 dumpSavedSnippets();
56 dumpStorageSnippets();
58 InspectorTest.completeTest();
60 </script>
61 </head>
62 <body onload="runTest()">
63 <p>Tests snippet storage.</p>
64 </body>
65 </html>