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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html

Issue 2784733002: DevTools: prepare tests for Persistence2.0 release (Closed)
Patch Set: address comments + three special tests Created 3 years, 8 months 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../inspector-test.js"></script> 3 <script src="../inspector-test.js"></script>
4 <script src="../debugger-test.js"></script> 4 <script src="../debugger-test.js"></script>
5 <script src="../isolated-filesystem-test.js"></script> 5 <script src="../isolated-filesystem-test.js"></script>
6 <script src="./persistence-test.js"></script> 6 <script src="./persistence-test.js"></script>
7 <script> 7 <script>
8 8
9 async function test() 9 async function test()
10 { 10 {
11 var testMapping = InspectorTest.initializeTestMapping();
11 // Pretend we are running under V8 front-end. 12 // Pretend we are running under V8 front-end.
12 SDK.targetManager.mainTarget().setIsNodeJSForTest(); 13 SDK.targetManager.mainTarget().setIsNodeJSForTest();
13 14
14 var content = [ 15 var content = [
15 '', 16 '',
16 '', 17 '',
17 'var express = require("express");', 18 'var express = require("express");',
18 '//TODO' 19 '//TODO'
19 ].join("\n"); 20 ].join("\n");
20 21
21 var fsContent = Persistence.Persistence._NodeShebang + content; 22 var fsContent = Persistence.Persistence._NodeShebang + content;
22 var nodeContent = Persistence.Persistence._NodePrefix + content + Persistenc e.Persistence._NodeSuffix; 23 var nodeContent = Persistence.Persistence._NodePrefix + content + Persistenc e.Persistence._NodeSuffix;
23 24
24 InspectorTest.addResult("Initial fileSystem content:"); 25 InspectorTest.addResult("Initial fileSystem content:");
25 InspectorTest.addResult(indent(fsContent)); 26 InspectorTest.addResult(indent(fsContent));
26 InspectorTest.addResult("\n Initial network content:"); 27 InspectorTest.addResult("\n Initial network content:");
27 InspectorTest.addResult(indent(nodeContent)); 28 InspectorTest.addResult(indent(nodeContent));
28 29
29 await InspectorTest.addScriptUISourceCode("http://127.0.0.1:8000/nodejs.js", nodeContent); 30 await InspectorTest.addScriptUISourceCode("http://127.0.0.1:8000/nodejs.js", nodeContent);
30 31
31 // Add filesystem UISourceCode and mapping. 32 // Add filesystem UISourceCode and mapping.
32 var fs = new InspectorTest.TestFileSystem("file:///var/www"); 33 var fs = new InspectorTest.TestFileSystem("file:///var/www");
33 var fsEntry = fs.root.addFile("nodejs.js", fsContent); 34 var fsEntry = fs.root.addFile("nodejs.js", fsContent);
34 fs.addFileMapping("http://127.0.0.1:8000", "/");
35 fs.reportCreated(function() { }); 35 fs.reportCreated(function() { });
36 36
37 var binding; 37 var binding;
38 testMapping.addBinding("nodejs.js");
38 InspectorTest.waitForBinding("nodejs.js").then(onBindingCreated); 39 InspectorTest.waitForBinding("nodejs.js").then(onBindingCreated);
39 40
40 function onBindingCreated(theBinding) 41 function onBindingCreated(theBinding)
41 { 42 {
42 binding = theBinding; 43 binding = theBinding;
43 InspectorTest.addResult("Binding created: " + binding); 44 InspectorTest.addResult("Binding created: " + binding);
44 InspectorTest.runTestSuite(testSuite); 45 InspectorTest.runTestSuite(testSuite);
45 } 46 }
46 47
47 var testSuite = [ 48 var testSuite = [
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 { 113 {
113 return content.split("\n").map(line => " " + line).join("\n"); 114 return content.split("\n").map(line => " " + line).join("\n");
114 } 115 }
115 }; 116 };
116 </script> 117 </script>
117 </head> 118 </head>
118 <body onload="runTest()"> 119 <body onload="runTest()">
119 <p>Verify that syncing Node.js contents works fine.</p> 120 <p>Verify that syncing Node.js contents works fine.</p>
120 </body> 121 </body>
121 </html> 122 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698