/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * Test Bug 1562881 - Ensuring the identity icon loads correct img in different * circumstances. */ const kBaseURI = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "https://example.com" ); const kBaseURILocalhost = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "http://127.0.0.1" ); const TEST_CASES = [ { type: "http", testURL: "http://example.com", img_url: `url("chrome://global/skin/icons/security-broken.svg")`, }, { type: "https", testURL: "https://example.com", img_url: `url("chrome://global/skin/icons/security.svg")`, }, { type: "non-chrome about page", testURL: "about:about", img_url: `url("chrome://global/skin/icons/page-portrait.svg")`, }, { type: "chrome about page", testURL: "about:preferences", img_url: `url("chrome://branding/content/icon${ window.devicePixelRatio > 1 ? 32 : 16 }.png")`, }, { type: "file", testURL: "dummy_page.html", img_url: `url("chrome://global/skin/icons/page-portrait.svg")`, }, { type: "resource", testURL: "resource://gre/modules/Log.sys.mjs", img_url: `url("chrome://global/skin/icons/page-portrait.svg")`, }, { type: "mixedPassiveContent", testURL: kBaseURI + "file_mixedPassiveContent.html", img_url: `url("chrome://global/skin/icons/security-warning.svg")`, }, { type: "mixedActiveContent", testURL: kBaseURI + "file_csp_block_all_mixedcontent.html", img_url: `url("chrome://global/skin/icons/security.svg")`, }, { type: "certificateError", testURL: "https://self-signed.example.com", img_url: `url("chrome://global/skin/icons/security-warning.svg")`, }, { type: "localhost", testURL: "http://127.0.0.1", img_url: `url("chrome://global/skin/icons/page-portrait.svg")`, }, { type: "localhost + http frame", testURL: kBaseURILocalhost + "file_csp_block_all_mixedcontent.html", img_url: `url("chrome://global/skin/icons/page-portrait.svg")`, }, { type: "data URI", testURL: "data:text/html,