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

Side by Side Diff: LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html

Issue 220903002: DevTools: wrap DebuggerAgent.Location with DebuggerModel.Location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All tests!!! Created 6 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 | Annotate | Revision Log
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="../../isolated-filesystem-test.js"></script> 4 <script src="../../isolated-filesystem-test.js"></script>
5 <script src="../../workspace-test.js"></script> 5 <script src="../../workspace-test.js"></script>
6 <script> 6 <script>
7 function test() 7 function test()
8 { 8 {
9 var manager; 9 var manager;
10 var fileSystem; 10 var fileSystem;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 if (!uiLocation) { 55 if (!uiLocation) {
56 InspectorTest.addResult("Null uiLocation"); 56 InspectorTest.addResult("Null uiLocation");
57 return; 57 return;
58 } 58 }
59 InspectorTest.addResult(uiLocation.uiSourceCode.url + ":" + uiLocation.l ineNumber + ":" + uiLocation.columnNumber); 59 InspectorTest.addResult(uiLocation.uiSourceCode.url + ":" + uiLocation.l ineNumber + ":" + uiLocation.columnNumber);
60 } 60 }
61 61
62 InspectorTest.createWorkspace(); 62 InspectorTest.createWorkspace();
63 manager = InspectorTest.createIsolatedFileSystemManager(InspectorTest.testWo rkspace, InspectorTest.testFileSystemMapping); 63 manager = InspectorTest.createIsolatedFileSystemManager(InspectorTest.testWo rkspace, InspectorTest.testFileSystemMapping);
64 cssModel = new WebInspector.CSSStyleModel(WebInspector.targetManager.activeT arget(), InspectorTest.testWorkspace); 64 cssModel = new WebInspector.CSSStyleModel(WebInspector.targetManager.activeT arget(), InspectorTest.testWorkspace);
65 WebInspector.targetManager.activeTarget().cssModel = cssModel;
65 new WebInspector.CSSStyleSheetMapping(cssModel, InspectorTest.testWorkspace, InspectorTest.testNetworkWorkspaceProvider); 66 new WebInspector.CSSStyleSheetMapping(cssModel, InspectorTest.testWorkspace, InspectorTest.testNetworkWorkspaceProvider);
66 67
67 var resourcesURL = WebInspector.ParsedURL.completeURL(WebInspector.resourceT reeModel.inspectedPageURL(), "resources/"); 68 var resourcesURL = WebInspector.ParsedURL.completeURL(WebInspector.resourceT reeModel.inspectedPageURL(), "resources/");
68 var namePrefix = "update-locations-on-filesystem-scss-load." 69 var namePrefix = "update-locations-on-filesystem-scss-load."
69 var cssURL = resourcesURL + namePrefix + "css"; 70 var cssURL = resourcesURL + namePrefix + "css";
70 var scssURL = resourcesURL + namePrefix + "scss"; 71 var scssURL = resourcesURL + namePrefix + "scss";
71 var cssLocation = new WebInspector.CSSLocation(cssURL, 0, 1); 72 var cssLocation = new WebInspector.CSSLocation(WebInspector.targetManager.ac tiveTarget(), cssURL, 0, 1);
72 var scssContent = 73 var scssContent =
73 ["a {", 74 ["a {",
74 " foo: bar;", 75 " foo: bar;",
75 "/* COMMENT */", 76 "/* COMMENT */",
76 " font-size: 12px;", 77 " font-size: 12px;",
77 "}"].join("\n"); 78 "}"].join("\n");
78 var cssContent = 79 var cssContent =
79 ["a {", 80 ["a {",
80 " foo: bar;", 81 " foo: bar;",
81 " /* COMMENT */", 82 " /* COMMENT */",
82 " font-size: 12px; }"].join("\n"); 83 " font-size: 12px; }"].join("\n");
83 84
84 var files = {}; 85 var files = {};
85 files["/" + namePrefix + "css"] = cssContent; 86 files["/" + namePrefix + "css"] = cssContent;
86 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded, 4); 87 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded, 4);
87 InspectorTest.addResult("Adding file system."); 88 InspectorTest.addResult("Adding file system.");
88 manager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileS ystemAdded, fileSystemAdded, this); 89 manager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileS ystemAdded, fileSystemAdded, this);
89 manager.addMockFileSystem(fileSystemPath); 90 manager.addMockFileSystem(fileSystemPath);
90 InspectorTest.testFileSystemMapping.addFileMapping(fileSystemPath, resources URL, "/"); 91 InspectorTest.testFileSystemMapping.addFileMapping(fileSystemPath, resources URL, "/");
91 manager.addFiles(fileSystemPath, files); 92 manager.addFiles(fileSystemPath, files);
92 93
93 InspectorTest.addSniffer(WebInspector.SASSSourceMapping.prototype, "_bindUIS ourceCode", afterBind); 94 InspectorTest.addSniffer(WebInspector.SASSSourceMapping.prototype, "_bindUIS ourceCode", afterBind);
94 95
95 InspectorTest.addResult("Adding stylesheet header."); 96 InspectorTest.addResult("Adding stylesheet header.");
96 addMockHeader(cssURL, cssURL + ".map"); 97 addMockHeader(cssURL, cssURL + ".map");
97 InspectorTest.addResult("Adding network resource."); 98 InspectorTest.addResult("Adding network resource.");
98 InspectorTest.addMockUISourceCodeToWorkspace(cssURL, WebInspector.resourceTy pes.Stylesheet, cssContent); 99 InspectorTest.addMockUISourceCodeToWorkspace(cssURL, WebInspector.resourceTy pes.Stylesheet, cssContent);
99 liveLocation = cssModel.createLiveLocation("1", cssLocation, updateDelegate) ; 100 liveLocation = cssLocation.createLiveLocation("1", updateDelegate);
100 dumpLiveLocation(); 101 dumpLiveLocation();
101 102
102 InspectorTest.addResult("Adding filesystem SCSS."); 103 InspectorTest.addResult("Adding filesystem SCSS.");
103 var scssPath = namePrefix + "scss"; 104 var scssPath = namePrefix + "scss";
104 fileSystem.setFileContent(scssPath, scssContent, function() {}); 105 fileSystem.setFileContent(scssPath, scssContent, function() {});
105 InspectorTest.addMockUISourceCodeToWorkspace(scssURL, WebInspector.resourceT ypes.Stylesheet, scssContent); 106 InspectorTest.addMockUISourceCodeToWorkspace(scssURL, WebInspector.resourceT ypes.Stylesheet, scssContent);
106 manager.fileSystemWorkspaceProvider._projectDelegates[fileSystemProjectId]._ addFile(scssPath); 107 manager.fileSystemWorkspaceProvider._projectDelegates[fileSystemProjectId]._ addFile(scssPath);
107 108
108 function afterBind() 109 function afterBind()
109 { 110 {
110 dumpLiveLocation(); 111 dumpLiveLocation();
111 InspectorTest.completeTest(); 112 InspectorTest.completeTest();
112 } 113 }
113 }; 114 };
114 </script> 115 </script>
115 </head> 116 </head>
116 <body onload="runTest()"> 117 <body onload="runTest()">
117 <p>Tests that stylesheet LiveLocations are updated when an SCSS file is added fr om the filesystem.</p> 118 <p>Tests that stylesheet LiveLocations are updated when an SCSS file is added fr om the filesystem.</p>
118 </body> 119 </body>
119 </html> 120 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/debugger-test.js ('k') | LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698