Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f739455e65f11be915691b0a0162a6da31416963 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html |
| @@ -0,0 +1,78 @@ |
| +<html> |
| +<head> |
| +<script src="../inspector-test.js"></script> |
| +<script src="../isolated-filesystem-test.js"></script> |
| +<script src="./persistence-test.js"></script> |
| +<script src="./automapping-test.js"></script> |
| +<script> |
| + |
| +function test() |
| +{ |
| + var timestamp = new Date("December 1, 1989"); |
| + var index_html = { |
| + contentType: WebInspector.resourceTypes.Document, |
| + content: "<body>this is main resource</body>", |
| + time: timestamp |
| + }; |
| + var foo_js = { |
| + content: "console.log('foo.js!');", |
| + time: null |
| + }; |
| + var bar_css = { |
| + contentType: WebInspector.resourceTypes.Stylesheet, |
| + content: "* { box-sizing: border-box }", |
| + time: timestamp |
| + }; |
| + var bazContent = "alert(1);"; |
| + |
| + var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Workspace()); |
| + automappingTest.addNetworkResources({ |
| + // Make sure main resource gets mapped. |
| + "http://example.com": index_html, |
| + |
| + // Make sure simple resource gets mapped. |
| + "http://example.com/path/foo.js": foo_js, |
| + |
| + // Make sure cache busting does not prevent mapping. |
| + "http://example.com/bar.css?12341234": bar_css, |
| + |
| + // Make sure files with different timestamps DO NOT map. |
| + "http://example.com/baz.js": { |
| + content: bazContent, |
| + time: new Date("December 3, 1989") |
| + }, |
| + |
| + // Make sure files with different content lenghts DO NOT map. |
| + "http://example.com/images/image.png": { |
| + content: "012345", |
| + time: timestamp |
| + }, |
| + }); |
| + |
| + var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
| + 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.
|
| + "index.html": index_html, |
| + "scripts/foo.js": foo_js, |
| + "styles/bar.css": bar_css, |
| + "scripts/baz.js": { |
| + content: bazContent, |
| + time: new Date("December 4, 1989") |
| + }, |
| + "images/image.png": { |
| + content: "0123456789", |
| + time: timestamp |
| + }, |
| + }); |
| + fs.reportCreated(onFileSystemCreated); |
| + |
| + function onFileSystemCreated() |
| + { |
| + automappingTest.waitUntilMappingIsStabilized(InspectorTest.completeTest.bind(InspectorTest)); |
| + } |
| +} |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p>Verify that automapping is sane.</p> |
| +</body> |
| +</html> |