Commit 566b6b5d authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Cleanup after introducing SDK.Target.Type

We don't need some test runner methods anymore.

We can also determine capabilities by type instead of passing
them separately.

Bug: 882467
Change-Id: I0dc07f4379141905d41968f969650f3d794fdee2
Reviewed-on: https://chromium-review.googlesource.com/c/1311839
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604598}
parent 65bd6ae1
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
function isDedicatedWorker() { function isDedicatedWorker() {
var target = UI.context.flavor(SDK.ExecutionContext).target(); var target = UI.context.flavor(SDK.ExecutionContext).target();
return TestRunner.isDedicatedWorker(target); return target.type() === SDK.Target.Type.Worker;
} }
function step1(target) { function step1(target) {
......
Tests the way service worker manager manages targets. Tests the way service worker manager manages targets.
Target added: Main; type: page Target added: Main; type: frame
Target added: service-worker-empty.js; type: service-worker Target added: service-worker-empty.js; type: service-worker
Target added: service-worker-empty.js; type: worker Target added: service-worker-empty.js; type: worker
Target removed: service-worker-empty.js; type: worker Target removed: service-worker-empty.js; type: worker
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
SDK.targetManager.observeTargets({ SDK.targetManager.observeTargets({
targetAdded: function(target) { targetAdded: function(target) {
TestRunner.addResult('Target added: ' + target.name() + '; type: ' + TestRunner.describeTargetType(target)); TestRunner.addResult('Target added: ' + target.name() + '; type: ' + target.type());
if (TestRunner.isDedicatedWorker(target)) { if (target.type() === SDK.Target.Type.Worker) {
var serviceWorkerManager = SDK.targetManager.mainTarget().model(SDK.ServiceWorkerManager); var serviceWorkerManager = SDK.targetManager.mainTarget().model(SDK.ServiceWorkerManager);
// Allow agents to do rountrips. // Allow agents to do rountrips.
TestRunner.deprecatedRunAfterPendingDispatches(function() { TestRunner.deprecatedRunAfterPendingDispatches(function() {
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
}, },
targetRemoved: function(target) { targetRemoved: function(target) {
TestRunner.addResult('Target removed: ' + target.name() + '; type: ' + TestRunner.describeTargetType(target)); TestRunner.addResult('Target removed: ' + target.name() + '; type: ' + target.type());
if (TestRunner.isServiceWorker(target)) if (target.type() === SDK.Target.Type.ServiceWorker)
setTimeout(TestRunner.completeTest); setTimeout(TestRunner.completeTest);
} }
}); });
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
return new Promise(function(resolve) { return new Promise(function(resolve) {
var sniffer = { var sniffer = {
targetAdded: function(target) { targetAdded: function(target) {
if (TestRunner.isServiceWorker(target)) { if (target.type() === SDK.Target.Type.ServiceWorker) {
resolve(); resolve();
SDK.targetManager.unobserveTargets(sniffer); SDK.targetManager.unobserveTargets(sniffer);
} }
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
await TestRunner.showPanel('sources'); await TestRunner.showPanel('sources');
var mockTargetId = 1; var mockTargetId = 1;
function createMockTarget(name, capabilities, type, dontAttachToMain) { function createMockTarget(name, type, dontAttachToMain) {
return SDK.targetManager.createTarget( return SDK.targetManager.createTarget(
'mock-target-' + mockTargetId++, name, capabilities, type, params => new SDK.StubConnection(params), 'mock-target-' + mockTargetId++, name, type, params => new SDK.StubConnection(params),
dontAttachToMain ? null : TestRunner.mainTarget); dontAttachToMain ? null : TestRunner.mainTarget);
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
TestRunner.addResult(''); TestRunner.addResult('');
TestRunner.addResult('Adding page target'); TestRunner.addResult('Adding page target');
var pageTarget = createMockTarget('page-target', SDK.Target.Capability.AllForTests, SDK.Target.Type.Frame, true /* dontAttachToMain */); var pageTarget = createMockTarget('page-target', SDK.Target.Type.Frame, true /* dontAttachToMain */);
var pageRuntimeModel = pageTarget.model(SDK.RuntimeModel); var pageRuntimeModel = pageTarget.model(SDK.RuntimeModel);
pageTarget.model(SDK.ResourceTreeModel)._frameAttached('42', ''); pageTarget.model(SDK.ResourceTreeModel)._frameAttached('42', '');
pageTarget.model(SDK.ResourceTreeModel)._frameNavigated({ pageTarget.model(SDK.ResourceTreeModel)._frameNavigated({
...@@ -56,8 +56,7 @@ ...@@ -56,8 +56,7 @@
TestRunner.addResult(''); TestRunner.addResult('');
TestRunner.addResult('Adding sw target'); TestRunner.addResult('Adding sw target');
var swTarget = createMockTarget( var swTarget = createMockTarget('sw-target', SDK.Target.Type.Worker);
'sw-target', SDK.Target.Capability.Network | SDK.Target.Capability.Worker | SDK.Target.Capability.JS, SDK.Target.Type.Worker);
swTarget.model(SDK.RuntimeModel) swTarget.model(SDK.RuntimeModel)
._executionContextCreated( ._executionContextCreated(
{id: 'sw1', auxData: {isDefault: true, frameId: ''}, origin: 'origin', name: 'swContext1Name'}); {id: 'sw1', auxData: {isDefault: true, frameId: ''}, origin: 'origin', name: 'swContext1Name'});
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
Bindings.resourceMapping._resetForTest(TestRunner.mainTarget); Bindings.resourceMapping._resetForTest(TestRunner.mainTarget);
var pageMock = new SDKTestRunner.PageMock('http://example.com'); var pageMock = new SDKTestRunner.PageMock('http://example.com');
pageMock.disableDOMCapability(); pageMock.turnIntoWorker();
SDKTestRunner.connectToPage('mock-target-1', pageMock); SDKTestRunner.connectToPage('mock-target-1', pageMock);
var uiSourceCodes = []; var uiSourceCodes = [];
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
Bindings.resourceMapping._resetForTest(TestRunner.mainTarget); Bindings.resourceMapping._resetForTest(TestRunner.mainTarget);
var pageMock = new SDKTestRunner.PageMock('mock-url.com/frame.html'); var pageMock = new SDKTestRunner.PageMock('mock-url.com/frame.html');
pageMock.disableDOMCapability(); pageMock.turnIntoWorker();
var target2 = SDKTestRunner.connectToPage('mock-target-100', pageMock); var target2 = SDKTestRunner.connectToPage('mock-target-100', pageMock);
var subframe = TestRunner.mainFrame().childFrames[0]; var subframe = TestRunner.mainFrame().childFrames[0];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
var workerCount = 0; var workerCount = 0;
var observer = { var observer = {
targetAdded(target) { targetAdded(target) {
if (!TestRunner.isDedicatedWorker(target)) if (target.type() !== SDK.Target.Type.Worker)
return; return;
workerCount++; workerCount++;
TestRunner.addResult('Added worker: ' + workerCount); TestRunner.addResult('Added worker: ' + workerCount);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
var workerAddedPromise = new Promise(f => workerAddedCallback = f); var workerAddedPromise = new Promise(f => workerAddedCallback = f);
var observer = { var observer = {
targetAdded(target) { targetAdded(target) {
if (!TestRunner.isDedicatedWorker(target)) if (target.type() !== SDK.Target.Type.Worker)
return; return;
TestRunner.addResult('Worker added'); TestRunner.addResult('Worker added');
workerTargetId = target.id(); workerTargetId = target.id();
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
workerAddedCallback(); workerAddedCallback();
}, },
targetRemoved(target) { targetRemoved(target) {
if (!TestRunner.isDedicatedWorker(target)) if (target.type() !== SDK.Target.Type.Worker)
return; return;
if (target.id() === workerTargetId) { if (target.id() === workerTargetId) {
TestRunner.addResult('Worker removed'); TestRunner.addResult('Worker removed');
......
...@@ -25,7 +25,8 @@ ApplicationTestRunner.postToServiceWorker = function(scope, message) { ...@@ -25,7 +25,8 @@ ApplicationTestRunner.postToServiceWorker = function(scope, message) {
ApplicationTestRunner.waitForServiceWorker = function(callback) { ApplicationTestRunner.waitForServiceWorker = function(callback) {
function isRightTarget(target) { function isRightTarget(target) {
return TestRunner.isDedicatedWorker(target) && TestRunner.isServiceWorker(target.parentTarget()); return target.type() === SDK.Target.Type.Worker && target.parentTarget() &&
target.parentTarget().type() === SDK.Target.Type.ServiceWorker;
} }
SDK.targetManager.observeTargets({ SDK.targetManager.observeTargets({
......
...@@ -32,14 +32,8 @@ InspectorMain.InspectorMain = class extends Common.Object { ...@@ -32,14 +32,8 @@ InspectorMain.InspectorMain = class extends Common.Object {
_connectAndCreateMainTarget() { _connectAndCreateMainTarget() {
const type = Runtime.queryParam('v8only') ? SDK.Target.Type.Node : SDK.Target.Type.Frame; const type = Runtime.queryParam('v8only') ? SDK.Target.Type.Node : SDK.Target.Type.Frame;
const capabilities = Runtime.queryParam('v8only') ? SDK.Target.Capability.JS :
SDK.Target.Capability.Browser | SDK.Target.Capability.DOM |
SDK.Target.Capability.DeviceEmulation | SDK.Target.Capability.Emulation | SDK.Target.Capability.Input |
SDK.Target.Capability.JS | SDK.Target.Capability.Log | SDK.Target.Capability.Network |
SDK.Target.Capability.ScreenCapture | SDK.Target.Capability.Security | SDK.Target.Capability.Target |
SDK.Target.Capability.Tracing | SDK.Target.Capability.Inspector;
const target = SDK.targetManager.createTarget( const target = SDK.targetManager.createTarget(
'main', Common.UIString('Main'), capabilities, type, this._createMainConnection.bind(this), null); 'main', Common.UIString('Main'), type, this._createMainConnection.bind(this), null);
target.runtimeAgent().runIfWaitingForDebugger(); target.runtimeAgent().runIfWaitingForDebugger();
} }
......
...@@ -12,8 +12,7 @@ JsMain.JsMain = class extends Common.Object { ...@@ -12,8 +12,7 @@ JsMain.JsMain = class extends Common.Object {
run() { run() {
Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSDirectly); Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSDirectly);
const target = SDK.targetManager.createTarget( const target = SDK.targetManager.createTarget(
'main', Common.UIString('Main'), SDK.Target.Capability.JS, SDK.Target.Type.Node, 'main', Common.UIString('Main'), SDK.Target.Type.Node, this._createMainConnection.bind(this), null);
this._createMainConnection.bind(this), null);
target.runtimeAgent().runIfWaitingForDebugger(); target.runtimeAgent().runIfWaitingForDebugger();
InspectorFrontendHost.connectionReady(); InspectorFrontendHost.connectionReady();
} }
......
...@@ -12,8 +12,7 @@ NodeMain.NodeMain = class extends Common.Object { ...@@ -12,8 +12,7 @@ NodeMain.NodeMain = class extends Common.Object {
run() { run() {
Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSFromFrontend); Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSFromFrontend);
const target = SDK.targetManager.createTarget( const target = SDK.targetManager.createTarget(
'main', Common.UIString('Main'), SDK.Target.Capability.Target, SDK.Target.Type.Browser, 'main', Common.UIString('Main'), SDK.Target.Type.Browser, params => new SDK.MainConnection(params), null);
params => new SDK.MainConnection(params), null);
target.setInspectedURL('Node.js'); target.setInspectedURL('Node.js');
InspectorFrontendHost.connectionReady(); InspectorFrontendHost.connectionReady();
} }
...@@ -99,8 +98,8 @@ NodeMain.NodeChildTargetManager = class extends SDK.SDKModel { ...@@ -99,8 +98,8 @@ NodeMain.NodeChildTargetManager = class extends SDK.SDKModel {
*/ */
attachedToTarget(sessionId, targetInfo, waitingForDebugger) { attachedToTarget(sessionId, targetInfo, waitingForDebugger) {
const target = this._targetManager.createTarget( const target = this._targetManager.createTarget(
targetInfo.targetId, Common.UIString('Node.js: %s', targetInfo.url), SDK.Target.Capability.JS, targetInfo.targetId, Common.UIString('Node.js: %s', targetInfo.url), SDK.Target.Type.Node,
SDK.Target.Type.Node, this._createChildConnection.bind(this, this._targetAgent, sessionId), this._parentTarget); this._createChildConnection.bind(this, this._targetAgent, sessionId), this._parentTarget);
target.runtimeAgent().runIfWaitingForDebugger(); target.runtimeAgent().runIfWaitingForDebugger();
} }
......
...@@ -117,27 +117,17 @@ SDK.ChildTargetManager = class extends SDK.SDKModel { ...@@ -117,27 +117,17 @@ SDK.ChildTargetManager = class extends SDK.SDKModel {
} }
let type = SDK.Target.Type.Browser; let type = SDK.Target.Type.Browser;
let capabilities = 0; if (targetInfo.type === 'iframe')
if (targetInfo.type === 'iframe') {
type = SDK.Target.Type.Frame; type = SDK.Target.Type.Frame;
capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | SDK.Target.Capability.JS | else if (targetInfo.type === 'worker')
SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target |
SDK.Target.Capability.Tracing | SDK.Target.Capability.Emulation | SDK.Target.Capability.Input;
}
if (targetInfo.type === 'worker') {
type = SDK.Target.Type.Worker; type = SDK.Target.Type.Worker;
capabilities = SDK.Target.Capability.JS | SDK.Target.Capability.Log | SDK.Target.Capability.Network | else if (targetInfo.type === 'service_worker')
SDK.Target.Capability.Target;
}
if (targetInfo.type === 'service_worker') {
type = SDK.Target.Type.ServiceWorker; type = SDK.Target.Type.ServiceWorker;
capabilities = SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target;
}
const target = this._targetManager.createTarget( const target = this._targetManager.createTarget(
targetInfo.targetId, targetName, capabilities, type, targetInfo.targetId, targetName, type, this._createChildConnection.bind(this, this._targetAgent, sessionId),
this._createChildConnection.bind(this, this._targetAgent, sessionId), this._parentTarget); this._parentTarget);
if (SDK.ChildTargetManager._attachCallback) { if (SDK.ChildTargetManager._attachCallback) {
SDK.ChildTargetManager._attachCallback({target, waitingForDebugger}).then(() => { SDK.ChildTargetManager._attachCallback({target, waitingForDebugger}).then(() => {
......
...@@ -12,20 +12,45 @@ SDK.Target = class extends Protocol.TargetBase { ...@@ -12,20 +12,45 @@ SDK.Target = class extends Protocol.TargetBase {
* @param {!SDK.TargetManager} targetManager * @param {!SDK.TargetManager} targetManager
* @param {string} id * @param {string} id
* @param {string} name * @param {string} name
* @param {number} capabilitiesMask
* @param {!SDK.Target.Type} type * @param {!SDK.Target.Type} type
* @param {!Protocol.InspectorBackend.Connection.Factory} connectionFactory * @param {!Protocol.InspectorBackend.Connection.Factory} connectionFactory
* @param {?SDK.Target} parentTarget * @param {?SDK.Target} parentTarget
* @param {boolean} suspended * @param {boolean} suspended
*/ */
constructor(targetManager, id, name, capabilitiesMask, type, connectionFactory, parentTarget, suspended) { constructor(targetManager, id, name, type, connectionFactory, parentTarget, suspended) {
const needsNodeJSPatching = type === SDK.Target.Type.Node; const needsNodeJSPatching = type === SDK.Target.Type.Node;
super(connectionFactory, needsNodeJSPatching); super(connectionFactory, needsNodeJSPatching);
this._targetManager = targetManager; this._targetManager = targetManager;
this._name = name; this._name = name;
this._inspectedURL = ''; this._inspectedURL = '';
// TODO(dgozman): specify capabilities per type here, instead of passing them. this._capabilitiesMask = 0;
this._capabilitiesMask = capabilitiesMask; switch (type) {
case SDK.Target.Type.Frame:
this._capabilitiesMask = SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | SDK.Target.Capability.JS |
SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target |
SDK.Target.Capability.Tracing | SDK.Target.Capability.Emulation | SDK.Target.Capability.Input;
if (!parentTarget) {
this._capabilitiesMask |= SDK.Target.Capability.DeviceEmulation | SDK.Target.Capability.ScreenCapture |
SDK.Target.Capability.Security | SDK.Target.Capability.Inspector;
}
break;
case SDK.Target.Type.ServiceWorker:
this._capabilitiesMask =
SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target;
if (!parentTarget)
this._capabilitiesMask |= SDK.Target.Capability.Browser | SDK.Target.Capability.Inspector;
break;
case SDK.Target.Type.Worker:
this._capabilitiesMask = SDK.Target.Capability.JS | SDK.Target.Capability.Log | SDK.Target.Capability.Network |
SDK.Target.Capability.Target;
break;
case SDK.Target.Type.Node:
this._capabilitiesMask = SDK.Target.Capability.JS;
break;
case SDK.Target.Type.Browser:
this._capabilitiesMask = SDK.Target.Capability.Target;
break;
}
this._type = type; this._type = type;
this._parentTarget = parentTarget; this._parentTarget = parentTarget;
this._id = id; this._id = id;
...@@ -220,8 +245,6 @@ SDK.Target.Capability = { ...@@ -220,8 +245,6 @@ SDK.Target.Capability = {
DeviceEmulation: 1 << 12, DeviceEmulation: 1 << 12,
None: 0, None: 0,
AllForTests: (1 << 13) - 1
}; };
/** /**
......
...@@ -171,15 +171,13 @@ SDK.TargetManager = class extends Common.Object { ...@@ -171,15 +171,13 @@ SDK.TargetManager = class extends Common.Object {
/** /**
* @param {string} id * @param {string} id
* @param {string} name * @param {string} name
* @param {number} capabilitiesMask
* @param {!SDK.Target.Type} type * @param {!SDK.Target.Type} type
* @param {!Protocol.InspectorBackend.Connection.Factory} connectionFactory * @param {!Protocol.InspectorBackend.Connection.Factory} connectionFactory
* @param {?SDK.Target} parentTarget * @param {?SDK.Target} parentTarget
* @return {!SDK.Target} * @return {!SDK.Target}
*/ */
createTarget(id, name, capabilitiesMask, type, connectionFactory, parentTarget) { createTarget(id, name, type, connectionFactory, parentTarget) {
const target = const target = new SDK.Target(this, id, name, type, connectionFactory, parentTarget, this._isSuspended);
new SDK.Target(this, id, name, capabilitiesMask, type, connectionFactory, parentTarget, this._isSuspended);
target.createModels(new Set(this._modelObservers.keysArray())); target.createModels(new Set(this._modelObservers.keysArray()));
this._targets.push(target); this._targets.push(target);
......
...@@ -15,8 +15,7 @@ function nextId(prefix) { ...@@ -15,8 +15,7 @@ function nextId(prefix) {
SDKTestRunner.connectToPage = function(targetName, pageMock, makeMainTarget) { SDKTestRunner.connectToPage = function(targetName, pageMock, makeMainTarget) {
const mockTarget = SDK.targetManager.createTarget( const mockTarget = SDK.targetManager.createTarget(
nextId('mock-target-'), targetName, pageMock.capabilities(), SDK.Target.Type.Frame, nextId('mock-target-'), targetName, pageMock._type, params => pageMock.createConnection(params));
params => pageMock.createConnection(params));
if (makeMainTarget) { if (makeMainTarget) {
SDK.targetManager._targets = SDK.targetManager._targets.filter(target => target !== mockTarget); SDK.targetManager._targets = SDK.targetManager._targets.filter(target => target !== mockTarget);
...@@ -29,7 +28,7 @@ SDKTestRunner.connectToPage = function(targetName, pageMock, makeMainTarget) { ...@@ -29,7 +28,7 @@ SDKTestRunner.connectToPage = function(targetName, pageMock, makeMainTarget) {
SDKTestRunner.PageMock = class { SDKTestRunner.PageMock = class {
constructor(url) { constructor(url) {
this._url = url; this._url = url;
this._capabilities = SDK.Target.Capability.DOM | SDK.Target.Capability.JS | SDK.Target.Capability.Browser; this._type = SDK.Target.Type.Frame;
this._enabledDomains = new Set(); this._enabledDomains = new Set();
this._mainFrame = this._mainFrame =
...@@ -50,12 +49,8 @@ SDKTestRunner.PageMock = class { ...@@ -50,12 +49,8 @@ SDKTestRunner.PageMock = class {
}; };
} }
capabilities() { turnIntoWorker() {
return this._capabilities; this._type = SDK.Target.Type.Worker;
}
disableDOMCapability() {
this._capabilities = this._capabilities & ~SDK.Target.Capability.DOM;
} }
createConnection(params) { createConnection(params) {
...@@ -186,7 +181,7 @@ SDKTestRunner.PageMock = class { ...@@ -186,7 +181,7 @@ SDKTestRunner.PageMock = class {
const domain = methodName.split('.')[0]; const domain = methodName.split('.')[0];
if (domain === 'Page') if (domain === 'Page')
return !!(this._capabilities & SDK.Target.Capability.DOM); return this._type === SDK.Target.Type.Frame;
return true; return true;
} }
......
...@@ -1220,40 +1220,6 @@ TestRunner.dumpLoadedModules = function(relativeTo) { ...@@ -1220,40 +1220,6 @@ TestRunner.dumpLoadedModules = function(relativeTo) {
return loadedModules; return loadedModules;
}; };
/**
* @param {!SDK.Target} target
* @return {boolean}
*/
TestRunner.isDedicatedWorker = function(target) {
return target && target.type() === SDK.Target.Type.Worker;
};
/**
* @param {!SDK.Target} target
* @return {boolean}
*/
TestRunner.isServiceWorker = function(target) {
return target && target.type() === SDK.Target.Type.ServiceWorker;
};
/**
* @param {!SDK.Target} target
* @return {string}
*/
TestRunner.describeTargetType = function(target) {
if (!target)
return 'browser';
if (target.type() === SDK.Target.Type.Worker)
return 'worker';
if (target.type() === SDK.Target.Type.ServiceWorker)
return 'service-worker';
if (target.type() === SDK.Target.Type.Frame)
return target.parentTarget() ? 'frame' : 'page';
if (target.type() === SDK.Target.Type.Node)
return 'node';
return 'browser';
};
/** /**
* @param {string} urlSuffix * @param {string} urlSuffix
* @param {!Workspace.projectTypes=} projectType * @param {!Workspace.projectTypes=} projectType
......
...@@ -10,11 +10,8 @@ WorkerMain.WorkerMain = class extends Common.Object { ...@@ -10,11 +10,8 @@ WorkerMain.WorkerMain = class extends Common.Object {
* @override * @override
*/ */
run() { run() {
const capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.Log | SDK.Target.Capability.Network |
SDK.Target.Capability.Target | SDK.Target.Capability.Inspector;
SDK.targetManager.createTarget( SDK.targetManager.createTarget(
'main', Common.UIString('Main'), capabilities, SDK.Target.Type.ServiceWorker, 'main', Common.UIString('Main'), SDK.Target.Type.ServiceWorker, this._createMainConnection.bind(this), null);
this._createMainConnection.bind(this), null);
InspectorFrontendHost.connectionReady(); InspectorFrontendHost.connectionReady();
new MobileThrottling.NetworkPanelIndicator(); new MobileThrottling.NetworkPanelIndicator();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment