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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)
Patch Set: typo Created 3 years, 9 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: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
index 46fc60e082ab3c19acff587388fc1aac8a84ef2a..53f1ba62c10623f4a107d4be9b11802a49fe0081 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
@@ -5,6 +5,12 @@
function test()
{
+ var mockTargetId = 1;
+ function createMockTarget(name, capabilities, dontAttachToMain)
+ {
+ return SDK.targetManager.createTarget('mock-target-' + mockTargetId++, name, capabilities, params => new SDK.StubConnection(params), dontAttachToMain ? null : InspectorTest.mainTarget);
+ }
+
var context = new UI.Context();
context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChanged, this);
context.addFlavorChangeListener(SDK.Target, targetChanged, this);
@@ -26,7 +32,7 @@ function test()
InspectorTest.addResult("");
InspectorTest.addResult("Adding page target");
- var pageTarget = InspectorTest.createMockTarget("page-target", SDK.Target.Capability.AllForTests, true /* dontAttachToMain */);
+ var pageTarget = createMockTarget("page-target", SDK.Target.Capability.AllForTests, true /* dontAttachToMain */);
SDK.ResourceTreeModel.fromTarget(pageTarget)._frameAttached('42', '');
SDK.ResourceTreeModel.fromTarget(pageTarget)._frameNavigated({id: '42', parentId: '', loaderId: '', name: 'mock-frame', url: 'mock-url.com/frame.html', securityOrigin: 'mock-security-origin', mineType: 'mimeType'});
pageTarget.runtimeModel._executionContextCreated({id: "cs1", auxData: { isDefault: false, frameId: "42" }, origin: "origin", name: "contentScript1"});
@@ -35,7 +41,7 @@ function test()
InspectorTest.addResult("");
InspectorTest.addResult("Adding sw target");
- var swTarget = InspectorTest.createMockTarget("sw-target", SDK.Target.Capability.Network | SDK.Target.Capability.Worker);
+ var swTarget = createMockTarget("sw-target", SDK.Target.Capability.Network | SDK.Target.Capability.Worker);
swTarget.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefault: true, frameId: "" }, origin: "origin", name: "swContext1Name"});
InspectorTest.addResult("");

Powered by Google App Engine
This is Rietveld 408576698