browser_webconsole_view_source.js (1164B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 // Tests that source URLs in the Web Console can be clicked to display the 5 // standard View Source window. As JS exceptions and console.log() messages always 6 // have their locations opened in Debugger, we need to test a security message in 7 // order to have it opened in the standard View Source window. 8 9 "use strict"; 10 11 const TEST_URI = 12 "https://example.com/browser/devtools/client/webconsole/" + 13 "test/browser/" + 14 "test-mixedcontent-securityerrors.html"; 15 16 add_task(async function () { 17 const hud = await openNewTabAndConsole(TEST_URI); 18 info("console opened"); 19 20 const msg = await waitFor(() => 21 findErrorMessage(hud, "Blocked loading mixed active content") 22 ); 23 ok(msg, "error message"); 24 const locationNode = msg.querySelector( 25 ".message-location .frame-link-filename" 26 ); 27 ok(locationNode, "location node"); 28 29 const onTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, null, true); 30 31 locationNode.click(); 32 await onTabOpen; 33 ok( 34 true, 35 "the view source tab was opened in response to clicking the location node" 36 ); 37 });