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

Side by Side Diff: test/inspector/runtime/create-context.js

Issue 2737603006: [inspector] added createContextGroup for tests (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 InspectorTest.log('Checks createContext().');
6
7 InspectorTest.setupScriptMap();
8 Protocol.Runtime.onExecutionContextCreated(InspectorTest.logMessage);
9 Protocol.Debugger.onPaused((message) => {
10 InspectorTest.logSourceLocation(message.params.callFrames[0].location);
11 Protocol.Debugger.stepOut();
12 });
13 var executionContextIds = new Set();
14 Protocol.Debugger.onScriptParsed(message => executionContextIds.add(message.para ms.executionContextId));
15 var contextGroupId;
16 Protocol.Runtime.enable()
17 .then(() => contextGroupId = utils.createContextGroup())
18 .then(() => Protocol.Runtime.enable({}, contextGroupId))
19 .then(() => Protocol.Debugger.enable())
20 .then(() => Protocol.Debugger.enable({}, contextGroupId))
21 .then(InspectorTest.logMessage)
22 .then(() => {
23 Protocol.Runtime.evaluate({ expression: 'debugger;' })
24 Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' }, conte xtGroupId);
25 Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
26 })
27 .then(() => InspectorTest.waitPendingTasks())
28 .then(() => {
29 InspectorTest.log(`Reported script's execution id: ${executionContextIds.siz e}`);
30 executionContextIds.clear();
31 })
32 .then(() => utils.reconnect())
33 .then(() => {
34 Protocol.Runtime.evaluate({ expression: 'debugger;' })
35 Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' }, conte xtGroupId);
36 Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
37 })
38 .then(() => InspectorTest.waitPendingTasks())
39 .then(() => Protocol.Debugger.disable({}, contextGroupId))
40 .then(() => Protocol.Debugger.disable({}))
41 .then(() => InspectorTest.log(`Reported script's execution id: ${executionCont extIds.size}`))
42 .then(InspectorTest.completeTest);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698