browser_inspector_picker-stop-on-tool-change.js (916B)
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 "use strict"; 5 6 // Test that the highlighter's picker is stopped when a different tool is 7 // selected 8 9 const TEST_URI = 10 "data:text/html;charset=UTF-8," + 11 "testing the highlighter goes away on tool selection"; 12 13 add_task(async function () { 14 const { toolbox } = await openInspectorForURL(TEST_URI); 15 const pickerStopped = toolbox.nodePicker.once("picker-stopped"); 16 17 info("Starting the inspector picker"); 18 await startPicker(toolbox); 19 20 info("Selecting another tool than the inspector in the toolbox"); 21 await toolbox.selectNextTool(); 22 23 info("Waiting for the picker-stopped event to be fired"); 24 await pickerStopped; 25 26 ok(true, "picker-stopped event fired after switch tools; picker is closed"); 27 });