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

Unified Diff: LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html

Issue 661923005: DevTools: [Workspace] fix removing stylesheet-related uiSourceCodes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: add one more testcase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/network-uisourcecode-provider-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html
diff --git a/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html b/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html
index 4e20316825eb0a06ac9b43d1306804026859168b..1104d840caeb77eb1e15f78c39c000dc4d68b644 100644
--- a/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html
+++ b/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html
@@ -8,15 +8,20 @@ function test()
{
var mockContentsMap = {};
var lastResourceId = 0;
+ var lastStyleSheetId = 0;
- var mockStyleSheetHeader = {
- styleSheetId: "1",
- sourceURL: "foo.css",
- sourceMapURL: "",
- origin: "regular",
- title: "",
- disabled: false
- };
+
+ function createMockStyleSheetHeader(url)
+ {
+ return {
+ styleSheetId: (++lastStyleSheetId) + "",
+ sourceURL: url,
+ sourceMapURL: "",
+ origin: "regular",
+ title: "",
+ disabled: false
+ };
+ }
NetworkAgent.getResponseBody = function(requestId, callback)
{
@@ -138,27 +143,39 @@ function test()
}
},
- function testRemoveStyleSheetFromModel(next)
+ function testRemoveStyleSheetFromModelWithComplexURL(next)
{
- var networkUISourceCodeProvider = createNetworkUISourceCodeProvider();
- var target = WebInspector.targetManager.mainTarget();
- InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded);
- target.cssModel._styleSheetAdded(mockStyleSheetHeader);
-
- function uiSourceCodeAdded(uiSourceCode)
- {
- InspectorTest.addResult("Added uiSourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode));
- InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent(uiSourceCodeRemoved);
- target.cssModel._styleSheetRemoved(mockStyleSheetHeader.styleSheetId);
- }
+ var mockStyleSheetHeader = createMockStyleSheetHeader("http://example.com/foo.css");
+ testRemoveStyleSheetFromModel(mockStyleSheetHeader, next);
+ },
- function uiSourceCodeRemoved(uiSourceCode)
- {
- InspectorTest.addResult("Removed uiSourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode));
- next();
- }
+ function testRemoveStyleSheetFromModelWithSimpleURL(next)
+ {
+ var mockStyleSheetHeader = createMockStyleSheetHeader("foo.css");
+ testRemoveStyleSheetFromModel(mockStyleSheetHeader, next);
}
]);
+
+ function testRemoveStyleSheetFromModel(mockStyleSheetHeader, callback)
+ {
+ var networkUISourceCodeProvider = createNetworkUISourceCodeProvider();
+ var target = WebInspector.targetManager.mainTarget();
+ InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded);
+ target.cssModel._styleSheetAdded(mockStyleSheetHeader);
+
+ function uiSourceCodeAdded(uiSourceCode)
+ {
+ InspectorTest.addResult("Added uiSourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode));
+ InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent(uiSourceCodeRemoved);
+ target.cssModel._styleSheetRemoved(mockStyleSheetHeader.styleSheetId);
+ }
+
+ function uiSourceCodeRemoved(uiSourceCode)
+ {
+ InspectorTest.addResult("Removed uiSourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode));
+ callback();
+ }
+ }
};
</script>
</head>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/network-uisourcecode-provider-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698