Bug 1549858 - move blocklist json into tests, r=kmag
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 08 May 2019 19:04:51 +0000
changeset 531974 6cfaeaa212f82db5129ef7c72f5e4a5e990a1e1f
parent 531973 c8ada1038c844c5c218b592ea26a09d8f0d4cb83
child 531975 59314da6bb6b37f3242e8a3b68dcb3849728818c
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1549858
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549858 - move blocklist json into tests, r=kmag Differential Revision: https://phabricator.services.mozilla.com/D30394
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/addon_change-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/app_update-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/blocklist_update1-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/blocklist_update2-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/manual_update-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_block-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_block-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_empty-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_empty-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_start-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_start-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_warn-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/bug455906_warn-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/pluginInfoURL_block-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/pluginInfoURL_block-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_blocklist_metadata_filters_1-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/test_blocklist_prefs_1-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug393285-extensions.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_1-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_2-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_empty.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_outdated_1-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_outdated_2-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlacklist2.json
toolkit/mozapps/extensions/test/xpcshell/data/test_pluginBlocklistCtp-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_pluginBlocklistCtpUndo-plugins.json
toolkit/mozapps/extensions/test/xpcshell/data/test_softblocked1-extensions.json
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_metadata_filters.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_osabi.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_flashonly.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_outdated.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_severities.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_severities.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginBlocklistCtp.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginInfoURL.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -704,50 +704,68 @@ var AddonTestUtils = {
    */
   overrideBlocklist(addons) {
     let mock = new MockBlocklist(addons);
     mock.register();
     return mock;
   },
 
   /**
-   * Load the following data into the *real* blocklist providers.
-   * While `overrideBlocklist` replaces the blocklist entirely with a mock
-   * that returns dummy data, this method instead loads data into the actual
-   * blocklist, fires update methods as would happen if this data came from
-   * an actual blocklist update, etc.
+   * Load the data from the specified files into the *real* blocklist providers.
+   * Loads using loadBlocklistRawData, which will treat this as an update.
    *
    * @param {nsIFile} dir
    *        The directory in which the files live.
    * @param {string} prefix
    *        a prefix for the files which ought to be loaded.
    *        This method will suffix -extensions.json and -plugins.json
    *        to the prefix it is given, and attempt to load both.
    *        Insofar as either exists, their data will be dumped into
    *        the respective store, and the respective update handlers
    *        will be called.
    */
   async loadBlocklistData(dir, prefix) {
+    let loadedData = {};
+    for (let fileSuffix of ["extensions", "plugins"]) {
+      const fileName = `${prefix}-${fileSuffix}.json`;
+      let jsonStr = await OS.File.read(OS.Path.join(dir.path, fileName), {encoding: "UTF-8"}).catch(() => {});
+      if (!jsonStr) {
+         continue;
+      }
+      this.info(`Loaded ${fileName}`);
+
+      loadedData[fileSuffix] = JSON.parse(jsonStr);
+    }
+    return this.loadBlocklistRawData(loadedData);
+  },
+
+  /**
+   * Load the following data into the *real* blocklist providers.
+   * While `overrideBlocklist` replaces the blocklist entirely with a mock
+   * that returns dummy data, this method instead loads data into the actual
+   * blocklist, fires update methods as would happen if this data came from
+   * an actual blocklist update, etc.
+   *
+   * @param {object} data
+   *        The data to load.
+   */
+  async loadBlocklistRawData(data) {
     const bsPass = ChromeUtils.import("resource://gre/modules/Blocklist.jsm", null);
     const blocklistMapping = {
       "extensions": bsPass.ExtensionBlocklistRS,
       "plugins": bsPass.PluginBlocklistRS,
     };
 
-    for (const [fileSuffix, blocklistObj] of Object.entries(blocklistMapping)) {
-      const fileName = `${prefix}-${fileSuffix}.json`;
-      let jsonStr = await OS.File.read(OS.Path.join(dir.path, fileName), {encoding: "UTF-8"}).catch(() => {});
-      if (!jsonStr) {
+    for (const [dataProp, blocklistObj] of Object.entries(blocklistMapping)) {
+      let newData = data[dataProp];
+      if (!newData) {
         continue;
       }
-      this.info(`Loading ${fileName}`);
-
-      let newData = JSON.parse(jsonStr);
       if (!Array.isArray(newData)) {
-        throw new Error("Expected an array of new items to put in the " + fileSuffix + " blocklist!");
+        throw new Error("Expected an array of new items to put in the " + dataProp + " blocklist!");
       }
       for (let item of newData) {
         if (!item.id) {
           item.id = uuidGen.generateUUID().number.slice(1, -1);
         }
         if (!item.last_modified) {
           item.last_modified = Date.now();
         }
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/addon_change-extensions.json
+++ /dev/null
@@ -1,82 +0,0 @@
-[
-  {
-    "guid": "softblock1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock3@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "hardblock@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2"
-      }
-    ]
-  },
-  {
-    "_comment": "Two RegExp matches, so test flags work - first shouldn't match.",
-    "guid": "/^RegExp/",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "/^RegExp/i",
-    "versionRange": [
-      {
-        "maxVersion": "3",
-        "minVersion": "2",
-        "severity": "2"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/app_update-extensions.json
+++ /dev/null
@@ -1,120 +0,0 @@
-[
-  {
-    "guid": "softblock1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "softblock2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "softblock3@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "softblock4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "softblock5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "hardblock@tests.mozilla.org",
-    "versionRange": [
-      {
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "/^RegExp/",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "/^RegExp/i",
-    "versionRange": [
-      {
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "2"
-          }
-        ]
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/blocklist_update1-extensions.json
+++ /dev/null
@@ -1,1 +0,0 @@
-[ ]
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/blocklist_update2-extensions.json
+++ /dev/null
@@ -1,58 +0,0 @@
-[
-  {
-    "guid": "softblock1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock3@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "hardblock@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "/^RegExp/",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "/^RegExp/i",
-    "versionRange": []
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/blocklistchange/manual_update-extensions.json
+++ /dev/null
@@ -1,70 +0,0 @@
-[
-  {
-    "guid": "softblock1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock3@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "softblock5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "hardblock@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1"
-      }
-    ]
-  },
-  {
-    "guid": "/^RegExp/i",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_block-extensions.json
+++ /dev/null
@@ -1,37 +0,0 @@
-[
-  {
-    "guid": "test_bug455906_1@tests.mozilla.org",
-    "blockID": "test_bug455906_1@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_2@tests.mozilla.org",
-    "blockID": "test_bug455906_2@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_3@tests.mozilla.org",
-    "blockID": "test_bug455906_3@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_4@tests.mozilla.org",
-    "blockID": "test_bug455906_4@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_5@tests.mozilla.org",
-    "blockID": "test_bug455906_5@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_6@tests.mozilla.org",
-    "blockID": "test_bug455906_6@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug455906_7@tests.mozilla.org",
-    "blockID": "test_bug455906_7@tests.mozilla.org",
-    "versionRange": []
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_block-plugins.json
+++ /dev/null
@@ -1,7 +0,0 @@
-[
-  {
-    "matchName": "^test_bug455906",
-    "versionRange": [],
-    "blockID": "test_bug455906_plugin"
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_empty-extensions.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
-  {
-    "guid": "dummy_bug455906_2@tests.mozilla.org",
-    "versionRange": []
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_empty-plugins.json
+++ /dev/null
@@ -1,1 +0,0 @@
-[ ]
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_start-extensions.json
+++ /dev/null
@@ -1,30 +0,0 @@
-[
-  {
-    "guid": "test_bug455906_4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_6@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "2"
-      }
-    ]
-  },
-  {
-    "guid": "dummy_bug455906_1@tests.mozilla.org",
-    "versionRange": []
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_start-plugins.json
+++ /dev/null
@@ -1,26 +0,0 @@
-[
-  {
-    "matchName": "^test_bug455906_4$",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_bug455906_5$",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_bug455906_6$",
-    "versionRange": [
-      {
-        "severity": "2"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_warn-extensions.json
+++ /dev/null
@@ -1,58 +0,0 @@
-[
-  {
-    "guid": "test_bug455906_1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_3@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_5@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_6@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug455906_7@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/bug455906_warn-plugins.json
+++ /dev/null
@@ -1,10 +0,0 @@
-[
-  {
-    "matchName": "^test_bug455906",
-    "versionRange": [
-      {
-        "severity": "-1"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/pluginInfoURL_block-extensions.json
+++ /dev/null
@@ -1,1 +0,0 @@
-[]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/pluginInfoURL_block-plugins.json
+++ /dev/null
@@ -1,69 +0,0 @@
-[
-  {
-    "matchName": "^test_with_infoURL",
-    "matchVersion": "^5",
-    "versionRange": [
-      {
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "blockID": "test_plugin_wInfoURL",
-    "infoURL": "http://test.url.com/"
-  },
-  {
-    "matchName": "^test_with_altInfoURL",
-    "matchVersion": "^5",
-    "versionRange": [
-      {
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "blockID": "test_plugin_wAltInfoURL",
-    "infoURL": "http://alt.test.url.com/"
-  },
-  {
-    "matchName": "^test_no_infoURL",
-    "versionRange": [
-      {
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "blockID": "test_plugin_noInfoURL"
-  },
-  {
-    "matchName": "^test_newVersion",
-    "versionRange": [
-      {
-        "maxVersion": "2",
-        "minVersion": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "blockID": "test_plugin_newVersion",
-    "infoURL": "http://test.url2.com/"
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_blocklist_metadata_filters_1-extensions.json
+++ /dev/null
@@ -1,36 +0,0 @@
-[
-  {
-    "guid": null,
-    "name": "/^Mozilla Corp\\.$/",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "/block2/",
-    "name": "/^Moz/",
-    "homepageURL": "/\\.dangerous\\.com/",
-    "updateURL": "/\\.dangerous\\.com/",
-    "versionRange": [
-      {
-        "severity": "3",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_blocklist_prefs_1-extensions.json
+++ /dev/null
@@ -1,40 +0,0 @@
-[
-  {
-    "guid": "block1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "prefs": [
-      "test.blocklist.pref1",
-      "test.blocklist.pref2"
-    ]
-  },
-  {
-    "guid": "block2@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "3",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "2.*",
-            "minVersion": "1"
-          }
-        ]
-      }
-    ],
-    "prefs": [
-      "test.blocklist.pref3",
-      "test.blocklist.pref4"
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug393285-extensions.json
+++ /dev/null
@@ -1,94 +0,0 @@
-[
-  {
-    "guid": "test_bug393285_2@tests.mozilla.org",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_3a@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "1.0",
-        "minVersion": "1.0"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug393285_3b@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "1.0",
-        "minVersion": "1.0"
-      }
-    ]
-  },
-  {
-    "guid": "test_bug393285_4@tests.mozilla.org",
-    "versionRange": [
-      {
-        "maxVersion": "1.0",
-        "minVersion": "1.0",
-        "targetApplication": [
-          {
-            "guid": "xpcshell@tests.mozilla.org",
-            "maxVersion": "1.0",
-            "minVersion": "1.0"
-          }
-        ]
-      }
-    ]
-  },
-  {
-    "guid": "test_bug393285_5@tests.mozilla.org",
-    "os": "Darwin",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_6@tests.mozilla.org",
-    "os": "XPCShell",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_7@tests.mozilla.org",
-    "os": "Darwin,XPCShell,WINNT",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_8@tests.mozilla.org",
-    "xpcomabi": "x86-msvc",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_9@tests.mozilla.org",
-    "xpcomabi": "noarch-spidermonkey",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_10@tests.mozilla.org",
-    "xpcomabi": "ppc-gcc3,noarch-spidermonkey,x86-msvc",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_11@tests.mozilla.org",
-    "os": "Darwin",
-    "xpcomabi": "ppc-gcc3,x86-msvc",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_12@tests.mozilla.org",
-    "os": "Darwin",
-    "xpcomabi": "ppc-gcc3,noarch-spidermonkey,x86-msvc",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_13@tests.mozilla.org",
-    "os": "XPCShell",
-    "xpcomabi": "ppc-gcc3,x86-msvc",
-    "versionRange": []
-  },
-  {
-    "guid": "test_bug393285_14@tests.mozilla.org",
-    "os": "XPCShell,WINNT",
-    "xpcomabi": "ppc-gcc3,x86-msvc,noarch-spidermonkey",
-    "versionRange": []
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_1-plugins.json
+++ /dev/null
@@ -1,22 +0,0 @@
-[
-  {
-    "matchName": "^test_bug514327_1",
-    "versionRange": []
-  },
-  {
-    "matchName": "^test_bug514327_2",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_bug514327_3",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_2-plugins.json
+++ /dev/null
@@ -1,10 +0,0 @@
-[
-  {
-    "matchName": "Test Plug-in",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_empty.json
+++ /dev/null
@@ -1,1 +0,0 @@
-[ ]
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_outdated_1-plugins.json
+++ /dev/null
@@ -1,14 +0,0 @@
-[
-  {
-    "matchName": "test_bug514327_1",
-    "versionRange": []
-  },
-  {
-    "matchName": "test_bug514327_outdated",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_3_outdated_2-plugins.json
+++ /dev/null
@@ -1,14 +0,0 @@
-[
-  {
-    "matchName": "test_bug514327_2",
-    "versionRange": []
-  },
-  {
-    "matchName": "test_bug514327_outdated",
-    "versionRange": [
-      {
-        "severity": "0"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlacklist2.json
+++ /dev/null
@@ -1,27 +0,0 @@
-[
-  {
-    "os": "WINNT 6.1",
-    "vendor": "0xabcd",
-    "devices": [
-      "0x2783",
-      "0x2782"
-    ],
-    "feature": " DIRECT2D ",
-    "featureStatus": " BLOCKED_DRIVER_VERSION ",
-    "driverVersion": " 8.52.322.2202 ",
-    "driverVersionComparator": " LESS_THAN "
-  },
-  {
-    "os": "WINNT 6.0",
-    "vendor": "0xdcba",
-    "devices": [
-      "0x2783",
-      "0x1234",
-      "0x2782"
-    ],
-    "feature": " DIRECT3D_9_LAYERS ",
-    "featureStatus": " BLOCKED_DRIVER_VERSION ",
-    "driverVersion": " 8.52.322.2202 ",
-    "driverVersionComparator": " LESS_THAN "
-  }
-]
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_pluginBlocklistCtp-plugins.json
+++ /dev/null
@@ -1,56 +0,0 @@
-[
-  {
-    "matchName": "^test_plugin_0",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "severity": "0",
-        "vulnerabilityStatus": "0"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_plugin_1",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "severity": "0",
-        "vulnerabilityStatus": "1"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_plugin_2",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "severity": "0",
-        "vulnerabilityStatus": "2"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_plugin_3",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "vulnerabilityStatus": "2"
-      }
-    ]
-  },
-  {
-    "matchName": "^test_plugin_4",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "severity": "1",
-        "vulnerabilityStatus": "2"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_pluginBlocklistCtpUndo-plugins.json
+++ /dev/null
@@ -1,13 +0,0 @@
-[
-  {
-    "matchName": "^Test Plug-in",
-    "versionRange": [
-      {
-        "maxVersion": "*",
-        "minVersion": "0",
-        "severity": "0",
-        "vulnerabilityStatus": "2"
-      }
-    ]
-  }
-]
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_softblocked1-extensions.json
+++ /dev/null
@@ -1,10 +0,0 @@
-[
-  {
-    "guid": "softblock1@tests.mozilla.org",
-    "versionRange": [
-      {
-        "severity": "1"
-      }
-    ]
-  }
-]
\ No newline at end of file
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_metadata_filters.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_metadata_filters.js
@@ -1,17 +1,53 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests blocking of extensions by ID, name, creator, homepageURL, updateURL
 // and RegExps for each. See bug 897735.
 
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
+const BLOCKLIST_DATA = {
+  extensions: [
+    {
+      guid: null,
+      name: "/^Mozilla Corp\\.$/",
+      versionRange: [
+        {
+          severity: "1",
+          targetApplication: [
+            {
+              guid: "xpcshell@tests.mozilla.org",
+              maxVersion: "2.*",
+              minVersion: "1",
+            },
+          ],
+        },
+      ],
+    },
+    {
+      guid: "/block2/",
+      name: "/^Moz/",
+      homepageURL: "/\\.dangerous\\.com/",
+      updateURL: "/\\.dangerous\\.com/",
+      versionRange: [
+        {
+          severity: "3",
+          targetApplication: [
+            {
+              guid: "xpcshell@tests.mozilla.org",
+              maxVersion: "2.*",
+              minVersion: "1",
+            },
+          ],
+        },
+      ],
+    },
+  ],
+};
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
   await promiseStartupManager();
 
   // Should get blocked by name
   await promiseInstallWebExtension({
@@ -57,17 +93,17 @@ add_task(async function setup() {
                                                         "block2@tests.mozilla.org",
                                                         "block3@tests.mozilla.org"]);
   Assert.equal(a1.blocklistState, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   Assert.equal(a2.blocklistState, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   Assert.equal(a3.blocklistState, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 });
 
 add_task(async function test_blocks() {
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_blocklist_metadata_filters_1");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA);
 
   let [a1, a2, a3] = await AddonManager.getAddonsByIDs(["block1@tests.mozilla.org",
                                                         "block2@tests.mozilla.org",
                                                         "block3@tests.mozilla.org"]);
   Assert.equal(a1.blocklistState, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   Assert.equal(a2.blocklistState, Ci.nsIBlocklistService.STATE_BLOCKED);
   Assert.equal(a3.blocklistState, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 });
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_osabi.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_osabi.js
@@ -127,16 +127,101 @@ const ADDONS = [
 
     // Matches both os and abi so blocked
     blocklisted: [["2", "1.9"]],
   },
 ];
 
 const ADDON_IDS = ADDONS.map(a => a.id);
 
+const BLOCKLIST_DATA = [
+  {
+    guid: "test_bug393285_2@tests.mozilla.org",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_3a@tests.mozilla.org",
+    versionRange: [{maxVersion: "1.0", minVersion: "1.0"}],
+  },
+  {
+    guid: "test_bug393285_3b@tests.mozilla.org",
+    versionRange: [{maxVersion: "1.0", minVersion: "1.0"}],
+  },
+  {
+    guid: "test_bug393285_4@tests.mozilla.org",
+    versionRange: [
+      {
+        maxVersion: "1.0",
+        minVersion: "1.0",
+        targetApplication: [
+          {
+            guid: "xpcshell@tests.mozilla.org",
+            maxVersion: "1.0",
+            minVersion: "1.0",
+          },
+        ],
+      },
+    ],
+  },
+  {
+    guid: "test_bug393285_5@tests.mozilla.org",
+    os: "Darwin",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_6@tests.mozilla.org",
+    os: "XPCShell",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_7@tests.mozilla.org",
+    os: "Darwin,XPCShell,WINNT",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_8@tests.mozilla.org",
+    xpcomabi: "x86-msvc",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_9@tests.mozilla.org",
+    xpcomabi: "noarch-spidermonkey",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_10@tests.mozilla.org",
+    xpcomabi: "ppc-gcc3,noarch-spidermonkey,x86-msvc",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_11@tests.mozilla.org",
+    os: "Darwin",
+    xpcomabi: "ppc-gcc3,x86-msvc",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_12@tests.mozilla.org",
+    os: "Darwin",
+    xpcomabi: "ppc-gcc3,noarch-spidermonkey,x86-msvc",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_13@tests.mozilla.org",
+    os: "XPCShell",
+    xpcomabi: "ppc-gcc3,x86-msvc",
+    versionRange: [],
+  },
+  {
+    guid: "test_bug393285_14@tests.mozilla.org",
+    os: "XPCShell,WINNT",
+    xpcomabi: "ppc-gcc3,x86-msvc,noarch-spidermonkey",
+    versionRange: [],
+  },
+];
+
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
   await promiseStartupManager();
 
   for (let addon of ADDONS) {
     await promiseInstallWebExtension({
       manifest: {
         name: addon.name,
@@ -149,17 +234,17 @@ add_task(async function setup() {
   let addons = await getAddons(ADDON_IDS);
   for (let id of ADDON_IDS) {
     equal(addons.get(id).blocklistState, Ci.nsIBlocklistService.STATE_NOT_BLOCKED,
           `Add-on ${id} should not initially be blocked`);
   }
 });
 
 add_task(async function test_1() {
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data"), "test_bug393285");
+  await AddonTestUtils.loadBlocklistRawData({extensions: BLOCKLIST_DATA});
 
   let addons = await getAddons(ADDON_IDS);
   async function isBlocklisted(addon, appVer, toolkitVer) {
     let state = await Blocklist.getAddonBlocklistState(addon, appVer, toolkitVer);
     return state != Services.blocklist.STATE_NOT_BLOCKED;
   }
   for (let addon of ADDONS) {
     let {id} = addon;
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_flashonly.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_flashonly.js
@@ -15,17 +15,24 @@ function get_test_plugintag() {
   return null;
 }
 
 add_task(async function checkFlashOnlyPluginState() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   Services.prefs.setBoolPref("plugin.load_flash_only", false);
 
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data"), "test_bug514327_2");
+  await AddonTestUtils.loadBlocklistRawData({
+    plugins: [
+      {
+        matchName: "Test Plug-in",
+        versionRange: [{severity: "0"}],
+      },
+    ],
+  });
 
   var plugin = get_test_plugintag();
   if (!plugin)
     do_throw("Plugin tag not found");
 
   // run the code after the blocklist is closed
   Services.obs.notifyObservers(null, "addon-blocklist-closed");
   await new Promise(executeSoon);
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_outdated.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_outdated.js
@@ -25,16 +25,45 @@ var PLUGINS = [{
   name: "test_bug514327_2",
   version: "5",
   disabled: false,
   blocklisted: false,
 }].map(opts => new MockPluginTag(opts, opts.enabledState));
 
 mockPluginHost(PLUGINS);
 
+const BLOCKLIST_DATA = {
+  empty: {
+  },
+  outdated_1: {
+    plugins: [
+      {
+        matchName: "test_bug514327_1",
+        versionRange: [],
+      },
+      {
+        matchName: "test_bug514327_outdated",
+        versionRange: [{severity: "0"}],
+      },
+    ],
+  },
+  outdated_2: {
+    plugins: [
+      {
+        matchName: "test_bug514327_2",
+        versionRange: [],
+      },
+      {
+        matchName: "test_bug514327_outdated",
+        versionRange: [{severity: "0"}],
+      },
+    ],
+  },
+};
+
 var BlocklistPrompt = {
   get wrappedJSObject() { return this; },
 
   prompt(list) {
     // Should only include one item
     Assert.equal(list.length, 1);
     // And that item should be the blocked plugin, not the outdated one
     var item = list[0];
@@ -52,37 +81,37 @@ Cm.registerFactory(Components.ID("{26d32
                    "@mozilla.org/addons/blocklist-prompt;1", factory);
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
 
   await promiseStartupManager();
   // initialize the blocklist with no entries
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_bug514327_3_empty");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA.empty);
 
   gBlocklist = Services.blocklist;
 
   // The blocklist service defers plugin request until the Blocklist
   // module loads. Make sure it loads, or we'll wait forever.
   executeSoon(() => {
     void Blocklist;
   });
 
   // should NOT be marked as outdated by the blocklist
   Assert.equal(await gBlocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9"), nsIBLS.STATE_NOT_BLOCKED);
 });
 
 add_task(async function test_part_1() {
   // update blocklist with data that marks the plugin as outdated
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_bug514327_3_outdated_1");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA.outdated_1);
 
   // plugin should now be marked as outdated
   Assert.equal(await gBlocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9"), nsIBLS.STATE_OUTDATED);
 });
 
 add_task(async function test_part_2() {
   // update blocklist with data that marks the plugin as outdated
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_bug514327_3_outdated_2");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA.outdated_2);
 
   // plugin should still be marked as outdated
   Assert.equal(await gBlocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9"), nsIBLS.STATE_OUTDATED);
 });
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_severities.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_severities.js
@@ -27,21 +27,37 @@ var PLUGINS = [{
   // not blocklisted, not outdated
   name: "test_bug514327_4",
   version: "5",
   disabled: false,
   blocklisted: false,
   outdated: false,
 }];
 
+let BLOCKLIST_DATA = {
+  plugins: [
+    {
+      matchName: "^test_bug514327_1",
+      versionRange: [],
+    },
+    {
+      matchName: "^test_bug514327_2",
+      versionRange: [{severity: "0"}],
+    },
+    {
+      matchName: "^test_bug514327_3",
+      versionRange: [{severity: "0"}],
+    },
+  ],
+};
 
 add_task(async function checkBlocklistSeverities() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_bug514327_1");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA);
 
   var {blocklist} = Services;
 
   // The blocklist service defers plugin request until the Blocklist
   // module loads. Make sure it loads, or we'll wait forever.
   executeSoon(() => {
     void Blocklist;
   });
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_prefs.js
@@ -1,15 +1,56 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests resetting of preferences in blocklist entry when an add-on is blocked.
 // See bug 802434.
 
+const BLOCKLIST_DATA = [
+  {
+    guid: "block1@tests.mozilla.org",
+    versionRange: [
+      {
+        severity: "1",
+        targetApplication: [
+          {
+            guid: "xpcshell@tests.mozilla.org",
+            maxVersion: "2.*",
+            minVersion: "1",
+          },
+        ],
+      },
+    ],
+    prefs: [
+      "test.blocklist.pref1",
+      "test.blocklist.pref2",
+    ],
+  },
+  {
+    guid: "block2@tests.mozilla.org",
+    versionRange: [
+      {
+        severity: "3",
+        targetApplication: [
+          {
+            guid: "xpcshell@tests.mozilla.org",
+            maxVersion: "2.*",
+            minVersion: "1",
+          },
+        ],
+      },
+    ],
+    prefs: [
+      "test.blocklist.pref3",
+      "test.blocklist.pref4",
+    ],
+  },
+];
+
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
   await promiseStartupManager();
 
   // Add 2 extensions
   await promiseInstallWebExtension({
     manifest: {
@@ -42,17 +83,17 @@ add_task(async function setup() {
   Assert.equal(Services.prefs.getIntPref("test.blocklist.pref1"), 15);
   Assert.equal(Services.prefs.getIntPref("test.blocklist.pref2"), 15);
   Assert.equal(Services.prefs.getBoolPref("test.blocklist.pref3"), true);
   Assert.equal(Services.prefs.getBoolPref("test.blocklist.pref4"), true);
 });
 
 
 add_task(async function test_blocks() {
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "test_blocklist_prefs_1");
+  await AddonTestUtils.loadBlocklistRawData({extensions: BLOCKLIST_DATA});
 
   // Blocklist changes should have applied and the prefs must be reset.
   let [a1, a2] = await AddonManager.getAddonsByIDs(["block1@tests.mozilla.org",
                                                     "block2@tests.mozilla.org"]);
   Assert.notEqual(a1, null);
   Assert.equal(a1.blocklistState, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   Assert.notEqual(a2, null);
   Assert.equal(a2.blocklistState, Ci.nsIBlocklistService.STATE_BLOCKED);
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_severities.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_severities.js
@@ -118,20 +118,98 @@ function createAddon(addon) {
           strict_min_version: addon.appVersion,
           strict_max_version: addon.appVersion,
         },
       },
     },
   });
 }
 
-async function loadBlocklist(file, callback) {
+const BLOCKLIST_DATA = {
+  start: {
+    // Block 4-6 and a dummy:
+    extensions: [
+      {
+        guid: "test_bug455906_4@tests.mozilla.org",
+        versionRange: [{severity: "-1"}],
+      },
+      {
+        guid: "test_bug455906_5@tests.mozilla.org",
+        versionRange: [{severity: "1"}],
+      },
+      {
+        guid: "test_bug455906_6@tests.mozilla.org",
+        versionRange: [{severity: "2"}],
+      },
+      {
+        guid: "dummy_bug455906_1@tests.mozilla.org",
+        versionRange: [],
+      },
+    ],
+    // Block 4-6:
+    plugins: [
+      {
+        matchName: "^test_bug455906_4$",
+        versionRange: [{severity: "0"}],
+      },
+      {
+        matchName: "^test_bug455906_5$",
+        versionRange: [{severity: "1"}],
+      },
+      {
+        matchName: "^test_bug455906_6$",
+        versionRange: [{severity: "2"}],
+      },
+    ],
+  },
+  warn: {
+    // warn for all test add-ons:
+    extensions: ADDONS.filter(a => a.id.startsWith("test_")).map(a => ({
+      guid: a.id,
+      versionRange: [{severity: "-1"}],
+    })),
+    // warn for all plugins with a regex:
+    plugins: [
+      {
+        matchName: "^test_bug455906",
+        versionRange: [{severity: "-1"}],
+      },
+    ],
+  },
+  block: {
+    // block all test add-ons:
+    extensions: ADDONS.filter(a => a.id.startsWith("test_")).map(a => ({
+      guid: a.id,
+      blockID: a.id,
+      versionRange: [],
+    })),
+    // block all plugins with a regex:
+    plugins: [
+      {
+        matchName: "^test_bug455906",
+        versionRange: [],
+        blockID: "test_bug455906_plugin",
+      },
+    ],
+  },
+  empty: {
+    // Block a dummy so there's a change:
+    extensions: [{
+      guid: "dummy_bug455906_2@tests.mozilla.org",
+      versionRange: [],
+    }],
+    // Need an empty list to force clearing things:
+    plugins: [],
+  },
+};
+
+async function loadBlocklist(id, callback) {
   gNotificationCheck = callback;
 
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data"), file);
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA[id]);
 }
 
 async function check_plugin_state(plugin) {
   let blocklistState = await Blocklist.getPluginBlocklistState(plugin);
   return `${plugin.disabled},${blocklistState == Services.blocklist.STATE_BLOCKED}`;
 }
 
 function create_blocklistURL(blockID) {
@@ -168,17 +246,17 @@ add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "3");
 
   await promiseStartupManager();
 
   // Load the initial blocklist into the profile to check add-ons start in the
   // right state.
   // Make sure to do this before we touch the plugin service, since that
   // will force a blocklist load.
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data/"), "bug455906_start");
+  await AddonTestUtils.loadBlocklistRawData(BLOCKLIST_DATA.start);
   mockPluginHost(PLUGINS);
 
 
   for (let addon of ADDONS)
     await createAddon(addon);
 });
 
 add_task(async function test_1() {
@@ -206,17 +284,17 @@ add_task(async function test_1() {
 
   // Put the add-ons into the base state
   await addons[0].disable();
   await addons[4].enable();
 
   await promiseRestartManager();
   await checkInitialState();
 
-  await loadBlocklist("bug455906_warn", args => {
+  await loadBlocklist("warn", args => {
     dump("Checking notification pt 2\n");
     // Note: in the XML version, this notifies for 4 items - 2 add-ons and 2 plugins.
     // This test is artificial, we don't notify for add-ons anymore, see
     // https://bugzilla.mozilla.org/show_bug.cgi?id=1257565#c111 . Cleaning this up
     // should happen but this patchset is too huge as it is so I'm deferring it.
     equal(args.list.length, 2);
 
     for (let addon of args.list) {
@@ -266,24 +344,24 @@ add_task(async function test_1() {
 
   // Back to starting state
   await addons[2].enable();
   await addons[5].enable();
   PLUGINS[2].enabledState = Ci.nsIPluginTag.STATE_ENABLED;
   PLUGINS[5].enabledState = Ci.nsIPluginTag.STATE_ENABLED;
 
   await promiseRestartManager();
-  await loadBlocklist("bug455906_start");
+  await loadBlocklist("start");
 });
 
 add_task(async function test_pt3() {
   await promiseRestartManager();
   await checkInitialState();
 
-  await loadBlocklist("bug455906_block", args => {
+  await loadBlocklist("block", args => {
     dump("Checking notification pt 3\n");
     equal(args.list.length, 3);
 
     for (let addon of args.list) {
       if (addon.item instanceof Ci.nsIPluginTag) {
         switch (addon.item.name) {
           case "test_bug455906_2":
             ok(addon.blocked);
@@ -349,28 +427,28 @@ add_task(async function test_pt3() {
   equal(await Blocklist.getPluginBlockURL(PLUGINS[4]), create_blocklistURL("test_bug455906_plugin"));
 
   // Shouldn't be changed
   checkAddonState(addons[5], {userDisabled: false, softDisabled: false, appDisabled: true});
   checkAddonState(addons[6], {userDisabled: false, softDisabled: false, appDisabled: true});
   equal(await check_plugin_state(PLUGINS[5]), "false,true");
 
   // Back to starting state
-  await loadBlocklist("bug455906_start");
+  await loadBlocklist("start");
 });
 
 add_task(async function test_pt4() {
   let addon = await AddonManager.getAddonByID(ADDONS[4].id);
   await addon.enable();
   PLUGINS[4].enabledState = Ci.nsIPluginTag.STATE_ENABLED;
 
   await promiseRestartManager();
   await checkInitialState();
 
-  await loadBlocklist("bug455906_empty", args => {
+  await loadBlocklist("empty", args => {
     dump("Checking notification pt 4\n");
     // See note in other callback - we no longer notify for non-blocked add-ons.
     ok(false, "Should not get a notification as there are no blocked plugins.");
   });
 
   await promiseRestartManager();
   dump("Checking results pt 4\n");
 
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklistchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklistchange.js
@@ -38,16 +38,177 @@ const XPIS = {};
 
 const ADDON_IDS = ["softblock1@tests.mozilla.org",
                    "softblock2@tests.mozilla.org",
                    "softblock3@tests.mozilla.org",
                    "softblock4@tests.mozilla.org",
                    "hardblock@tests.mozilla.org",
                    "regexpblock@tests.mozilla.org"];
 
+const BLOCK_APP = [{
+  guid: "xpcshell@tests.mozilla.org",
+  maxVersion: "2.*",
+  minVersion: "2",
+}];
+
+function softBlockApp(id) {
+  return {
+    guid: `${id}@tests.mozilla.org`,
+    versionRange: [{
+      severity: "1",
+      targetApplication: BLOCK_APP,
+    }],
+  };
+}
+
+function softBlockAddonChange(id) {
+  return {
+    guid: `${id}@tests.mozilla.org`,
+    versionRange: [{
+      severity: "1",
+      minVersion: "2",
+      maxVersion: "3",
+    }],
+  };
+}
+
+function softBlockUpdate2(id) {
+  return {
+    guid: `${id}@tests.mozilla.org`,
+    versionRange: [{severity: "1"}],
+  };
+}
+
+function softBlockManual(id) {
+  return {
+    guid: `${id}@tests.mozilla.org`,
+    versionRange: [{
+      maxVersion: "2",
+      minVersion: "1",
+      severity: "1",
+    }],
+  };
+}
+
+const BLOCKLIST_DATA = {
+  app_update: [
+    softBlockApp("softblock1"),
+    softBlockApp("softblock2"),
+    softBlockApp("softblock3"),
+    softBlockApp("softblock4"),
+    softBlockApp("softblock5"),
+    {
+      guid: "hardblock@tests.mozilla.org",
+      versionRange: [
+        {
+          targetApplication: BLOCK_APP,
+        },
+      ],
+    },
+    {
+      guid: "/^RegExp/",
+      versionRange: [
+        {
+          severity: "1",
+          targetApplication: BLOCK_APP,
+        },
+      ],
+    },
+    {
+      guid: "/^RegExp/i",
+      versionRange: [
+        {
+          targetApplication: BLOCK_APP,
+        },
+      ],
+    },
+  ],
+  addon_change: [
+    softBlockAddonChange("softblock1"),
+    softBlockAddonChange("softblock2"),
+    softBlockAddonChange("softblock3"),
+    softBlockAddonChange("softblock4"),
+    softBlockAddonChange("softblock5"),
+    {
+      guid: "hardblock@tests.mozilla.org",
+      versionRange: [
+        {
+          maxVersion: "3",
+          minVersion: "2",
+        },
+      ],
+    },
+    {
+      _comment: "Two RegExp matches, so test flags work - first shouldn't match.",
+      guid: "/^RegExp/",
+      versionRange: [
+        {
+          maxVersion: "3",
+          minVersion: "2",
+          severity: "1",
+        },
+      ],
+    },
+    {
+      guid: "/^RegExp/i",
+      versionRange: [
+        {
+          maxVersion: "3",
+          minVersion: "2",
+          severity: "2",
+        },
+      ],
+    },
+  ],
+  blocklist_update2: [
+    softBlockUpdate2("softblock1"),
+    softBlockUpdate2("softblock2"),
+    softBlockUpdate2("softblock3"),
+    softBlockUpdate2("softblock4"),
+    softBlockUpdate2("softblock5"),
+    {
+      guid: "hardblock@tests.mozilla.org",
+      versionRange: [],
+    },
+    {
+      guid: "/^RegExp/",
+      versionRange: [{severity: "1"}],
+    },
+    {
+      guid: "/^RegExp/i",
+      versionRange: [],
+    },
+  ],
+  manual_update: [
+    softBlockManual("softblock1"),
+    softBlockManual("softblock2"),
+    softBlockManual("softblock3"),
+    softBlockManual("softblock4"),
+    softBlockManual("softblock5"),
+    {
+      guid: "hardblock@tests.mozilla.org",
+      versionRange: [
+        {
+          maxVersion: "2",
+          minVersion: "1",
+        },
+      ],
+    },
+    {
+      guid: "/^RegExp/i",
+      versionRange: [
+        {
+          maxVersion: "2",
+          minVersion: "1",
+        },
+      ],
+    },
+  ],
+};
+
 // XXXgijs: according to https://bugzilla.mozilla.org/show_bug.cgi?id=1257565#c111
 // this code and the related code in Blocklist.jsm (specific to XML blocklist) is
 // dead code and can be removed. See https://bugzilla.mozilla.org/show_bug.cgi?id=1549550 .
 //
 // Don't need the full interface, attempts to call other methods will just
 // throw which is just fine
 var WindowWatcher = {
   openWindow(parent, url, name, features, openArgs) {
@@ -88,18 +249,18 @@ var InstallConfirmFactory = {
   },
 };
 
 var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 registrar.registerFactory(Components.ID("{f0863905-4dde-42e2-991c-2dc8209bc9ca}"),
                           "Fake Install Prompt",
                           "@mozilla.org/addons/web-install-prompt;1", InstallConfirmFactory);
 
-function Pload_blocklist(aFile) {
-  return AddonTestUtils.loadBlocklistData(do_get_file("../data/blocklistchange/"), aFile);
+function Pload_blocklist(aId) {
+  return AddonTestUtils.loadBlocklistRawData({extensions: BLOCKLIST_DATA[aId]});
 }
 
 // Does a background update check for add-ons and returns a promise that
 // resolves when any started installs complete
 function Pbackground_update() {
   return new Promise((resolve, reject) => {
     let installCount = 0;
     let backgroundCheckCompleted = false;
@@ -414,17 +575,17 @@ add_task(async function update_schema_5(
 
   await s1.enable();
   await s2.enable();
 });
 
 // Starts with add-ons unblocked and then loads new blocklists to change add-ons
 // to blocked and back again.
 add_task(async function run_blocklist_update_test() {
-  await Pload_blocklist("blocklist_update1");
+  await AddonTestUtils.loadBlocklistRawData({extensions: []});
   await promiseRestartManager();
 
   let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
@@ -458,17 +619,17 @@ add_task(async function run_blocklist_up
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
-  await Pload_blocklist("blocklist_update1");
+  await AddonTestUtils.loadBlocklistRawData({extensions: []});
   await promiseRestartManager();
 
   [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_prefs.js
@@ -67,17 +67,43 @@ async function run_test() {
     status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT3D_9_LAYERS);
     Assert.equal(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);
 
     Assert.equal(Services.prefs.getIntPref("gfx.blacklist.direct2d"),
                  Ci.nsIGfxInfo.FEATURE_BLOCKED_DRIVER_VERSION);
 
     Services.obs.removeObserver(blacklistAdded, "blocklist-data-gfxItems");
     Services.obs.addObserver(blacklistRemoved, "blocklist-data-gfxItems");
-    mockGfxBlocklistItemsFromDisk("../data/test_gfxBlacklist2.json");
+    mockGfxBlocklistItems([
+      {
+        os: "WINNT 6.1",
+        vendor: "0xabcd",
+        devices: [
+          "0x2783",
+          "0x2782",
+        ],
+        feature: " DIRECT2D ",
+        featureStatus: " BLOCKED_DRIVER_VERSION ",
+        driverVersion: " 8.52.322.2202 ",
+        driverVersionComparator: " LESS_THAN ",
+      },
+      {
+        os: "WINNT 6.0",
+        vendor: "0xdcba",
+        devices: [
+          "0x2783",
+          "0x1234",
+          "0x2782",
+        ],
+        feature: " DIRECT3D_9_LAYERS ",
+        featureStatus: " BLOCKED_DRIVER_VERSION ",
+        driverVersion: " 8.52.322.2202 ",
+        driverVersionComparator: " LESS_THAN ",
+      },
+    ]);
   }
 
   function blacklistRemoved(aSubject, aTopic, aData) {
     // If we wait until after we go through the event loop, gfxInfo is sure to
     // have processed the gfxItems event.
     executeSoon(ensureBlacklistUnset);
   }
   function ensureBlacklistUnset() {
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginBlocklistCtp.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginBlocklistCtp.js
@@ -44,32 +44,104 @@ var PLUGINS = [{
 {
   // not in the blocklist -> not blocked
   name: "test_plugin_5",
   version: "5",
   disabled: false,
   blocklisted: false,
 }];
 
+const BLOCKLIST_DATA = {
+  ctp: [
+    {
+      "matchName": "^test_plugin_0",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "severity": "0",
+          "vulnerabilityStatus": "0",
+        },
+      ],
+    },
+    {
+      "matchName": "^test_plugin_1",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "severity": "0",
+          "vulnerabilityStatus": "1",
+        },
+      ],
+    },
+    {
+      "matchName": "^test_plugin_2",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "severity": "0",
+          "vulnerabilityStatus": "2",
+        },
+      ],
+    },
+    {
+      "matchName": "^test_plugin_3",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "vulnerabilityStatus": "2",
+        },
+      ],
+    },
+    {
+      "matchName": "^test_plugin_4",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "severity": "1",
+          "vulnerabilityStatus": "2",
+        },
+      ],
+    },
+  ],
+  ctpUndo: [
+    {
+      "matchName": "^Test Plug-in",
+      "versionRange": [
+        {
+          "maxVersion": "*",
+          "minVersion": "0",
+          "severity": "0",
+          "vulnerabilityStatus": "2",
+        },
+      ],
+    },
+  ],
+};
+
 async function updateBlocklist(file) {
   let blocklistUpdated = TestUtils.topicObserved("plugin-blocklist-updated");
-  AddonTestUtils.loadBlocklistData(do_get_file("../data/"), file);
+  AddonTestUtils.loadBlocklistRawData({plugins: BLOCKLIST_DATA[file]});
   return blocklistUpdated;
 }
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   Services.prefs.setBoolPref("plugin.load_flash_only", false);
   gPluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
   await promiseStartupManager();
 });
 
 add_task(async function basic() {
-  await updateBlocklist("test_pluginBlocklistCtp");
+  await updateBlocklist("ctp");
   var {blocklist} = Services;
 
   Assert.equal(await blocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9"),
                nsIBLS.STATE_OUTDATED);
 
   Assert.equal(await blocklist.getPluginBlocklistState(PLUGINS[1], "1", "1.9"),
                nsIBLS.STATE_VULNERABLE_UPDATE_AVAILABLE);
 
@@ -102,36 +174,36 @@ add_task(async function test_is_not_clic
   var blocklistState = await Blocklist.getPluginBlocklistState(plugin, "1", "1.9");
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
 });
 
 // Here, we've updated the blocklist to have a block for the test plugin,
 // so it should be click-to-play.
 add_task(async function test_is_clicktoplay() {
-  await updateBlocklist("test_pluginBlocklistCtpUndo");
+  await updateBlocklist("ctpUndo");
   var plugin = get_test_plugin();
   var blocklistState = await Blocklist.getPluginBlocklistState(plugin, "1", "1.9");
   Assert.equal(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
 });
 
 // But now we've removed that entry from the blocklist (really we've gone back
 // to the old one), so the plugin shouldn't be click-to-play any more.
 add_task(async function test_is_not_clicktoplay2() {
-  await updateBlocklist("test_pluginBlocklistCtp");
+  await updateBlocklist("ctp");
   var plugin = get_test_plugin();
   var blocklistState = await Blocklist.getPluginBlocklistState(plugin, "1", "1.9");
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
 });
 
 // Test that disabling the blocklist when a plugin is ctp-blocklisted will
 // result in the plugin not being click-to-play.
 add_task(async function test_disable_blocklist() {
-  await updateBlocklist("test_pluginBlocklistCtpUndo");
+  await updateBlocklist("ctpUndo");
   var plugin = get_test_plugin();
   var blocklistState = await Blocklist.getPluginBlocklistState(plugin, "1", "1.9");
   Assert.equal(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
 
   Services.prefs.setBoolPref("extensions.blocklist.enabled", false);
   blocklistState = await Blocklist.getPluginBlocklistState(plugin, "1", "1.9");
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
   Assert.notEqual(blocklistState, Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginInfoURL.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginInfoURL.js
@@ -22,24 +22,94 @@ MockPlugin.prototype = {
 const PLUGINS = [
   new MockPlugin("test_with_infoURL", "5", Ci.nsIPluginTag.STATE_ENABLED),
   new MockPlugin("test_with_altInfoURL", "5", Ci.nsIPluginTag.STATE_ENABLED),
   new MockPlugin("test_no_infoURL", "5", Ci.nsIPluginTag.STATE_ENABLED),
   new MockPlugin("test_newVersion", "1", Ci.nsIPluginTag.STATE_ENABLED),
   new MockPlugin("test_newVersion", "3", Ci.nsIPluginTag.STATE_ENABLED),
 ];
 
+const BLOCKLIST_DATA = [
+  {
+    "matchName": "^test_with_infoURL",
+    "matchVersion": "^5",
+    "versionRange": [
+      {
+        "targetApplication": [
+          {
+            "guid": "xpcshell@tests.mozilla.org",
+            "maxVersion": "*",
+            "minVersion": "1",
+          },
+        ],
+      },
+    ],
+    "blockID": "test_plugin_wInfoURL",
+    "infoURL": "http://test.url.com/",
+  },
+  {
+    "matchName": "^test_with_altInfoURL",
+    "matchVersion": "^5",
+    "versionRange": [
+      {
+        "targetApplication": [
+          {
+            "guid": "xpcshell@tests.mozilla.org",
+            "maxVersion": "*",
+            "minVersion": "1",
+          },
+        ],
+      },
+    ],
+    "blockID": "test_plugin_wAltInfoURL",
+    "infoURL": "http://alt.test.url.com/",
+  },
+  {
+    "matchName": "^test_no_infoURL",
+    "versionRange": [
+      {
+        "targetApplication": [
+          {
+            "guid": "xpcshell@tests.mozilla.org",
+            "maxVersion": "*",
+            "minVersion": "1",
+          },
+        ],
+      },
+    ],
+    "blockID": "test_plugin_noInfoURL",
+  },
+  {
+    "matchName": "^test_newVersion",
+    "versionRange": [
+      {
+        "maxVersion": "2",
+        "minVersion": "1",
+        "targetApplication": [
+          {
+            "guid": "xpcshell@tests.mozilla.org",
+            "maxVersion": "*",
+            "minVersion": "1",
+          },
+        ],
+      },
+    ],
+    "blockID": "test_plugin_newVersion",
+    "infoURL": "http://test.url2.com/",
+  },
+];
+
 /**
  * The entry point of the unit tests, which is also responsible of
  * copying the blocklist file to the profile folder.
  */
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   await promiseStartupManager();
-  await AddonTestUtils.loadBlocklistData(do_get_file("../data"), "pluginInfoURL_block");
+  await AddonTestUtils.loadBlocklistRawData({plugins: BLOCKLIST_DATA});
 });
 
 /**
  * Test that the blocklist service correctly loads and returns the infoURL for
  * a plugin that matches the first entry in the blocklist.
  */
 add_task(async function test_infoURL() {
   // The testInfoURL must match the value within the
--- a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js
@@ -1,16 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-function load_blocklist(aFile) {
-  return AddonTestUtils.loadBlocklistData(do_get_file("../data"), aFile);
-}
-
 // Tests that an appDisabled add-on that becomes softBlocked remains disabled
 // when becoming appEnabled
 add_task(async function test_softblock() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
   await promiseStartupManager();
 
   await promiseInstallWebExtension({
     manifest: {
@@ -28,17 +24,26 @@ add_task(async function test_softblock()
 
   // Make sure to mark it as previously enabled.
   await s1.enable();
 
   Assert.ok(!s1.softDisabled);
   Assert.ok(s1.appDisabled);
   Assert.ok(!s1.isActive);
 
-  await load_blocklist("test_softblocked1");
+  await AddonTestUtils.loadBlocklistRawData({extensions: [
+    {
+      "guid": "softblock1@tests.mozilla.org",
+      "versionRange": [
+        {
+          "severity": "1",
+        },
+      ],
+    },
+  ]});
 
   Assert.ok(s1.softDisabled);
   Assert.ok(s1.appDisabled);
   Assert.ok(!s1.isActive);
 
   AddonTestUtils.appInfo.platformVersion = "2";
   await promiseRestartManager("2");