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

Unified Diff: test/inspector/runtime/create-context.js

Issue 2737603006: [inspector] added createContextGroup for tests (Closed)
Patch Set: a 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
« no previous file with comments | « test/inspector/protocol-test.js ('k') | test/inspector/runtime/create-context-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/runtime/create-context.js
diff --git a/test/inspector/runtime/create-context.js b/test/inspector/runtime/create-context.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f86e6ec34401a15f11418210272cdfc287e7c51
--- /dev/null
+++ b/test/inspector/runtime/create-context.js
@@ -0,0 +1,42 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+InspectorTest.log('Checks createContext().');
+
+InspectorTest.setupScriptMap();
+Protocol.Runtime.onExecutionContextCreated(InspectorTest.logMessage);
+Protocol.Debugger.onPaused((message) => {
+ InspectorTest.logSourceLocation(message.params.callFrames[0].location);
+ Protocol.Debugger.stepOut();
+});
+var executionContextIds = new Set();
+Protocol.Debugger.onScriptParsed(message => executionContextIds.add(message.params.executionContextId));
+var contextGroupId;
+Protocol.Runtime.enable()
+ .then(() => contextGroupId = utils.createContextGroup())
+ .then(() => Protocol.Runtime.enable({}, contextGroupId))
+ .then(() => Protocol.Debugger.enable())
+ .then(() => Protocol.Debugger.enable({}, contextGroupId))
+ .then(InspectorTest.logMessage)
+ .then(() => {
+ Protocol.Runtime.evaluate({ expression: 'debugger;' })
+ Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' }, contextGroupId);
+ Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
+ })
+ .then(() => InspectorTest.waitPendingTasks())
+ .then(() => {
+ InspectorTest.log(`Reported script's execution id: ${executionContextIds.size}`);
+ executionContextIds.clear();
+ })
+ .then(() => utils.reconnect())
+ .then(() => {
+ Protocol.Runtime.evaluate({ expression: 'debugger;' })
+ Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' }, contextGroupId);
+ Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
+ })
+ .then(() => InspectorTest.waitPendingTasks())
+ .then(() => Protocol.Debugger.disable({}, contextGroupId))
+ .then(() => Protocol.Debugger.disable({}))
+ .then(() => InspectorTest.log(`Reported script's execution id: ${executionContextIds.size}`))
+ .then(InspectorTest.completeTest);
« no previous file with comments | « test/inspector/protocol-test.js ('k') | test/inspector/runtime/create-context-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698