browser_devtools-record-discard.js (1040B)
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 "use strict"; 6 7 add_task(async function test() { 8 info("Test that DevTools can discard profiles."); 9 10 await setProfilerFrontendUrl( 11 "https://example.com", 12 "/browser/devtools/client/performance-new/test/browser/fake-frontend.html" 13 ); 14 15 await withDevToolsPanel(async document => { 16 { 17 const button = await getActiveButtonFromText(document, "Start recording"); 18 info("Click the button to start recording"); 19 button.click(); 20 } 21 22 { 23 const button = await getActiveButtonFromText( 24 document, 25 "Cancel recording" 26 ); 27 info("Click the button to discard to profile."); 28 button.click(); 29 } 30 31 { 32 const button = await getActiveButtonFromText(document, "Start recording"); 33 ok(Boolean(button), "The start recording button is available again."); 34 } 35 }); 36 });