Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html

Issue 2418813005: DevTools: [Persistence] implement automapping (Closed)
Patch Set: address comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../isolated-filesystem-test.js"></script>
5 <script src="./persistence-test.js"></script>
6 <script src="./automapping-test.js"></script>
7 <script>
8
9 function test()
10 {
11 var timestamp = new Date("December 1, 1989");
12 var index_html = {
13 contentType: WebInspector.resourceTypes.Document,
14 content: "<body>this is main resource</body>",
15 time: timestamp
16 };
17 var foo_js = {
18 content: "console.log('foo.js!');",
19 time: null
20 };
21 var bar_css = {
22 contentType: WebInspector.resourceTypes.Stylesheet,
23 content: "* { box-sizing: border-box }",
24 time: timestamp
25 };
26 var elements_module_json = { content: "module descriptor 1" };
27 var sources_module_json = { content: "module descriptor 2" };
28 var bazContent = "alert(1);";
29
30 var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Wor kspace());
31 automappingTest.addNetworkResources({
32 // Make sure main resource gets mapped.
33 "http://example.com": index_html,
34
35 // Make sure simple resource gets mapped.
36 "http://example.com/path/foo.js": foo_js,
37
38 // Make sure cache busting does not prevent mapping.
39 "http://example.com/bar.css?12341234": bar_css,
40
41 // Make sure files with different timestamps DO NOT map.
42 "http://example.com/baz.js": {
43 content: bazContent,
44 time: new Date("December 3, 1989")
45 },
46
47 // Make sure files with different content lenghts DO NOT map.
48 "http://example.com/images/image.png": {
49 content: "012345",
50 time: timestamp
51 },
52
53 // Make sure assets are mapped based on path.
54 "http://example.com/elements/module.json": elements_module_json,
55 "http://example.com/sources/module.json": sources_module_json,
56 });
57
58 var fs = new InspectorTest.TestFileSystem("file:///var/www");
59 InspectorTest.addFiles(fs, {
60 "index.html": index_html,
61 "scripts/foo.js": foo_js,
62 "styles/bar.css": bar_css,
63 "scripts/baz.js": {
64 content: bazContent,
65 time: new Date("December 4, 1989")
66 },
67 "images/image.png": {
68 content: "0123456789",
69 time: timestamp
70 },
71 "modules/elements/module.json": elements_module_json,
72 "modules/sources/module.json": sources_module_json
73 });
74 fs.reportCreated(onFileSystemCreated);
75
76 function onFileSystemCreated()
77 {
78 automappingTest.waitUntilMappingIsStabilized(InspectorTest.completeTest. bind(InspectorTest));
79 }
80 }
81 </script>
82 </head>
83 <body onload="runTest()">
84 <p>Verify that automapping is sane.</p>
85 </body>
86 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698