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/persistence-sync-content.html

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: DevTools: add persistence/ module Created 4 years, 2 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
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../debugger-test.js"></script>
5 <script src="../workspace-test.js"></script>
6 <script src="../isolated-filesystem-test.js"></script>
7 <script src="./persistence-test.js"></script>
8 <script src="./resources/foo.js"></script>
9 <script>
10
11 function test()
12 {
13 var fs = new InspectorTest.TestFileSystem("file:///var/www");
14 var fsEntry = fs.root.mkdir("inspector").mkdir("persistence").mkdir("resourc es").addFile("foo.js", "window.foo = ()=>'foo';");
15
16 var networkCode, persistentCode;
17
18 InspectorTest.runTestSuite([
19 function addFileSystem(next)
20 {
21 fs.reportCreated(next);
22 },
23
24 function addFileMapping(next)
25 {
26 InspectorTest.waitForBinding("foo.js", onBindingCreated);
27 WebInspector.fileSystemMapping.addFileSystem(fs.fileSystemPath);
28 WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "ht tp://127.0.0.1:8000", "/");
29
30 function onBindingCreated(binding)
31 {
32 InspectorTest.addResult("Binding created: " + binding);
33 networkCode = binding.network;
34 persistentCode = binding.persistent;
35 next();
36 }
37 },
38
39 function changeNetworkUISourceCode(next)
40 {
41 networkCode.addRevision("window.foo2 = 2;");
42 InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_conte ntSyncedForTest", onSynced);
43
44 function onSynced()
45 {
46 InspectorTest.addResult(`network code: '${networkCode.workingCop y()}'`);
47 InspectorTest.addResult(`persistent code: '${persistentCode.work ingCopy()}'`);
48 next();
49 }
50 },
51
52 function changeFileSystem(next)
53 {
54 fsEntry.setContent("window.foo3 = 3;");
55 InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_conte ntSyncedForTest", onSynced);
56
57 function onSynced()
58 {
59 InspectorTest.addResult(`network code: '${networkCode.workingCop y()}'`);
60 InspectorTest.addResult(`persistent code: '${persistentCode.work ingCopy()}'`);
61 next();
62 }
63 }
64 ]);
65 };
66 </script>
67 </head>
68 <body onload="runTest()">
69 <p>Tests that persistence syncs network and filesystem UISourceCodes.</p>
70 </body>
71 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698