summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/about/browser_bug633691.js
blob: 33d58475f6658fc4f9ef8ff9a216b23175b579ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

add_task(async function test() {
  const URL = "data:text/html,<iframe width='700' height='700'></iframe>";
  await BrowserTestUtils.withNewTab(
    { gBrowser, url: URL },
    async function (browser) {
      let context = await SpecialPowers.spawn(browser, [], function () {
        let iframe = content.document.querySelector("iframe");
        iframe.src = "https://expired.example.com/";
        return BrowsingContext.getFromWindow(iframe.contentWindow);
      });
      await TestUtils.waitForCondition(() => {
        let frame = context.currentWindowGlobal;
        return frame && frame.documentURI.spec.startsWith("about:certerror");
      });
      await SpecialPowers.spawn(context, [], async function () {
        await ContentTaskUtils.waitForCondition(
          () => content.document.readyState == "interactive"
        );
        let aP = content.document.getElementById("badCertAdvancedPanel");
        Assert.ok(aP, "Advanced content should exist");
        Assert.ok(
          ContentTaskUtils.is_hidden(aP),
          "Advanced content should not be visible by default"
        );
      });
    }
  );
});