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

Unified Diff: LayoutTests/http/tests/inspector/stylesheet-source-mapping.html

Issue 404763002: DevTools: Inject styleSheetId in WebInspector.CSSLocation constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased patch Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/inspector/stylesheet-source-mapping.html
diff --git a/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html b/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html
index 950704547d570b7fe07abef6e9f1b37664c18b17..e3b657e73e02acbeef8e6fa055112d6be6026bbf 100644
--- a/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html
+++ b/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html
@@ -18,6 +18,7 @@ function test()
InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(cssUISourceCodeAdded);
const styleSheetURL = "http://localhost:8000/inspector/resources/example.css";
const sourceMapURL = "example.css.map";
+ const styleSheetId = 1;
InspectorTest.addMockUISourceCodeToWorkspace(styleSheetURL, WebInspector.resourceTypes.Stylesheet, "");
InspectorTest.addSniffer(WebInspector.CSSStyleSheetHeader.prototype, "updateLocations", locationsUpdated, true);
@@ -25,7 +26,7 @@ function test()
function locationsUpdated()
{
- var uiLocation = new WebInspector.CSSLocation(WebInspector.targetManager.mainTarget(), "http://localhost:8000/inspector/resources/example.css", 2, 3).toUILocation();
+ var uiLocation = new WebInspector.CSSLocation(WebInspector.targetManager.mainTarget(), styleSheetId, styleSheetURL, 2, 3).toUILocation();
if (uiLocation.uiSourceCode.url.indexOf(".scss") === -1)
return;
finalMappedLocation = uiLocation.uiSourceCode.url + ":" + uiLocation.lineNumber + ":" + uiLocation.columnNumber;
@@ -37,7 +38,7 @@ function test()
{
const frame = WebInspector.resourceTreeModel.mainFrame;
return {
- styleSheetId: "1000",
+ styleSheetId: styleSheetId,
frameId: frame.id,
sourceURL: url,
sourceMapURL: sourceMapURL,
@@ -72,12 +73,12 @@ function test()
function rawLocationToUILocation(line, column)
{
- return new WebInspector.CSSLocation(WebInspector.targetManager.mainTarget(), "http://localhost:8000/inspector/resources/example.css", line, column).toUILocation();
+ return new WebInspector.CSSLocation(WebInspector.targetManager.mainTarget(), styleSheetId, styleSheetURL, line, column).toUILocation();
}
function afterStyleSheetAdded()
{
- var cssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForOriginURL("http://localhost:8000/inspector/resources/example.css");
+ var cssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForOriginURL(styleSheetURL);
var scssUISourceCode = InspectorTest.testWorkspace.uiSourceCodeForOriginURL("http://localhost:8000/inspector/resources/example.scss");
InspectorTest.checkUILocation(cssUISourceCode, 0, 3, rawLocationToUILocation(0, 3));

Powered by Google App Engine
This is Rietveld 408576698