OLD | NEW |
(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 print('Checks Debugger.moduleRequested notifications.'); |
| 6 |
| 7 var module1 = ` |
| 8 export let a1 = 1 |
| 9 function foo() { |
| 10 }`; |
| 11 |
| 12 var module2 = ` |
| 13 export let a2 = 2 |
| 14 function foo() { |
| 15 }`; |
| 16 |
| 17 var module3 = ` |
| 18 import { a1 } from 'module1'; |
| 19 import { a2 } from 'module2'; |
| 20 function foo() {} |
| 21 `; |
| 22 |
| 23 var module4 = ` |
| 24 import { a1 } from 'module1'; |
| 25 import { a2 } from 'module2'; |
| 26 `; |
| 27 |
| 28 InspectorTest.setupScriptMap(); |
| 29 Protocol.Debugger.onModuleRequested(message => { |
| 30 var refererModule = InspectorTest._scriptMap.get(message.params.refererId); |
| 31 var requestedModule = InspectorTest._scriptMap.get(message.params.requestedId)
; |
| 32 InspectorTest.log(`${refererModule.url} requested ${requestedModule.url} with
import .. '${message.params.specifier}'`); |
| 33 }); |
| 34 |
| 35 InspectorTest.addModule(module1, "module1"); |
| 36 InspectorTest.addModule(module2, "module2"); |
| 37 InspectorTest.addModule(module3, "module3"); |
| 38 |
| 39 InspectorTest.runTestSuite([ |
| 40 function reportExistingResolvedModulesOnDebuggerEnable(next) { |
| 41 Protocol.Debugger.enable().then(next); |
| 42 }, |
| 43 |
| 44 function moduleResolvedWhenDebuggerIsEnabled(next) { |
| 45 InspectorTest.addModule(module4, "module4"); |
| 46 InspectorTest.waitPendingTasks().then(next); |
| 47 } |
| 48 ]); |
OLD | NEW |