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

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

Issue 2418813005: DevTools: [Persistence] implement automapping (Closed)
Patch Set: update UI 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 bazContent = "alert(1);";
27
28 var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Wor kspace());
29 automappingTest.addNetworkResources({
30 // Make sure main resource gets mapped.
31 "http://example.com": index_html,
32
33 // Make sure simple resource gets mapped.
34 "http://example.com/path/foo.js": foo_js,
35
36 // Make sure cache busting does not prevent mapping.
37 "http://example.com/bar.css?12341234": bar_css,
38
39 // Make sure files with different timestamps DO NOT map.
40 "http://example.com/baz.js": {
41 content: bazContent,
42 time: new Date("December 3, 1989")
43 },
44
45 // Make sure files with different content lenghts DO NOT map.
46 "http://example.com/images/image.png": {
47 content: "012345",
48 time: timestamp
49 },
50 });
51
52 var fs = new InspectorTest.TestFileSystem("file:///var/www");
53 InspectorTest.addFiles(fs, {
dgozman 2016/10/25 01:51:47 Let's have two different resources mapped with sim
lushnikov 2016/10/25 03:32:41 Done.
54 "index.html": index_html,
55 "scripts/foo.js": foo_js,
56 "styles/bar.css": bar_css,
57 "scripts/baz.js": {
58 content: bazContent,
59 time: new Date("December 4, 1989")
60 },
61 "images/image.png": {
62 content: "0123456789",
63 time: timestamp
64 },
65 });
66 fs.reportCreated(onFileSystemCreated);
67
68 function onFileSystemCreated()
69 {
70 automappingTest.waitUntilMappingIsStabilized(InspectorTest.completeTest. bind(InspectorTest));
71 }
72 }
73 </script>
74 </head>
75 <body onload="runTest()">
76 <p>Verify that automapping is sane.</p>
77 </body>
78 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698