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

Unified Diff: test/inspector/debugger/es6-module-requested.js

Issue 2668613002: [inspector] added Debugger.moduleRequested notification
Patch Set: added missing test Created 3 years, 11 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 | « src/objects-printer.cc ('k') | test/inspector/debugger/es6-module-requested-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/debugger/es6-module-requested.js
diff --git a/test/inspector/debugger/es6-module-requested.js b/test/inspector/debugger/es6-module-requested.js
new file mode 100644
index 0000000000000000000000000000000000000000..b38c1c5a8ce3cb3b27da4f23a8616d1cc495054a
--- /dev/null
+++ b/test/inspector/debugger/es6-module-requested.js
@@ -0,0 +1,48 @@
+// 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.
+
+print('Checks Debugger.moduleRequested notifications.');
+
+var module1 = `
+export let a1 = 1
+function foo() {
+}`;
+
+var module2 = `
+export let a2 = 2
+function foo() {
+}`;
+
+var module3 = `
+import { a1 } from 'module1';
+import { a2 } from 'module2';
+function foo() {}
+`;
+
+var module4 = `
+import { a1 } from 'module1';
+import { a2 } from 'module2';
+`;
+
+InspectorTest.setupScriptMap();
+Protocol.Debugger.onModuleRequested(message => {
+ var refererModule = InspectorTest._scriptMap.get(message.params.refererId);
+ var requestedModule = InspectorTest._scriptMap.get(message.params.requestedId);
+ InspectorTest.log(`${refererModule.url} requested ${requestedModule.url} with import .. '${message.params.specifier}'`);
+});
+
+InspectorTest.addModule(module1, "module1");
+InspectorTest.addModule(module2, "module2");
+InspectorTest.addModule(module3, "module3");
+
+InspectorTest.runTestSuite([
+ function reportExistingResolvedModulesOnDebuggerEnable(next) {
+ Protocol.Debugger.enable().then(next);
+ },
+
+ function moduleResolvedWhenDebuggerIsEnabled(next) {
+ InspectorTest.addModule(module4, "module4");
+ InspectorTest.waitPendingTasks().then(next);
+ }
+]);
« no previous file with comments | « src/objects-printer.cc ('k') | test/inspector/debugger/es6-module-requested-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698