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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html

Issue 2506463002: DevTools: remove Bindings.NetworkMapping.addMapping/removeMapping methods (Closed)
Patch Set: rebaseline 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script> 4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../../http/tests/inspector/workspace-test.js"></script> 5 <script src="../../../http/tests/inspector/workspace-test.js"></script>
6 <script src="../../../http/tests/inspector/isolated-filesystem-test.js"></script > 6 <script src="../../../http/tests/inspector/isolated-filesystem-test.js"></script >
7 <script src="../../../http/tests/inspector/live-edit-test.js"></script> 7 <script src="../../../http/tests/inspector/live-edit-test.js"></script>
8 <script> 8 <script>
9 9
10 function test() 10 function test()
11 { 11 {
12 var target; 12 var target;
13 var resourceScriptMapping; 13 var resourceScriptMapping;
14 var defaultScriptMapping; 14 var defaultScriptMapping;
15 var persistence; 15 var persistence;
16 var fileSystemProjectId = Bindings.FileSystemWorkspaceBinding.projectId("fil e:///var/www"); 16 var fileSystemProjectId = Bindings.FileSystemWorkspaceBinding.projectId("fil e:///var/www");
17 Bindings.networkMapping.dispose();
18 17
19 function createWorkspaceWithTarget() 18 function createWorkspaceWithTarget()
20 { 19 {
21 target = InspectorTest.createWorkspaceWithTarget(false); 20 target = InspectorTest.createWorkspaceWithTarget(false);
22 var entry = InspectorTest.testDebuggerWorkspaceBinding._targetToData.get (target); 21 var entry = InspectorTest.testDebuggerWorkspaceBinding._targetToData.get (target);
23 resourceScriptMapping = entry._resourceMapping; 22 resourceScriptMapping = entry._resourceMapping;
24 defaultScriptMapping = entry._defaultMapping; 23 defaultScriptMapping = entry._defaultMapping;
25 if (persistence) 24 if (persistence)
26 persistence.dispose(); 25 persistence.dispose();
27 persistence = new Persistence.Persistence(InspectorTest.testWorkspace, B indings.breakpointManager, Workspace.fileSystemMapping); 26 persistence = new Persistence.Persistence(InspectorTest.testWorkspace, B indings.breakpointManager, Workspace.fileSystemMapping);
(...skipping 25 matching lines...) Expand all
53 function fileSystemCreated1() 52 function fileSystemCreated1()
54 { 53 {
55 InspectorTest.addResult("Adding network resource."); 54 InspectorTest.addResult("Adding network resource.");
56 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target); 55 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target);
57 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ba r.js", Common.resourceTypes.Script, "<foo content>", target); 56 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ba r.js", Common.resourceTypes.Script, "<foo content>", target);
58 dumpFileSystemUISourceCodesMappings(); 57 dumpFileSystemUISourceCodesMappings();
59 58
60 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(file SystemProjectId, "file:///var/www/html/foo.js"); 59 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(file SystemProjectId, "file:///var/www/html/foo.js");
61 networkUISourceCode = InspectorTest.testWorkspace.uiSourceCode(B indings.NetworkProject.projectId(target, target.resourceTreeModel.mainFrame, fal se), "http://localhost/html/foo.js"); 60 networkUISourceCode = InspectorTest.testWorkspace.uiSourceCode(B indings.NetworkProject.projectId(target, target.resourceTreeModel.mainFrame, fal se), "http://localhost/html/foo.js");
62 InspectorTest.addResult("Adding mapping between network and file system resources."); 61 InspectorTest.addResult("Adding mapping between network and file system resources.");
63 InspectorTest.testNetworkMapping.addMapping(networkUISourceCode, uiSourceCode); 62
63 var fileSystemPath = Bindings.FileSystemWorkspaceBinding.fileSys temPath(uiSourceCode.project().id());
64 Workspace.fileSystemMapping.addMappingForResource(networkUISourc eCode.url(), fileSystemPath, uiSourceCode.url());
64 var setting = JSON.stringify(Workspace.fileSystemMapping._fileSy stemMappingSetting.get()); 65 var setting = JSON.stringify(Workspace.fileSystemMapping._fileSy stemMappingSetting.get());
65 66
66 InspectorTest.addResult("Emulate reloading inspector."); 67 InspectorTest.addResult("Emulate reloading inspector.");
67 fs.reportRemoved(); 68 fs.reportRemoved();
68 createWorkspaceWithTarget(); 69 createWorkspaceWithTarget();
69 Workspace.fileSystemMapping._fileSystemMappingSetting.set(JSON.p arse(setting)); 70 Workspace.fileSystemMapping._fileSystemMappingSetting.set(JSON.p arse(setting));
70 Workspace.fileSystemMapping._loadFromSettings(); 71 Workspace.fileSystemMapping._loadFromSettings();
71 fs.reportCreated(fileSystemCreated2); 72 fs.reportCreated(fileSystemCreated2);
72 } 73 }
73 74
74 function fileSystemCreated2() 75 function fileSystemCreated2()
75 { 76 {
76 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target); 77 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target);
77 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ba r.js", Common.resourceTypes.Script, "<foo content>", target); 78 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ba r.js", Common.resourceTypes.Script, "<foo content>", target);
78 79
79 dumpFileSystemUISourceCodesMappings(); 80 dumpFileSystemUISourceCodesMappings();
80 81
81 InspectorTest.addResult("Removing mapping between network and fi le system resources."); 82 InspectorTest.addResult("Removing mapping between network and fi le system resources.");
82 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(file SystemProjectId, "file:///var/www/html/foo.js"); 83 var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(file SystemProjectId, "file:///var/www/html/foo.js");
83 InspectorTest.testNetworkMapping.removeMapping(uiSourceCode); 84 Workspace.fileSystemMapping.removeMappingForURL(uiSourceCode.url ());
84 85
85 InspectorTest.addResult("Emulate reloading inspector."); 86 InspectorTest.addResult("Emulate reloading inspector.");
86 fs.reportRemoved(); 87 fs.reportRemoved();
87 createWorkspaceWithTarget(); 88 createWorkspaceWithTarget();
88 fs.reportCreated(fileSystemCreated3); 89 fs.reportCreated(fileSystemCreated3);
89 } 90 }
90 91
91 function fileSystemCreated3() 92 function fileSystemCreated3()
92 { 93 {
93 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target); 94 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/ht ml/foo.js", Common.resourceTypes.Script, "<foo content>", target);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 157 }
157 } 158 }
158 ]); 159 ]);
159 }; 160 };
160 </script> 161 </script>
161 </head> 162 </head>
162 <body onload="runTest()"> 163 <body onload="runTest()">
163 <p>Tests file system project mappings.</p> 164 <p>Tests file system project mappings.</p>
164 </body> 165 </body>
165 </html> 166 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698