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); |
+ } |
+]); |