| 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>
|
|
|