browser_dbg-reloading.js (1198B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 /* 6 * Test reloading: 7 * 1. reload the source 8 * 2. re-sync breakpoints 9 */ 10 11 "use strict"; 12 13 add_task(async function () { 14 const dbg = await initDebugger( 15 "ember/quickstart/dist/", 16 "ember-application/index.js" 17 ); 18 19 await selectSource(dbg, "ember-application/index.js"); 20 21 info("1. reload and hit breakpoint"); 22 await addBreakpoint(dbg, "ember-application/index.js", 4); 23 reload(dbg, "ember/quickstart/dist/"); 24 25 info("2. Wait for sources to appear and then reload"); 26 await waitForDispatch(dbg.store, "ADD_SOURCES"); 27 reload(dbg, "ember/quickstart/dist/"); 28 29 info("3. Wait for sources to appear and then reload mid source-maps"); 30 await waitForDispatch(dbg.store, "ADD_SOURCES"); 31 reload(dbg, "ember/quickstart/dist/"); 32 33 info( 34 "4. wait for the debugger to pause and show that we're in the correct location" 35 ); 36 await waitForPaused(dbg); 37 const source = findSource(dbg, "ember-application/index.js"); 38 await assertPausedAtSourceAndLine(dbg, source.id, 4); 39 });