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

Unified Diff: LayoutTests/http/tests/inspector/workspace-test.js

Issue 697563003: DevTools: do not show compiled script while source maps are being loaded. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/ tests 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
Index: LayoutTests/http/tests/inspector/workspace-test.js
diff --git a/LayoutTests/http/tests/inspector/workspace-test.js b/LayoutTests/http/tests/inspector/workspace-test.js
index 5d79a6b642a55b7cce23542637037b891d6d2696..0fe473d247062fc4c1ee46b7edbe7b88cf460cc8 100644
--- a/LayoutTests/http/tests/inspector/workspace-test.js
+++ b/LayoutTests/http/tests/inspector/workspace-test.js
@@ -17,7 +17,7 @@ InspectorTest.createWorkspace = function(ignoreEvents)
InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler);
}
-InspectorTest.waitForWorkspaceUISourceCodeAddedEvent = function(callback, count)
+InspectorTest.waitForWorkspaceUISourceCodeAddedEvent = function(callback, count, projectType)
{
InspectorTest.uiSourceCodeAddedEventsLeft = count || 1;
InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler);
@@ -25,6 +25,10 @@ InspectorTest.waitForWorkspaceUISourceCodeAddedEvent = function(callback, count)
function uiSourceCodeAdded(event)
{
+ if (projectType && event.data.project().type() !== projectType)
+ return;
+ if (!projectType && event.data.project().type() === WebInspector.projectTypes.Service)
+ return;
if (!(--InspectorTest.uiSourceCodeAddedEventsLeft)) {
InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded);
InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler);
@@ -37,12 +41,14 @@ InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent = function(callback, coun
{
InspectorTest.uiSourceCodeRemovedEventsLeft = count || 1;
InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler);
- InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeAdded);
+ InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved);
- function uiSourceCodeAdded(event)
+ function uiSourceCodeRemoved(event)
{
+ if (event.data.project().type() === WebInspector.projectTypes.Service)
+ return;
if (!(--InspectorTest.uiSourceCodeRemovedEventsLeft)) {
- InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeAdded);
+ InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved);
InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler);
}
callback(event.data);
@@ -60,6 +66,8 @@ InspectorTest._defaultWorkspaceEventHandler = function(event)
var uiSourceCode = event.data;
if (uiSourceCode.project().type() === WebInspector.projectTypes.Debugger && !uiSourceCode.url)
return;
+ if (uiSourceCode.project().type() === WebInspector.projectTypes.Service)
+ return;
throw new Error("Unexpected Workspace event: " + event.type + ": " + uiSourceCode.uri() + ".");
}
« no previous file with comments | « LayoutTests/http/tests/inspector/debugger-test.js ('k') | Source/devtools/front_end/bindings/CompilerScriptMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698