browser_viewsource_chrome_to_content.js (742B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 "use strict"; 4 5 const TEST_PATH = getRootDirectory(gTestPath).replace( 6 "chrome://mochitests/content", 7 "https://example.com" 8 ); 9 const TEST_URI = `view-source:${TEST_PATH}dummy_page.html`; 10 11 add_task(async function chrome_to_content_view_source() { 12 await BrowserTestUtils.withNewTab("about:mozilla", async browser => { 13 is(browser.documentURI.spec, "about:mozilla"); 14 15 // This process switch would previously crash in debug builds due to assertion failures. 16 BrowserTestUtils.startLoadingURIString(browser, TEST_URI); 17 await BrowserTestUtils.browserLoaded(browser); 18 is(browser.documentURI.spec, TEST_URI); 19 }); 20 });