summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/mochitest/test_blocklist_gfx_initialized.html
blob: ab0ad34173d1e8574da1713f1bb28aa77d7fe0cd (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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test gfx blocklist is initialized</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

add_task(async function check_GfxBlocklistRS_initialized() {
    // We have extensive xpcshell tests to ensure the blocklist works
    // correctly. Here we just want to ensure the blocklist is indeed
    // initialized in a regular browser setup.
    // In fact, calling GfxBlocklistRS.checkForEntries() in order to test
    // specific functionality would lazily initialize the blocklist, negating
    // the value of this test.
    let initialized = await SpecialPowers.spawnChrome([], async () => {
        const { BlocklistPrivate } = ChromeUtils.import(
            "resource://gre/modules/Blocklist.jsm"
        );

        return BlocklistPrivate.GfxBlocklistRS._initialized;
    });

    ok(initialized, "Gfx Blocklist was initialized")
});
  </script>
</head>
<body>
</body>
</html>