Bug 557269: Port old xpcshell tests to the new API. r=robstrong
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 28 Apr 2010 11:49:56 -0700
changeset 41583 2b6722d6b864e8e618d4de243d01fb1d3e6de29d
parent 41582 8bbe856ee60e3ea6ecee2ced52181193e8d2ce2e
child 41584 16f9f777d64d640c2aa1cef9fe47a9a6f0941f19
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersrobstrong
bugs557269
milestone1.9.3a5pre
Bug 557269: Port old xpcshell tests to the new API. r=robstrong
toolkit/mozapps/extensions/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/XPIProvider.jsm
toolkit/mozapps/extensions/test/addons/test_bug371495/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug392180/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_1/README
toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug436207/install.js
toolkit/mozapps/extensions/test/unit/data/cert8.db
toolkit/mozapps/extensions/test/unit/data/key3.db
toolkit/mozapps/extensions/test/unit/data/secmod.db
toolkit/mozapps/extensions/test/unit/data/signed-no-cn.xpi
toolkit/mozapps/extensions/test/unit/data/signed-no-o.xpi
toolkit/mozapps/extensions/test/unit/data/signed-tampered.xpi
toolkit/mozapps/extensions/test/unit/data/signed-untrusted.xpi
toolkit/mozapps/extensions/test/unit/data/signed.xpi
toolkit/mozapps/extensions/test/unit/data/test_bug299716.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug299716_2.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug324121.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug378216.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug393285.xml
toolkit/mozapps/extensions/test/unit/data/test_bug394300.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug396129.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug424107_1.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug424107_2.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug468528.xml
toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_1.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_2.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_3.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_4.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_5.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_1.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_2.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_3.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_4.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_5.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug486195/install.rdf
toolkit/mozapps/extensions/test/unit/data/test_bug514327_1.xml
toolkit/mozapps/extensions/test/unit/data/test_bug514327_2.xml
toolkit/mozapps/extensions/test/unit/data/test_bug526598_1.xpi
toolkit/mozapps/extensions/test/unit/data/test_bug526598_2.xpi
toolkit/mozapps/extensions/test/unit/data/test_bug541420.xpi
toolkit/mozapps/extensions/test/unit/data/unsigned.xpi
toolkit/mozapps/extensions/test/unit/test_LightweightThemeManager.js
toolkit/mozapps/extensions/test/unit/test_bug257155.js
toolkit/mozapps/extensions/test/unit/test_bug299716.js
toolkit/mozapps/extensions/test/unit/test_bug299716_2.js
toolkit/mozapps/extensions/test/unit/test_bug324121.js
toolkit/mozapps/extensions/test/unit/test_bug335238.js
toolkit/mozapps/extensions/test/unit/test_bug371495.js
toolkit/mozapps/extensions/test/unit/test_bug378216.js
toolkit/mozapps/extensions/test/unit/test_bug384052.js
toolkit/mozapps/extensions/test/unit/test_bug386153.js
toolkit/mozapps/extensions/test/unit/test_bug391899.js
toolkit/mozapps/extensions/test/unit/test_bug392180.js
toolkit/mozapps/extensions/test/unit/test_bug393285.js
toolkit/mozapps/extensions/test/unit/test_bug394300.js
toolkit/mozapps/extensions/test/unit/test_bug394717.js
toolkit/mozapps/extensions/test/unit/test_bug396129.js
toolkit/mozapps/extensions/test/unit/test_bug397778.js
toolkit/mozapps/extensions/test/unit/test_bug406118.js
toolkit/mozapps/extensions/test/unit/test_bug424107.js
toolkit/mozapps/extensions/test/unit/test_bug425657.js
toolkit/mozapps/extensions/test/unit/test_bug428341.js
toolkit/mozapps/extensions/test/unit/test_bug430120.js
toolkit/mozapps/extensions/test/unit/test_bug436207.js
toolkit/mozapps/extensions/test/unit/test_bug465190.js
toolkit/mozapps/extensions/test/unit/test_bug468528.js
toolkit/mozapps/extensions/test/unit/test_bug470377_1.js
toolkit/mozapps/extensions/test/unit/test_bug470377_2.js
toolkit/mozapps/extensions/test/unit/test_bug470377_3.js
toolkit/mozapps/extensions/test/unit/test_bug470377_4.js
toolkit/mozapps/extensions/test/unit/test_bug474988.js
toolkit/mozapps/extensions/test/unit/test_bug486195.js
toolkit/mozapps/extensions/test/unit/test_bug509194.js
toolkit/mozapps/extensions/test/unit/test_bug514327_1.js
toolkit/mozapps/extensions/test/unit/test_bug514327_2.js
toolkit/mozapps/extensions/test/unit/test_bug521905.js
toolkit/mozapps/extensions/test/unit/test_bug526598.js
toolkit/mozapps/extensions/test/unit/test_bug541420.js
toolkit/mozapps/extensions/test/xpcshell/data/test_bug299716.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug299716_2.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug324121.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug393285.xml
toolkit/mozapps/extensions/test/xpcshell/data/test_bug394300.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug468528.xml
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_1.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_2.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_3.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_4.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_5.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_1.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_2.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_3.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_4.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_5.rdf
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_1.xml
toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_2.xml
toolkit/mozapps/extensions/test/xpcshell/data/test_bug526598_1.xpi
toolkit/mozapps/extensions/test/xpcshell/data/test_bug526598_2.xpi
toolkit/mozapps/extensions/test/xpcshell/data/test_bug541420.xpi
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_LightweightThemeManager.js
toolkit/mozapps/extensions/test/xpcshell/test_bug299716.js
toolkit/mozapps/extensions/test/xpcshell/test_bug299716_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
toolkit/mozapps/extensions/test/xpcshell/test_bug371495.js
toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
toolkit/mozapps/extensions/test/xpcshell/test_bug394300.js
toolkit/mozapps/extensions/test/xpcshell/test_bug397778.js
toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
toolkit/mozapps/extensions/test/xpcshell/test_bug425657.js
toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
toolkit/mozapps/extensions/test/xpcshell/test_bug465190.js
toolkit/mozapps/extensions/test/xpcshell/test_bug468528.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_4.js
toolkit/mozapps/extensions/test/xpcshell/test_bug514327_1.js
toolkit/mozapps/extensions/test/xpcshell/test_bug514327_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug521905.js
toolkit/mozapps/extensions/test/xpcshell/test_bug526598.js
toolkit/mozapps/extensions/test/xpcshell/test_bug541420.js
--- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
@@ -284,17 +284,17 @@ function parseRDFManifest(id, type, upda
 
   function getProperty(ds, source, property) {
     return getValue(ds.GetTarget(source, EM_R(property), true));
   }
 
   function getRequiredProperty(ds, source, property) {
     let value = getProperty(ds, source, property);
     if (!value)
-      throw new Error("Missing required property " + property);
+      throw new Error("Update manifest is missing a required " + property + " property.");
     return value;
   }
 
   let rdfParser = Cc["@mozilla.org/rdf/xml-parser;1"].
                   createInstance(Ci.nsIRDFXMLParser);
   let ds = Cc["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"].
            createInstance(Ci.nsIRDFDataSource);
   rdfParser.parseString(ds, request.channel.URI, request.responseText);
@@ -363,33 +363,45 @@ function parseRDFManifest(id, type, upda
 
   let results = [];
   let ctr = Cc["@mozilla.org/rdf/container;1"].
             createInstance(Ci.nsIRDFContainer);
   ctr.Init(ds, updates);
   let items = ctr.GetElements();
   while (items.hasMoreElements()) {
     let item = items.getNext().QueryInterface(Ci.nsIRDFResource);
-    let version = getRequiredProperty(ds, item, "version");
+    let version = getProperty(ds, item, "version");
+    if (!version) {
+      WARN("Update manifest is missing a required version property.");
+      continue;
+    }
+
     LOG("Found an update entry for " + id + " version " + version);
 
     let targetApps = ds.GetTargets(item, EM_R("targetApplication"), true);
     while (targetApps.hasMoreElements()) {
       let targetApp = targetApps.getNext().QueryInterface(Ci.nsIRDFResource);
 
+      let appEntry = {};
+      try {
+        appEntry.id = getRequiredProperty(ds, targetApp, "id");
+        appEntry.minVersion = getRequiredProperty(ds, targetApp, "minVersion");
+        appEntry.maxVersion = getRequiredProperty(ds, targetApp, "maxVersion");
+      }
+      catch (e) {
+        WARN(e);
+        continue;
+      }
+
       let result = {
         version: version,
         updateURL: getProperty(ds, targetApp, "updateLink"),
         updateHash: getProperty(ds, targetApp, "updateHash"),
         updateInfoURL: getProperty(ds, targetApp, "updateInfoURL"),
-        targetApplications: [{
-          id: getRequiredProperty(ds, targetApp, "id"),
-          minVersion: getRequiredProperty(ds, targetApp, "minVersion"),
-          maxVersion: getRequiredProperty(ds, targetApp, "maxVersion"),
-        }]
+        targetApplications: [appEntry]
       };
 
       if (result.updateURL && checkSecurity &&
           result.updateURL.substring(0, 6) != "https:" &&
           (!result.updateHash || result.updateHash.substring(0, 3) != "sha")) {
         WARN("updateLink " + result.updateURL + " is not secure and is not verified" +
              " by a strong enough hash (needs to be sha1 or stronger).");
         delete result.updateURL;
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/XPIProvider.jsm
@@ -79,16 +79,18 @@ const KEY_PROFILEDIR                  = 
 const KEY_APPDIR                      = "XCurProcD";
 
 const KEY_APP_PROFILE                 = "app-profile";
 const KEY_APP_GLOBAL                  = "app-global";
 const KEY_APP_SYSTEM_LOCAL            = "app-system-local";
 const KEY_APP_SYSTEM_SHARE            = "app-system-share";
 const KEY_APP_SYSTEM_USER             = "app-system-user";
 
+const CATEGORY_UPDATE_PARAMS          = "extension-update-params";
+
 const UNKNOWN_XPCOM_ABI               = "unknownABI";
 const PREFIX_ITEM_URI                 = "urn:mozilla:item:";
 const XPI_PERMISSION                  = "install";
 
 const TOOLKIT_ID                      = "toolkit@mozilla.org";
 
 const BRANCH_REGEXP                   = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
 
@@ -356,16 +358,23 @@ function loadManifestFromRDF(uri, stream
       }
     }
   }
   if (!(addon.type in TYPES))
     throw new Error("Install manifest specifies unknown type: " + addon.type);
   if (addon.type == "theme" && !addon.internalName)
     throw new Error("Themes must include an internalName property");
 
+  // Only extensions are allowed to provide an optionsURL or aboutURL. For all
+  // other types they are silently ignored
+  if (addon.type != "extension") {
+    addon.optionsURL = null;
+    addon.aboutURL = null;
+  }
+
   addon.defaultLocale = readLocale(ds, root, true);
 
   addon.locales = [];
   let targets = ds.GetTargets(root, EM_R("localized"), true);
   while (targets.hasMoreElements()) {
     let target = targets.getNext().QueryInterface(Ci.nsIRDFResource);
     addon.locales.push(readLocale(ds, target, false));
   }
--- a/toolkit/mozapps/extensions/test/addons/test_bug371495/install.rdf
+++ b/toolkit/mozapps/extensions/test/addons/test_bug371495/install.rdf
@@ -13,13 +13,14 @@
         <em:minVersion>1</em:minVersion>
         <em:maxVersion>1</em:maxVersion>
       </Description>
     </em:targetApplication>
     
     <!-- Front End MetaData -->
     <em:name>Test theme</em:name>
     <em:type>4</em:type>
+    <em:internalName>test/1.0</em:internalName>
     <em:optionsURL>chrome://foo/content/bar.xul</em:optionsURL>
     <em:aboutURL>chrome://foo/content/bar.xul</em:aboutURL>
 
   </Description>
 </RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 1</em:name>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_10@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 10</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_11@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 11</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_12@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 12</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_13@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 13</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_2@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 2</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_3@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 3</em:name>
-    <em:updateURL>https://localhost:4444/test_bug378216_3/update.rdf</em:updateURL>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_4@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 4</em:name>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_5@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 5</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_6@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 6</em:name>
-    <em:updateURL>https://localhost:4444/test_bug378216_6/update.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_7@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 7</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_8@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 8</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_bug378216_9@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Bug 378216 Test 9</em:name>
-    <em:updateURL>http://localhost:4444/test_bug378216.rdf</em:updateURL>
-    <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj
-                  Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD
-                  NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf
-                  awB/zH4KaPiY3vnrzQIDAQAB</em:updateKey>
-
-  </Description>      
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug392180/install.rdf
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug392180@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>5</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:name>Bug 392180</em:name>
-    <em:updateURL>http://localhost:4444/update.rdf?%UPDATE_TYPE%</em:updateURL>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Compatible to install -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_a@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test A</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Incompatible until an update check -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_a@tests.mozilla.org</em:id>
-    <em:version>2</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test A</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Compatible to install -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_b@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test B</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Incompatible to install even after update check -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_b@tests.mozilla.org</em:id>
-    <em:version>2</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test B</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Compatible to install -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_c@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test C</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Incompatible to install and no update rdf -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_c@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test C</em:name>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Compatible to install -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_d@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test D</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Compatible to install -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug396129_d@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Bug 396129 Test D</em:name>
-    <em:updateURL>http://localhost:4444/data/test_bug396129.rdf</em:updateURL>
-    
-  </Description>      
-</RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_1/README
+++ /dev/null
@@ -1,1 +0,0 @@
-This is an add-on with no install.rdf that should fail to install.
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf
+++ /dev/null
@@ -1,1 +0,0 @@
-This install.rdf is malformed.
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This rdf is valid, but no install manifest resource -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Invalid guid -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>{invalid-guid}</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Invalid platform -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug428341_5@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetPlatform>Linux</em:targetPlatform>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Has an insecure update url -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug428341_6@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:updateURL>http://localhost</em:updateURL>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug428341_7@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>unknown@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug428341_8@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>2</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug428341_9@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>2</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 428341</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug436207/install.js
+++ /dev/null
@@ -1,1 +0,0 @@
-// Test add-on that attempts to use install.js to install.
deleted file mode 100644
index b3e9a4d16f5c830d8452771b6472557dface925a..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 9c8f73f789b91bee56e0d4033020d8e1d499bdf6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 9fe508820c5487539d7f32b118fa879b68bd8f84..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 90d3a3ce66692496ee625b2ae1725785193079a5..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 19b754038008ed3043a7178aa8c42da83747bf8e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 0e2bd8ad9f9efe8d353b62fa064c9da9390a8edc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 42ef19ba514ae060462e53f48cb795ec98044dd5..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index bd7f78b7c7712c0aca18776e08541e87898da119..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug299716.rdf
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE RDF:RDF [
-  <!ENTITY bug299716 "urn:mozilla:extension:bug299716">
-  <!ENTITY addons_prefix "http://localhost:4444/addons/test_bug299716">
-  <!ENTITY v0.2 "<em:version>0.2</em:version>">
-
-  <!ENTITY xpcshell.app "
-    <em:id>xpcshell@tests.mozilla.org</em:id>
-    <em:minVersion>5</em:minVersion>
-    <em:maxVersion>5</em:maxVersion>
-  ">
-
-  <!ENTITY toolkit.app "
-    <em:id>toolkit@mozilla.org</em:id>
-    <em:minVersion>1.9</em:minVersion>
-    <em:maxVersion>1.9</em:maxVersion>
-  ">
-
-  <!ENTITY invalidRange "
-    <em:minVersion>30</em:minVersion>
-    <em:maxVersion>30</em:maxVersion>
-  ">
-
-  <!ENTITY xpcshell.invalid "
-    <em:id>xpcshell@tests.mozilla.org</em:id>
-    &invalidRange;
-  ">
-
-  <!ENTITY toolkit.invalid "
-    <em:id>toolkit@mozilla.org</em:id>
-    &invalidRange;
-  ">
-]>
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <!-- XPCShell -->
-  <RDF:Description about="&bug299716;-a@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-a@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-a@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_a_2.xpi">
-        &xpcshell.app;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- Toolkit -->
-  <RDF:Description about="&bug299716;-b@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-b@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-b@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_b_2.xpi">
-        &toolkit.app;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- XPCShell + Toolkit -->
-  <RDF:Description about="&bug299716;-c@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-c@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-c@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_c_2.xpi">
-        &xpcshell.app;
-      </RDF:Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_c_2.xpi">
-        &toolkit.app;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- XPCShell (Toolkit invalid) -->
-  <RDF:Description about="&bug299716;-d@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-d@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-d@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_d_2.xpi">
-        &xpcshell.app;
-      </RDF:Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_d_2.xpi">
-        &toolkit.invalid;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- Toolkit (XPCShell invalid), should not install -->
-  <RDF:Description about="&bug299716;-e@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-e@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-e@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_e_2.xpi">
-        &xpcshell.invalid;
-      </RDF:Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_e_2.xpi">
-        &toolkit.app;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- None (XPCShell, Toolkit invalid), should not install -->
-  <RDF:Description about="&bug299716;-f@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-f@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-f@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_f_2.xpi">
-        &xpcshell.invalid;
-      </RDF:Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_f_2.xpi">
-        &toolkit.invalid;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-
-  <!-- Toolkit (invalid), should not install -->
-  <RDF:Description about="&bug299716;-g@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li RDF:resource="&bug299716;-g@tests.mozilla.org:0.2"/>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="&bug299716;-g@tests.mozilla.org:0.2">
-    &v0.2;
-    <em:targetApplication>
-      <RDF:Description em:updateLink="&addons_prefix;_g_2.xpi">
-        &toolkit.invalid;
-      </RDF:Description>
-    </em:targetApplication>
-  </RDF:Description>
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug299716_2.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <RDF:Description about="urn:mozilla:extension:bug299716-2@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>0.1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>1.9</em:minVersion>
-                <em:maxVersion>2.0.*</em:maxVersion>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug324121.rdf
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:bug324121_2@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- app id compatible update available -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>3</em:minVersion>
-                <em:maxVersion>3</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug324121_3@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- app id incompatible update available -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug324121_6@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- toolkit id compatible update available -->
-	<RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>3</em:minVersion>
-                <em:maxVersion>3</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug324121_7@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- toolkit id incompatible update available -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug378216.rdf
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_5@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_7@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBAMO1O2gwSCCth1GwYMgscfaNakpN40PJfOWt
-                  ub2HVdg8+OXMciF8d/9eVWm8eH/IxuxyZlmRZTs3O5tv9eWAY5uBCtqDf1WgTsGk
-                  jrgZow1fITkZI7w0//C8eKdMLAtGueGfNs2IlTd5P/0KH/hf1rPc1wUqEqKCd4+L
-                  BcVq13ad</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_8@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBAMH/33P/bn148mVkAB8i5X8c4LhY52E+MPUT
-                  yKHGpowZnRLgL2O0dfpm+rljOBfKi51322PFrsc6VIFml6x4Lrb5foxSyB0Vs9pb
-                  SEDFWUKquOQvceQ9iEx5Pe0VzrmUZgcQxd8ksSunWL4wJaBZ/evE5amFC6sw3pv/
-                  fjt8p3GN</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_9@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-                <em:updateHash>sha1:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e6</em:updateHash>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBAJ5Dv3Zd7/j5dLchCw9iO/cxPq8oOhOYD2M+
-                  jUKvmHCyTBRIEaJrE4N7yVbRYk++ERIfyVepLivsVi4pBmF7JTdw0NaKUA0LiOoT
-                  mRL8I7s5NPjCiiNcdqbncWyiZwIj1w1nkbWGTlH/gEjRW/LbvT4JAuec8yNFDa4S
-                  X8mOMf7k</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_10@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>https://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBAGvf7XqqoTl5WofrNq55E7W+UttOEDXLB3Oi
-                  XDiXe0i6njlozilseaUo1hgfQhhzN9gkyetP5tGBVcLRrVyliKpJmD6ABCVGW1lS
-                  qS+SEw7gDHyHkvwKMyWKedpRGChqLYnnf+Y+CX3MWLZLkwPXMKdTYgN3Rx0lEnJk
-                  37LSEMKE</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_11@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>https://localhost:4444/broken.xpi</em:updateLink>
-                <em:updateHash>sha1:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e6</em:updateHash>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBACMX/KReOGSJ8CMGRroH1v3Gjv/Qs/pqH+Ow
-                  o+hCKWLUKx7hpJgVJkXXdAHW0U88NXlp1S2H0WqA7I/CdmNXJSPzzV/J4z1dZgXh
-                  JbW6mqNb0pj6nIe7g8OLzSxDgBmO4DUP5DAmnmqciJLWQzN7OdbcwrWz6xPN5kZF
-                  A90eF5zy</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_12@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-                <em:updateHash>md2:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e6</em:updateHash>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBAJRfcFvHIWxVyycCw8IjNmEhabc2uqA1zQwp
-                  5oKh3Y23hwIsQ6xy68Wtjte1NEYFRt5fWkbMXj9YQj6LpVbzBKiGATcrq6MycZKK
-                  o5N22cWbrKKRweJezTyN4eLfQg21pG7r8mdfS0bIA28ZVFtQOmORejoUesEouCGy
-                  eKYk9nS2</em:signature>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:test_bug378216_13@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2.0</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>https://localhost:4444/broken.xpi</em:updateLink>
-                <em:updateHash>md2:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e6</em:updateHash>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-    <em:signature>MIGTMA0GCSqGSIb3DQEBBQUAA4GBALQKwzLFr/VOw3gJvv/LCh3/PWDd9FqmFnX+
-                  hJjBmCaUDtG7CXn1i0h8ed8IeRHpLLT7FCzVwU3bH9BUjdm8wc3ObtlNbd8go01a
-                  CoXz50r3rYPcYz4WS+7/+lvrUqsuWd9Wj+q0NeCPiNaaro6/AolE2Qf5JFRL3lxY
-                  lsKWAnVO</em:signature>
-  </RDF:Description>
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug393285.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
-  <emItems>
-    <emItem id="test_bug393285_2@tests.mozilla.org"/>
-    <emItem id="test_bug393285_3@tests.mozilla.org">
-      <versionRange minVersion="1.0" maxVersion="1.0"/>
-    </emItem>
-    <emItem id="test_bug393285_4@tests.mozilla.org">
-      <versionRange minVersion="1.0" maxVersion="1.0">
-        <targetApplication id="xpcshell@tests.mozilla.org">
-          <versionRange minVersion="1.0" maxVersion="1.0"/>
-        </targetApplication>
-      </versionRange>
-    </emItem>
-    <emItem id="test_bug393285_5@tests.mozilla.org" os="Darwin"/>
-    <emItem id="test_bug393285_6@tests.mozilla.org" os="XPCShell"/>
-    <emItem id="test_bug393285_7@tests.mozilla.org" os="Darwin,XPCShell,WINNT"/>
-    <emItem id="test_bug393285_8@tests.mozilla.org" xpcomabi="x86-msvc"/>
-    <emItem id="test_bug393285_9@tests.mozilla.org" xpcomabi="noarch-spidermonkey"/>
-    <emItem id="test_bug393285_10@tests.mozilla.org" xpcomabi="ppc-gcc3,noarch-spidermonkey,x86-msvc"/>
-    <emItem id="test_bug393285_11@tests.mozilla.org" os="Darwin" xpcomabi="ppc-gcc3,x86-msvc"/>
-    <emItem id="test_bug393285_12@tests.mozilla.org" os="Darwin" xpcomabi="ppc-gcc3,noarch-spidermonkey,x86-msvc"/>
-    <emItem id="test_bug393285_13@tests.mozilla.org" os="XPCShell" xpcomabi="ppc-gcc3,x86-msvc"/>
-    <emItem id="test_bug393285_14@tests.mozilla.org" os="XPCShell,WINNT" xpcomabi="ppc-gcc3,x86-msvc,noarch-spidermonkey"/>
-  </emItems>
-</blocklist>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug394300.rdf
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:bug394300_1@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- Not a valid install - incompatible app versions -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>20</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Valid install should be the version detected -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>10</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Valid install. Detecting this would indicate that the order
-             of entries is playing a part in the update detection. -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>6</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Not a valid install - no minVersion or maxVersion specified -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>40</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Not a valid install - incompatible app versions -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>30</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug394300_2@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <!-- Not a valid install - incompatible app versions -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>20</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Valid install should be the version detected -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>10</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>1.9</em:minVersion>
-                <em:maxVersion>1.9</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Valid install. Detecting this would indicate that the order
-             of entries is playing a part in the update detection. -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>6</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>1.9</em:minVersion>
-                <em:maxVersion>1.9</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Not a valid install - no minVersion or maxVersion specified -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>40</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-        <!-- Not a valid install - incompatible app versions -->
-        <RDF:li>
-          <RDF:Description>
-            <em:version>30</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>2</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug396129.rdf
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:bug396129_a@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/addons/test_bug396129_a_2.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug396129_b@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/addons/test_bug396129_b_2.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-  <RDF:Description about="urn:mozilla:extension:bug396129_d@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>2</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/addons/test_bug396129_d_2.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug424107_1.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug424107@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>5</em:minVersion>
-        <em:maxVersion>5</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:name>Bug 424107 test 1</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug424107_2.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug424107@tests.mozilla.org</em:id>
-    <em:version>2</em:version>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>5</em:minVersion>
-        <em:maxVersion>5</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:name>Bug 424107 test 2</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug468528.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
-  <pluginItems>
-    <pluginItem>
-      <match name="name" exp="^test_bug468528_1"/>
-    </pluginItem>
-    <pluginItem>
-      <match name="name" exp="^test_bug468528_2["/>
-    </pluginItem>
-    <pluginItem>
-      <match name="name" exp="^test_bug468528_3"/>
-    </pluginItem>
-  </pluginItems>
-</blocklist>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_1.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug470377_1@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>unknown@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 470377</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_2.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug470377_2@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 470377</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_3.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug470377_3@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 470377</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_4.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug470377_4@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 470377</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/install_5.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug470377_5@tests.mozilla.org</em:id>
-    <em:version>1</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>3</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:name>Test for Bug 470377</em:name>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_1.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug470377_1@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>unknown@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_2.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug470377_2@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_3.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug470377_3@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>1</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_4.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug470377_4@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>toolkit@mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>2</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug470377/update_5.rdf
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <RDF:Description about="urn:mozilla:extension:test_bug470377_5@tests.mozilla.org">
-    <em:updates>
-      <RDF:Seq>
-        <RDF:li>
-          <RDF:Description>
-            <em:version>1</em:version>
-            <em:targetApplication>
-              <RDF:Description>
-                <em:id>xpcshell@tests.mozilla.org</em:id>
-                <em:minVersion>1</em:minVersion>
-                <em:maxVersion>3</em:maxVersion>
-                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
-              </RDF:Description>
-            </em:targetApplication>
-          </RDF:Description>
-        </RDF:li>
-      </RDF:Seq>
-    </em:updates>
-  </RDF:Description>
-
-</RDF:RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug486195/install.rdf
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug486195@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>bug 486195 test</em:name>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug514327_1.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
-  <pluginItems>
-    <pluginItem>
-      <match name="name" exp="^test_bug514327_1"/>
-    </pluginItem>
-    <pluginItem>
-      <match name="name" exp="^test_bug514327_2"/>
-      <versionRange severity="0"/>
-    </pluginItem>
-    <pluginItem>
-      <match name="name" exp="^test_bug514327_3"/>
-      <versionRange severity="0"/>
-    </pluginItem>
-  </pluginItems>
-</blocklist>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/data/test_bug514327_2.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
-  <pluginItems>
-    <pluginItem>
-      <match name="name" exp="Test Plug-in"/>
-      <versionRange severity="0"/>
-    </pluginItem>
-  </pluginItems>
-</blocklist>
deleted file mode 100644
index a4954351c8659223daf33c28d5ced3f773ab4f19..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 30cf7590735aa749e55d4b4a722ba8bf8026d7f4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index d5d1e91da9793d1508a422ece91768ee0d632431..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 51b00475a9641ea9d608874a3ab7679da3a4374b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_LightweightThemeManager.js
+++ /dev/null
@@ -1,432 +0,0 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const MANDATORY = ["id", "name", "headerURL"];
-const OPTIONAL = ["footerURL", "textcolor", "accentcolor", "iconURL",
-                  "previewURL", "author", "description", "homepageURL",
-                  "updateURL", "version"];
-
-function dummy(id) {
-  return {
-    id: id || Math.random().toString(),
-    name: Math.random().toString(),
-    headerURL: "http://lwttest.invalid/a.png",
-    footerURL: "http://lwttest.invalid/b.png",
-    textcolor: Math.random().toString(),
-    accentcolor: Math.random().toString()
-  };
-}
-
-function run_test() {
-  var temp = {};
-  Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
-  do_check_eq(typeof temp.LightweightThemeManager, "object");
-
-  var ltm = temp.LightweightThemeManager;
-
-  do_check_eq(typeof ltm.usedThemes, "object");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  ltm.previewTheme(dummy("preview0"));
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  ltm.previewTheme(dummy("preview1"));
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-  ltm.resetPreview();
-
-  ltm.currentTheme = dummy("x0");
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.id, "x0");
-  do_check_eq(ltm.usedThemes[0].id, "x0");
-  do_check_eq(ltm.getUsedTheme("x0").id, "x0");
-
-  ltm.previewTheme(dummy("preview0"));
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.id, "x0");
-
-  ltm.resetPreview();
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.id, "x0");
-
-  ltm.currentTheme = dummy("x1");
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.id, "x1");
-  do_check_eq(ltm.usedThemes[1].id, "x0");
-
-  ltm.currentTheme = dummy("x2");
-  do_check_eq(ltm.usedThemes.length, 3);
-  do_check_eq(ltm.currentTheme.id, "x2");
-  do_check_eq(ltm.usedThemes[1].id, "x1");
-  do_check_eq(ltm.usedThemes[2].id, "x0");
-
-  ltm.currentTheme = dummy("x3");
-  ltm.currentTheme = dummy("x4");
-  ltm.currentTheme = dummy("x5");
-  ltm.currentTheme = dummy("x6");
-  ltm.currentTheme = dummy("x7");
-  do_check_eq(ltm.usedThemes.length, 8);
-  do_check_eq(ltm.currentTheme.id, "x7");
-  do_check_eq(ltm.usedThemes[1].id, "x6");
-  do_check_eq(ltm.usedThemes[7].id, "x0");
-
-  ltm.currentTheme = dummy("x8");
-  do_check_eq(ltm.usedThemes.length, 8);
-  do_check_eq(ltm.currentTheme.id, "x8");
-  do_check_eq(ltm.usedThemes[1].id, "x7");
-  do_check_eq(ltm.usedThemes[7].id, "x1");
-  do_check_eq(ltm.getUsedTheme("x0"), null);
-
-  ltm.forgetUsedTheme("nonexisting");
-  do_check_eq(ltm.usedThemes.length, 8);
-  do_check_neq(ltm.currentTheme, null);
-
-  ltm.forgetUsedTheme("x8");
-  do_check_eq(ltm.usedThemes.length, 7);
-  do_check_eq(ltm.currentTheme, null);
-  do_check_eq(ltm.usedThemes[0].id, "x7");
-  do_check_eq(ltm.usedThemes[6].id, "x1");
-
-  ltm.forgetUsedTheme("x7");
-  ltm.forgetUsedTheme("x6");
-  ltm.forgetUsedTheme("x5");
-  ltm.forgetUsedTheme("x4");
-  ltm.forgetUsedTheme("x3");
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme, null);
-  do_check_eq(ltm.usedThemes[0].id, "x2");
-  do_check_eq(ltm.usedThemes[1].id, "x1");
-
-  ltm.currentTheme = dummy("x1");
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.id, "x1");
-  do_check_eq(ltm.usedThemes[0].id, "x1");
-  do_check_eq(ltm.usedThemes[1].id, "x2");
-
-  ltm.currentTheme = dummy("x2");
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.id, "x2");
-  do_check_eq(ltm.usedThemes[0].id, "x2");
-  do_check_eq(ltm.usedThemes[1].id, "x1");
-
-  ltm.currentTheme = ltm.getUsedTheme("x1");
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.id, "x1");
-  do_check_eq(ltm.usedThemes[0].id, "x1");
-  do_check_eq(ltm.usedThemes[1].id, "x2");
-
-  ltm.forgetUsedTheme("x1");
-  ltm.forgetUsedTheme("x2");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  // Use chinese name to test utf-8, for bug #541943
-  var chineseTheme = dummy("chinese0");
-  chineseTheme.name = "中文0";
-  chineseTheme.description = "中文1";
-  ltm.currentTheme = chineseTheme;
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.name, "中文0");
-  do_check_eq(ltm.currentTheme.description, "中文1");
-  do_check_eq(ltm.usedThemes[0].name, "中文0");
-  do_check_eq(ltm.usedThemes[0].description, "中文1");
-  do_check_eq(ltm.getUsedTheme("chinese0").name, "中文0");
-  do_check_eq(ltm.getUsedTheme("chinese0").description, "中文1");
-
-  // This name used to break the usedTheme JSON causing all LWTs to be lost
-  var chineseTheme1 = dummy("chinese1");
-  chineseTheme1.name = "植物大战僵尸~最爱";
-  chineseTheme1.description = "植物大战僵尸~最爱";
-  ltm.currentTheme = chineseTheme1;
-  do_check_neq(ltm.currentTheme, null);
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.name, "植物大战僵尸~最爱");
-  do_check_eq(ltm.currentTheme.description, "植物大战僵尸~最爱");
-  do_check_eq(ltm.usedThemes[1].name, "中文0");
-  do_check_eq(ltm.usedThemes[1].description, "中文1");
-  do_check_eq(ltm.usedThemes[0].name, "植物大战僵尸~最爱");
-  do_check_eq(ltm.usedThemes[0].description, "植物大战僵尸~最爱");
-
-  ltm.forgetUsedTheme("chinese0");
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_neq(ltm.currentTheme, null);
-
-  ltm.forgetUsedTheme("chinese1");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  do_check_eq(ltm.parseTheme("invalid json"), null);
-  do_check_eq(ltm.parseTheme('"json string"'), null);
-
-  function roundtrip(data, secure) {
-    return ltm.parseTheme(JSON.stringify(data),
-                          "http" + (secure ? "s" : "") + "://lwttest.invalid/");
-  }
-
-  var data = dummy();
-  do_check_neq(roundtrip(data), null);
-  data.id = null;
-  do_check_eq(roundtrip(data), null);
-  data.id = 1;
-  do_check_eq(roundtrip(data), null);
-  data.id = 1.5;
-  do_check_eq(roundtrip(data), null);
-  data.id = true;
-  do_check_eq(roundtrip(data), null);
-  data.id = {};
-  do_check_eq(roundtrip(data), null);
-  data.id = [];
-  do_check_eq(roundtrip(data), null);
-
-  // Check whether parseTheme handles international characters right
-  var chineseTheme2 = dummy();
-  chineseTheme2.name = "植物大战僵尸~最爱";
-  chineseTheme2.description = "植物大战僵尸~最爱";
-  do_check_neq(roundtrip(chineseTheme2), null);
-  do_check_eq(roundtrip(chineseTheme2).name, "植物大战僵尸~最爱");
-  do_check_eq(roundtrip(chineseTheme2).description, "植物大战僵尸~最爱");
-
-  data = dummy();
-  data.unknownProperty = "Foo";
-  do_check_eq(typeof roundtrip(data).unknownProperty, "undefined");
-
-  data = dummy();
-  data.unknownURL = "http://lwttest.invalid/";
-  do_check_eq(typeof roundtrip(data).unknownURL, "undefined");
-
-  function roundtripSet(props, modify, test, secure) {
-    props.forEach(function (prop) {
-      var data = dummy();
-      modify(data, prop);
-      test(roundtrip(data, secure), prop, data);
-    });
-  }
-
-  roundtripSet(MANDATORY, function (data, prop) {
-    delete data[prop];
-  }, function (after) {
-    do_check_eq(after, null);
-  });
-
-  roundtripSet(OPTIONAL, function (data, prop) {
-    delete data[prop];
-  }, function (after) {
-    do_check_neq(after, null);
-  });
-
-  roundtripSet(MANDATORY, function (data, prop) {
-    data[prop] = "";
-  }, function (after) {
-    do_check_eq(after, null);
-  });
-
-  roundtripSet(OPTIONAL, function (data, prop) {
-    data[prop] = "";
-  }, function (after, prop) {
-    do_check_eq(typeof after[prop], "undefined");
-  });
-
-  roundtripSet(MANDATORY, function (data, prop) {
-    data[prop] = " ";
-  }, function (after) {
-    do_check_eq(after, null);
-  });
-
-  roundtripSet(OPTIONAL, function (data, prop) {
-    data[prop] = " ";
-  }, function (after, prop) {
-    do_check_neq(after, null);
-    do_check_eq(typeof after[prop], "undefined");
-  });
-
-  function non_urls(props) {
-    return props.filter(function (prop) !/URL$/.test(prop));
-  }
-
-  function urls(props) {
-    return props.filter(function (prop) /URL$/.test(prop));
-  }
-
-  roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
-    data[prop] = prop;
-  }, function (after, prop, before) {
-    do_check_eq(after[prop], before[prop]);
-  });
-
-  roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
-    data[prop] = " " + prop + "  ";
-  }, function (after, prop, before) {
-    do_check_eq(after[prop], before[prop].trim());
-  });
-
-  roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
-    data[prop] = Math.random().toString();
-  }, function (after, prop, before) {
-    if (prop == "updateURL")
-      do_check_eq(typeof after[prop], "undefined");
-    else
-      do_check_eq(after[prop], "http://lwttest.invalid/" + before[prop]);
-  });
-
-  roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
-    data[prop] = Math.random().toString();
-  }, function (after, prop, before) {
-    do_check_eq(after[prop], "https://lwttest.invalid/" + before[prop]);
-  }, true);
-
-  roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
-    data[prop] = "https://sub.lwttest.invalid/" + Math.random().toString();
-  }, function (after, prop, before) {
-    do_check_eq(after[prop], before[prop]);
-  });
-
-  roundtripSet(urls(MANDATORY), function (data, prop) {
-    data[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
-  }, function (after) {
-    do_check_eq(after, null);
-  });
-
-  roundtripSet(urls(OPTIONAL), function (data, prop) {
-    data[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
-  }, function (after, prop) {
-    do_check_eq(typeof after[prop], "undefined");
-  });
-
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  data = dummy();
-  delete data.name;
-  try {
-    ltm.currentTheme = data;
-    do_throw("Should have rejected a theme with no name");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  data = dummy();
-  data.headerURL = "foo";
-  try {
-    ltm.currentTheme = data;
-    do_throw("Should have rejected a theme with a bad headerURL");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  data = dummy();
-  data.headerURL = "ftp://lwtest.invalid/test.png";
-  try {
-    ltm.currentTheme = data;
-    do_throw("Should have rejected a theme with a non-http(s) headerURL");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  data = dummy();
-  data.headerURL = "file:///test.png";
-  try {
-    ltm.currentTheme = data;
-    do_throw("Should have rejected a theme with a non-http(s) headerURL");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  data = dummy();
-  data.updateURL = "file:///test.json";
-  ltm.setLocalTheme(data);
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.updateURL, undefined);
-  ltm.forgetUsedTheme(ltm.currentTheme.id);
-  do_check_eq(ltm.usedThemes.length, 0);
-
-  data = dummy();
-  data.headerURL = "file:///test.png";
-  ltm.setLocalTheme(data);
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_eq(ltm.currentTheme.headerURL, "file:///test.png");
-  ltm.forgetUsedTheme(ltm.currentTheme.id);
-  do_check_eq(ltm.usedThemes.length, 0);
-
-  data = dummy();
-  data.headerURL = "ftp://lwtest.invalid/test.png";
-  try {
-    ltm.setLocalTheme(data);
-    do_throw("Should have rejected a theme with a non-http(s), non-file headerURL");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  data = dummy();
-  delete data.id;
-  try {
-    ltm.currentTheme = data;
-    do_throw("Should have rejected a theme with no ID");
-  }
-  catch (e) {
-    // Expected exception
-  }
-
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  // Force the theme into the prefs anyway
-  let prefs = Cc["@mozilla.org/preferences-service;1"].
-              getService(Ci.nsIPrefBranch);
-  let themes = [data];
-  prefs.setCharPref("lightweightThemes.usedThemes", JSON.stringify(themes));
-  do_check_eq(ltm.usedThemes.length, 1);
-
-  // This should silently drop the bad theme.
-  ltm.currentTheme = dummy();
-  do_check_eq(ltm.usedThemes.length, 1);
-  ltm.forgetUsedTheme(ltm.currentTheme.id);
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  // Add one broken and some working.
-  themes = [data, dummy("x1"), dummy("x2")];
-  prefs.setCharPref("lightweightThemes.usedThemes", JSON.stringify(themes));
-  do_check_eq(ltm.usedThemes.length, 3);
-
-  // Switching to an existing theme should drop the bad theme.
-  ltm.currentTheme = ltm.getUsedTheme("x1");
-  do_check_eq(ltm.usedThemes.length, 2);
-  ltm.forgetUsedTheme("x1");
-  ltm.forgetUsedTheme("x2");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  prefs.setCharPref("lightweightThemes.usedThemes", JSON.stringify(themes));
-  do_check_eq(ltm.usedThemes.length, 3);
-
-  // Forgetting an existing theme should drop the bad theme.
-  ltm.forgetUsedTheme("x1");
-  do_check_eq(ltm.usedThemes.length, 1);
-  ltm.forgetUsedTheme("x2");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-
-  // Test whether a JSON set with setCharPref can be retrieved with usedThemes
-  ltm.currentTheme = dummy("x0");
-  ltm.currentTheme = dummy("x1");
-  prefs.setCharPref("lightweightThemes.usedThemes", JSON.stringify(ltm.usedThemes));
-  do_check_eq(ltm.usedThemes.length, 2);
-  do_check_eq(ltm.currentTheme.id, "x1");
-  do_check_eq(ltm.usedThemes[1].id, "x0");
-  do_check_eq(ltm.usedThemes[0].id, "x1");
-
-  ltm.forgetUsedTheme("x0");
-  do_check_eq(ltm.usedThemes.length, 1);
-  do_check_neq(ltm.currentTheme, null);
-
-  ltm.forgetUsedTheme("x1");
-  do_check_eq(ltm.usedThemes.length, 0);
-  do_check_eq(ltm.currentTheme, null);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug257155.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
-const PREF_SELECTED_LOCALE = "general.useragent.locale";
-
-const ADDON = "test_bug257155";
-const ID = "bug257155@tests.mozilla.org";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  gPrefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
-
-  // Install test add-on
-  startupEM();
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr-FR Name");
-  restartEM();
-
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr-FR Name");
-  do_check_eq(getManifestProperty(ID, "description"), "fr-FR Description");
-  
-  // Disable item
-  gEM.disableItem(ID);
-  restartEM();
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr-FR Name");
-  
-  // Change locale
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "de-DE");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "de-DE Name");
-  do_check_eq(getManifestProperty(ID, "description"), "");
-  
-  // Change to a locale not provided by the add-on
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "nl-NL");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "Fallback Name");
-  
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug299716.js
+++ /dev/null
@@ -1,458 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Alexander J. Vincent <ajvincent@gmail.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-// This allows the EM to attempt to display errors to the user without failing.
-var promptService = {
-  // nsIPromptService
-  alert: function alert(aParent,
-                        aDialogTitle,
-                        aText) {
-    const title = "Bug 299716 test ";
-    var keyChar = aText.charAt(title.length).toLowerCase();
-    var id = "bug299716-" + keyChar + "@tests.mozilla.org";
-    for (var i = 0; i < ADDONS.length; i++) {
-      if (ADDONS[i].id != id) {
-        continue;
-      }
-
-      do_check_false(ADDONS[i].installed);
-      break;
-    }
-  },
-
-  // nsIPromptService
-  alertCheck: function alertCheck(aParent,
-                                  aDialogTitle,
-                                  aText,
-                                  aCheckMsg,
-                                  aCheckState) {
-    do_throw("Unexpected call to alertCheck!");
-  },
-
-  // nsIPromptService
-  confirm: function confirm(aParent,
-                            aDialogTitle,
-                            aText) {
-    do_throw("Unexpected call to confirm!");
-  },
-
-  // nsIPromptService
-  confirmCheck: function confirmCheck(aParent,
-                                      aDialogTitle,
-                                      aText,
-                                      aCheckMsg,
-                                      aCheckState) {
-    do_throw("Unexpected call to confirmCheck!");
-  },
-
-  // nsIPromptService
-  confirmEx: function confirmEx(aParent,
-                                aDialogTitle,
-                                aText,
-                                aButtonFlags,
-                                aButton0Title,
-                                aButton1Title,
-                                aButton2Title,
-                                aCheckMsg,
-                                aCheckState) {
-    do_throw("Unexpected call to confirmEx!");
-  },
-
-  // nsIPromptService
-  prompt: function prompt(aParent,
-                          aDialogTitle,
-                          aText,
-                          aValue,
-                          aCheckMsg,
-                          aCheckState) {
-    do_throw("Unexpected call to prompt!");
-  },
-
-  // nsIPromptService
-  promptUsernameAndPassword:
-  function promptUsernameAndPassword(aParent,
-                                     aDialogTitle,
-                                     aText,
-                                     aUsername,
-                                     aPassword,
-                                     aCheckMsg,
-                                     aCheckState) {
-    do_throw("Unexpected call to promptUsernameAndPassword!");
-  },
-
-  // nsIPromptService
-  promptPassword: function promptPassword(aParent,
-                                          aDialogTitle,
-                                          aText,
-                                          aPassword,
-                                          aCheckMsg,
-                                          aCheckState) {
-    do_throw("Unexpected call to promptPassword!");
-  },
-
-  // nsIPromptService
-  select: function select(aParent,
-                          aDialogTitle,
-                          aText,
-                          aCount,
-                          aSelectList,
-                          aOutSelection) {
-    do_throw("Unexpected call to select!");
-  },
-
-  // nsISupports
-  QueryInterface: function QueryInterface(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function createInstance(outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
-var registrar = Components.manager.QueryInterface(nsIComponentRegistrar);
-const psID = Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}");
-registrar.registerFactory(psID,
-                          "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1",
-                          PromptServiceFactory);
-
-const installListener = {
-  // nsIAddonInstallListener
-  onDownloadStarted: function(aAddon) {
-    // do nothing.
-  },
-
-  onDownloadEnded: function(aAddon) {
-    // do nothing.
-  },
-
-  onInstallStarted: function(aAddon) {
-    // do nothing.
-  },
-
-  onCompatibilityCheckStarted: function(aAddon) {
-    // do nothing.
-  },
-
-  onCompatibilityCheckEnded: function(aAddon, aStatus) {
-    // do nothing.
-  },
-
-  onInstallEnded: function(aAddon, aStatus) {
-    // do nothing.
-  },
-
-  onInstallsCompleted: function() {
-    next_test();
-  },
-
-  onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
-    // do nothing.
-  }
-};
-
-// Update check listener.
-const checkListener = {
-  // nsIAddonUpdateCheckListener
-  onUpdateStarted: function onUpdateStarted() {
-    // do nothing
-  },
-
-  // nsIAddonUpdateCheckListener
-  onUpdateEnded: function onUpdateEnded() {
-    next_test();
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon) {
-    // do nothing
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
-    for (var i = 0; i < ADDONS.length; i++) {
-      if (ADDONS[i].id == aAddon.id) {
-        ADDONS[i].newItem = aAddon;
-        return;
-      }
-    }
-  }
-}
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-var updateItems = [];
-
-// Configure test.
-const DELAY = 2000;
-
-var ADDONS = [
-  // XPCShell
-  {
-    id: "bug299716-a@tests.mozilla.org",
-    addon: "test_bug299716_a_1",
-    installed: true,
-    item: null,
-    newItem: null
-  },
-
-  // Toolkit
-  {
-    id: "bug299716-b@tests.mozilla.org",
-    addon: "test_bug299716_b_1",
-    installed: true,
-    item: null,
-    newItem: null
-  },
-
-  // XPCShell + Toolkit
-  {
-    id: "bug299716-c@tests.mozilla.org",
-    addon: "test_bug299716_c_1",
-    installed: true,
-    item: null,
-    newItem: null
-  },
-
-  // XPCShell (Toolkit invalid)
-  {
-    id: "bug299716-d@tests.mozilla.org",
-    addon: "test_bug299716_d_1",
-    installed: true,
-    item: null,
-    newItem: null
-  },
-
-  // Toolkit (XPCShell invalid)
-  {
-    id: "bug299716-e@tests.mozilla.org",
-    addon: "test_bug299716_e_1",
-    installed: false,
-    item: null,
-    newItem: null,
-    failedAppName: "XPCShell"
-  },
-
-  // None (XPCShell, Toolkit invalid)
-  {
-    id: "bug299716-f@tests.mozilla.org",
-    addon: "test_bug299716_f_1",
-    installed: false,
-    item: null,
-    newItem: null,
-    failedAppName: "XPCShell"
-  },
-
-  // None (Toolkit invalid)
-  {
-    id: "bug299716-g@tests.mozilla.org",
-    addon: "test_bug299716_g_1",
-    installed: false,
-    item: null,
-    newItem: null,
-    failedAppName: "Toolkit"
-  },
-];
-
-var currentAddonObj = null;
-var next_test = function() {};
-
-function do_check_item(aItem, aVersion, aAddonsEntry) {
-  if (aAddonsEntry.installed) {
-    if (aItem == null)
-      do_throw("Addon " + aAddonsEntry.id + " wasn't detected");
-    if (aItem.version != aVersion)
-      do_throw("Addon " + aAddonsEntry.id + " was version " + aItem.version + " instead of " + aVersion);
-  } else {
-    if (aItem != null)
-      do_throw("Addon " + aAddonsEntry.id + " was detected");
-  }
-}
-
-/**
- * Start the test by installing extensions.
- */
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "5", "1.9");
-
-  const dataDir = do_get_file("data");
-  const addonsDir = do_get_addon(ADDONS[0].addon).parent;
-
-  // Make sure we can actually get our data files.
-  const xpiFile = addonsDir.clone();
-  xpiFile.append("test_bug299716_a_2.xpi");
-  do_check_true(xpiFile.exists());
-
-  // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
-  testserver.registerDirectory("/addons/", addonsDir);
-  testserver.registerDirectory("/data/", dataDir);
-  testserver.start(4444);
-
-  // Make sure we can fetch the files over HTTP.
-  const Ci = Components.interfaces;
-  const xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
-                        .createInstance(Ci.nsIXMLHttpRequest)
-  xhr.open("GET", "http://localhost:4444/addons/test_bug299716_a_2.xpi", false);
-  xhr.send(null);
-  do_check_true(xhr.status == 200);
-
-  xhr.open("GET", "http://localhost:4444/data/test_bug299716.rdf", false);
-  xhr.send(null);
-  do_check_true(xhr.status == 200);
-
-  // Start the real test.
-  startupEM();
-  dump("\n\n*** INSTALLING NEW ITEMS\n\n");
-
-  for (var i = 0; i < ADDONS.length; i++) {
-    gEM.installItemFromFile(do_get_addon(ADDONS[i].addon),
-                            NS_INSTALL_LOCATION_APPPROFILE);
-  }
-  dump("\n\n*** DONE INSTALLING NEW ITEMS\n\n");
-
-  do_test_pending();
-
-  // Give time for phone home to complete.
-  do_timeout(DELAY, run_test_pt2);
-}
-
-/**
- * Check the versions of all items, and ask the extension manager to find updates.
- */
-function run_test_pt2() {
-  dump("\n\n*** RESTARTING EXTENSION MANAGER\n\n");
-  restartEM();
-
-  // Try to update the items.
-  for (var i = 0; i < ADDONS.length; i++) {
-    var item = gEM.getItemForID(ADDONS[i].id);
-    do_check_item(item, "0.1", ADDONS[i]);
-    ADDONS[i].item = item;
-    updateItems[updateItems.length] = item;
-  }
-
-  dump("\n\n*** REQUESTING UPDATE\n\n");
-  // checkListener will call run_test_pt3().
-  next_test = run_test_pt3;
-  try {
-    gEM.update(updateItems,
-               updateItems.length,
-               Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION,
-               checkListener);
-    do_throw("Shouldn't reach here!");
-  } catch (e if (e instanceof Components.interfaces.nsIException &&
-                 e.result == Components.results.NS_ERROR_ILLEGAL_VALUE)) {
-    // do nothing, this is good
-  }
-
-  var addonsArray = [];
-  for (var i = 0; i < ADDONS.length; i++) {
-    if (ADDONS[i].item) {
-      addonsArray.push(ADDONS[i].item);
-    }
-  }
-  gEM.update(addonsArray,
-             addonsArray.length,
-             Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION,
-             checkListener);
-}
-
-/**
- * Install new items for each enabled extension.
- */
-function run_test_pt3() {
-  // Install the new items.
-  var addonsArray = [];
-  for (var i = 0; i < ADDONS.length; i++) {
-    addonsArray.push(ADDONS[i].newItem);
-  }
-  dump("\n\n*** UPDATING " + addonsArray.length + " ITEMS\n\n");
-
-  // installListener will call run_test_pt4().
-  next_test = run_test_pt4;
-
-  // Here, we have some bad items that try to update.  Pepto-Bismol time.
-  try {
-    gEM.addDownloads(addonsArray, addonsArray.length, null);
-    do_throw("Shouldn't reach here!");
-  } catch (e if (e instanceof Components.interfaces.nsIException &&
-                 e.result == Components.results.NS_ERROR_ILLEGAL_VALUE)) {
-    // do nothing, this is good
-  }
-
-  for (i = addonsArray.length - 1; i >= 0; i--) {
-    if (!addonsArray[i]) {
-      addonsArray.splice(i, 1);
-    }
-  }
-
-  gEM.addInstallListener(installListener);
-
-  do_check_true(addonsArray.length > 0);
-  gEM.addDownloads(addonsArray, addonsArray.length, null);
-}
-
-/**
- * Check the final version of each extension.
- */
-function run_test_pt4() {
-  dump("\n\n*** RESTARTING EXTENSION MANAGER\n\n");
-  restartEM();
-
-  dump("\n\n*** FINAL CHECKS\n\n");
-  for (var i = 0; i < ADDONS.length; i++) {
-    var item = gEM.getItemForID(ADDONS[i].id);
-    do_check_item(item, "0.2", ADDONS[i]);
-  }
-
-  testserver.stop(do_test_finished);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug299716_2.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@mozilla.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-// Update check listener.
-const checkListener = {
-  // nsIAddonUpdateCheckListener
-  onUpdateStarted: function onUpdateStarted() {
-  },
-
-  // nsIAddonUpdateCheckListener
-  onUpdateEnded: function onUpdateEnded() {
-    var item = gEM.getItemForID(ADDON.id);
-    do_check_eq(item.version, 0.1);
-    do_check_eq(item.targetAppID, "xpcshell@tests.mozilla.org");
-    do_check_eq(item.minAppVersion, 1);
-    do_check_eq(item.maxAppVersion, 1);
-
-    testserver.stop(do_test_finished);
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon) {
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
-  }
-}
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-
-var ADDON = {
-  id: "bug299716-2@tests.mozilla.org",
-  addon: "test_bug299716_2"
-};
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  const dataDir = do_get_file("data");
-  const addonsDir = do_get_addon(ADDON.addon).parent;
-
-  // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
-  testserver.registerDirectory("/addons/", addonsDir);
-  testserver.registerDirectory("/data/", dataDir);
-  testserver.start(4444);
-
-  startupEM();
-
-  // Should just install.
-  gEM.installItemFromFile(do_get_addon(ADDON.addon),
-                          NS_INSTALL_LOCATION_APPPROFILE);
-  restartEM();
-
-  var item = gEM.getItemForID(ADDON.id);
-  do_check_eq(item.version, 0.1);
-  do_check_eq(item.targetAppID, "xpcshell@tests.mozilla.org");
-  do_check_eq(item.minAppVersion, 1);
-  do_check_eq(item.maxAppVersion, 1);
-
-  do_test_pending();
-
-  gEM.update([item], 1,
-             Components.interfaces.nsIExtensionManager.UPDATE_SYNC_COMPATIBILITY,
-             checkListener);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug324121.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Robert Strong <robert.bugzilla@gmail.com>
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-
-var next_test = null;
-
-var gItemsNotCheck = [];
-
-var ADDONS = [ {id: "bug324121_1@tests.mozilla.org",
-                addon: "test_bug324121_1",
-                shouldCheck: false },
-               {id: "bug324121_2@tests.mozilla.org",
-                addon: "test_bug324121_2",
-                shouldCheck: true },
-               {id: "bug324121_3@tests.mozilla.org",
-                addon: "test_bug324121_3",
-                shouldCheck: true },
-               {id: "bug324121_4@tests.mozilla.org",
-                addon: "test_bug324121_4",
-                shouldCheck: true },
-               {id: "bug324121_5@tests.mozilla.org",
-                addon: "test_bug324121_5",
-                shouldCheck: false },
-               {id: "bug324121_6@tests.mozilla.org",
-                addon: "test_bug324121_6",
-                shouldCheck: true },
-               {id: "bug324121_7@tests.mozilla.org",
-                addon: "test_bug324121_7",
-                shouldCheck: true },
-               {id: "bug324121_8@tests.mozilla.org",
-                addon: "test_bug324121_8",
-                shouldCheck: true },
-               {id: "bug324121_9@tests.mozilla.org",
-                addon: "test_bug324121_9",
-                shouldCheck: false } ];
-
-// nsIAddonUpdateCheckListener
-var updateListener = {
-  onUpdateStarted: function onUpdateStarted() {
-  },
-
-  onUpdateEnded: function onUpdateEnded() {
-    // Verify that all items that should be checked have been checked.
-    do_check_eq(gItemsNotCheck.length, 0);
-    test_complete();
-  },
-
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon) {
-  },
-
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
-    var nsIAddonUpdateCheckListener = Ci.nsIAddonUpdateCheckListener;
-    switch (aAddon.id)
-    {
-      case "bug324121_1@tests.mozilla.org":
-        // add-on disabled - should not happen
-        do_throw("Update check for disabled add-on " + aAddon.id);
-        break;
-      case "bug324121_2@tests.mozilla.org":
-        // app id compatible update available
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-        break;
-      case "bug324121_3@tests.mozilla.org":
-        // app id incompatible update available
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_NO_UPDATE);
-        break;
-      case "bug324121_4@tests.mozilla.org":
-        // update rdf not found
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_FAILURE);
-        break;
-      case "bug324121_5@tests.mozilla.org":
-        // app id already compatible - should not happen
-        do_throw("Update check for compatible add-on " + aAddon.id);
-        break;
-      case "bug324121_6@tests.mozilla.org":
-        // toolkit id compatible update available
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-        break;
-      case "bug324121_7@tests.mozilla.org":
-        // toolkit id incompatible update available
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_NO_UPDATE);
-        break;
-      case "bug324121_8@tests.mozilla.org":
-        // update rdf not found
-        do_check_eq(aStatus, nsIAddonUpdateCheckListener.STATUS_FAILURE);
-        break;
-      case "bug324121_9@tests.mozilla.org":
-        // toolkit id already compatible - should not happen
-        do_throw("Update check for compatible add-on " + aAddon.id);
-        break;
-      default:
-        do_throw("Update check for unknown " + aAddon.id);
-    }
-
-    // pos should always be >= 0 so just let this throw if this fails
-    var pos = gItemsNotCheck.indexOf(aAddon.id);
-    gItemsNotCheck.splice(pos, 1);
-  }
-};
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
-
-  const dataDir = do_get_file("data");
-
-  // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
-  testserver.registerDirectory("/data/", dataDir);
-  testserver.start(4444);
-
-  startupEM();
-
-  var addons = ["test_bug324121_1"];
-  for (var k in ADDONS)
-    gEM.installItemFromFile(do_get_addon(ADDONS[k].addon),
-                            NS_INSTALL_LOCATION_APPPROFILE);
-
-  restartEM();
-  gEM.disableItem(ADDONS[0].id);
-  restartEM();
-
-  var items = gEM.getIncompatibleItemList("3", "3", Ci.nsIUpdateItem.TYPE_ANY,
-                                          false);
-
-  // Verify only items incompatible with the next app version are returned
-  for (var k in ADDONS) {
-    var found = false;
-    for (var i = 0; i < items.length; ++i) {
-      if (ADDONS[k].id == items[i].id) {
-        gItemsNotCheck.push(items[i].id);
-        found = true;
-        break;
-      }
-    }
-    do_check_true(ADDONS[k].shouldCheck == found);
-  }
-
-  gEM.update(items, items.length, Ci.nsIExtensionManager.UPDATE_NOTIFY_NEWVERSION,
-             updateListener, Ci.nsIExtensionManager.UPDATE_WHEN_USER_REQUESTED,
-             "3", "3");
-
-  do_test_pending();
-}
-
-function test_complete() {
-  testserver.stop(do_test_finished);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug335238.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
-const PREF_SELECTED_LOCALE = "general.useragent.locale";
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-do_load_httpd_js();
-
-// This is the data we expect to see sent as part of the update url.
-var EXPECTED = [
-  {
-    id: "bug335238_1@tests.mozilla.org",
-    version: "1.3.4",
-    maxAppVersion: "5",
-    status: "userEnabled",
-    appId: "xpcshell@tests.mozilla.org",
-    appVersion: "1",
-    appOs: "XPCShell",
-    appAbi: "noarch-spidermonkey",
-    locale: "en-US",
-    reqVersion: "2"
-  },
-  {
-    id: "bug335238_2@tests.mozilla.org",
-    version: "28at",
-    maxAppVersion: "7",
-    status: "userDisabled,needsDependencies",
-    appId: "xpcshell@tests.mozilla.org",
-    appVersion: "1",
-    appOs: "XPCShell",
-    appAbi: "noarch-spidermonkey",
-    locale: "en-US",
-    reqVersion: "2"
-  }
-];
-
-var ADDONS = [
-  {id: "bug335238_1@tests.mozilla.org",
-   addon: "test_bug335238_1"},
-  {id: "bug335238_2@tests.mozilla.org",
-   addon: "test_bug335238_2"}
-];
-
-var server;
-
-var updateListener = {
-  onUpdateStarted: function()
-  {
-  },
-  
-  onUpdateEnded: function()
-  {
-    server.stop(do_test_finished);
-  },
-  
-  onAddonUpdateStarted: function(addon)
-  {
-  },
-  
-  onAddonUpdateEnded: function(addon, status)
-  {
-    // No update rdf will get found so this should be a failure.
-    do_check_eq(status, Ci.nsIAddonUpdateCheckListener.STATUS_FAILURE);
-  }
-}
-
-var requestHandler = {
-  handle: function(metadata, response)
-  {
-    var expected = EXPECTED[metadata.path.substring(1)];
-    var params = metadata.queryString.split("&");
-    do_check_eq(params.length, 10);
-    for (var k in params) {
-      var pair = params[k].split("=");
-      var name = decodeURIComponent(pair[0]);
-      var value = decodeURIComponent(pair[1]);
-      do_check_eq(expected[name], value);
-    }
-    response.setStatusLine(metadata.httpVersion, 404, "Not Found");
-  }
-}
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-  
-  gPrefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "en-US");
-
-  startupEM();
-  for (var k in ADDONS)
-    gEM.installItemFromFile(do_get_addon(ADDONS[k].addon),
-                            NS_INSTALL_LOCATION_APPPROFILE);
-
-  restartEM();
-  gEM.disableItem(ADDONS[1].id);
-  restartEM();
-
-  var updates = [];
-  for (var k in ADDONS) {
-    do_check_neq(gEM.getInstallLocation(ADDONS[k].id), null);
-    var addon = gEM.getItemForID(ADDONS[k].id);
-    updates.push(addon);
-  }
-
-  server = new nsHttpServer();
-  server.registerPathHandler("/0", requestHandler);
-  server.registerPathHandler("/1", requestHandler);
-  server.start(4444);
-  
-  gEM.update(updates, updates.length, false, updateListener);
-
-  do_test_pending();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug371495.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
-const PREF_SELECTED_LOCALE = "general.useragent.locale";
-
-const ADDON = "test_bug371495";
-const ID = "bug371495@tests.mozilla.org";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-
-  // Install test add-on
-  startupEM();
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "Test theme");
-  restartEM();
-
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(getManifestProperty(ID, "optionsURL"), "");
-  do_check_eq(getManifestProperty(ID, "aboutURL"), "");
-
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug378216.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-/**
- * Tests for update security restrictions.
- *
- * Install tests:
- *
- * Test     updateKey   updateURL   expected
- *-------------------------------------------
- * 1        absent      absent      success
- * 2        absent      http        failure
- * 3        absent      https       success
- * 4        present     absent      success
- * 5        present     http        success
- * 6        present     https       success
- *
- * Update tests:
- *
- * Test     signature   updateHash  updateLink   expected
- *--------------------------------------------------------
- * 5        absent      absent      http         fail
- * 7        broken      absent      http         fail
- * 8        correct     absent      http         no update
- * 9        correct     sha1        http         update
- * 10       corrent     absent      https        update
- * 11       corrent     sha1        https        update
- * 12       corrent     md2         http         no update
- * 13       corrent     md2         https        update
- */
-
-do_load_httpd_js();
-var server;
-
-// This allows the EM to attempt to display errors to the user without failing
-var promptService = {
-  alert: function(aParent, aDialogTitle, aText) {
-  },
-  
-  alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirm: function(aParent, aDialogTitle, aText) {
-  },
-  
-  confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
-  },
-  
-  prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
-  },
-  
-  promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
-  },
-  
-  select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
-  },
-  
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-  
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}"), "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1", PromptServiceFactory);
-
-
-var updateListener = {
-onUpdateStarted: function()
-{
-},
-
-onUpdateEnded: function()
-{
-  server.stop(do_test_finished);
-},
-
-onAddonUpdateStarted: function(addon)
-{
-},
-
-onAddonUpdateEnded: function(addon, status)
-{
-  var nsIAddonUpdateCheckListener = Components.interfaces.nsIAddonUpdateCheckListener;
-  switch (addon.id)
-  {
-    case "test_bug378216_5@tests.mozilla.org":
-      // Update has no signature
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_FAILURE);
-      break;
-    case "test_bug378216_7@tests.mozilla.org":
-      // Update has a signature that does not match
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_FAILURE);
-      break;
-    case "test_bug378216_8@tests.mozilla.org":
-      // Update has a signature but no secure update
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_NO_UPDATE);
-      break;
-    case "test_bug378216_9@tests.mozilla.org":
-      // Update has a signature and a hashed update
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-      do_check_eq(addon.version, "2.0");
-      break;
-    case "test_bug378216_10@tests.mozilla.org":
-      // Update has a signature and a https update
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-      do_check_eq(addon.version, "2.0");
-      break;
-    case "test_bug378216_11@tests.mozilla.org":
-      // Update has a signature and a hashed https update
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-      do_check_eq(addon.version, "2.0");
-      break;
-    case "test_bug378216_12@tests.mozilla.org":
-      // Update has a signature and an insecure hash against the update
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_NO_UPDATE);
-      break;
-    case "test_bug378216_13@tests.mozilla.org":
-      // The insecure hash doesn't matter if we have an https link
-      do_check_eq(status, nsIAddonUpdateCheckListener.STATUS_UPDATE);
-      do_check_eq(addon.version, "2.0");
-      break;
-    default:
-      do_throw("Update check for unknown "+addon.id);
-  }
-}
-}
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  startupEM();
-  gEM.installItemFromFile(do_get_addon("test_bug378216_1"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_2"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_3"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_4"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_5"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_6"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_7"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_8"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_9"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_10"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_11"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_12"), NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug378216_13"), NS_INSTALL_LOCATION_APPPROFILE);
-  
-  restartEM();
-  
-  do_check_neq(gEM.getItemForID("test_bug378216_1@tests.mozilla.org"), null);
-  // Test 2 has an insecure updateURL and no updateKey so should fail to install
-  do_check_eq(gEM.getItemForID("test_bug378216_2@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_3@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_4@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_5@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_6@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_7@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_8@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_9@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_10@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_11@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_12@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("test_bug378216_13@tests.mozilla.org"), null);
-
-  server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("data"));
-  server.start(4444);
-  
-  var updates = [
-    gEM.getItemForID("test_bug378216_5@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_7@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_8@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_9@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_10@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_11@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_12@tests.mozilla.org"),
-    gEM.getItemForID("test_bug378216_13@tests.mozilla.org"),
-  ];
-  
-  gEM.update(updates, updates.length,
-             Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION,
-             updateListener);
-  do_test_pending();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug384052.js
+++ /dev/null
@@ -1,100 +0,0 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const CLASS_ID = Components.ID("{12345678-1234-1234-1234-123456789abc}");
-const CONTRACT_ID = "@mozilla.org/test-parameter-source;1";
-
-var gTestURL = "http://127.0.0.1:4444/?itemID=%ITEM_ID%&custom1=%CUSTOM1%&custom2=%CUSTOM2%";
-var gExpectedURL = null;
-var gSeenExpectedURL = false;
-
-var gComponentRegistrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-var gObserverService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
-var gCategoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
-
-// Factory for our parameter handler
-var paramHandlerFactory = {
-  QueryInterface: function(iid) {
-    if (iid.equals(Ci.nsIFactory) || iid.equals(Ci.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  createInstance: function(outer, iid) {
-    var bag = Cc["@mozilla.org/hash-property-bag;1"]
-                .createInstance(Ci.nsIWritablePropertyBag);
-    bag.setProperty("CUSTOM1", "custom_parameter_1");
-    bag.setProperty("CUSTOM2", "custom_parameter_2");
-    return bag.QueryInterface(iid);
-  }
-};
-
-// Observer that should recognize when extension manager requests our URL
-var observer = {
-  QueryInterface: function(iid) {
-    if (iid.equals(Ci.nsIObserver) || iid.equals(Ci.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  observe: function(subject, topic, data) {
-    if (topic == "http-on-modify-request") {
-      var channel = subject.QueryInterface(Ci.nsIChannel);
-      if (channel.originalURI.spec == gExpectedURL)
-        gSeenExpectedURL = true;
-    }
-  }
-}
-
-function initTest()
-{
-  // Setup extension manager
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-  startupEM();
-
-  // Register our parameter handlers
-  gComponentRegistrar.registerFactory(CLASS_ID, "Test component", CONTRACT_ID, paramHandlerFactory);
-  gCategoryManager.addCategoryEntry("extension-update-params", "CUSTOM1", CONTRACT_ID, false, false);
-  gCategoryManager.addCategoryEntry("extension-update-params", "CUSTOM2", CONTRACT_ID, false, false);
-
-  // Register observer to get notified when URLs are requested
-  gObserverService.addObserver(observer, "http-on-modify-request", false);
-}
-
-function shutdownTest()
-{
-  shutdownEM();
-
-  gComponentRegistrar.unregisterFactory(CLASS_ID, paramHandlerFactory);
-  gCategoryManager.deleteCategoryEntry("extension-update-params", "CUSTOM1", false);
-  gCategoryManager.deleteCategoryEntry("extension-update-params", "CUSTOM2", false);
-
-  gObserverService.removeObserver(observer, "http-on-modify-request");
-}
-
-function run_test()
-{
-  initTest();
-
-  var item = Cc["@mozilla.org/updates/item;1"].createInstance(Ci.nsIUpdateItem);
-  item.init("test@mozilla.org", "1.0", "app-profile", "0.0", "100.0", "Test extension",
-            null, null, "", null, null, item.TYPE_EXTENSION, "xpcshell@tests.mozilla.org");
-
-  gExpectedURL = gTestURL.replace(/%ITEM_ID%/, item.id)
-                         .replace(/%CUSTOM1%/, "custom_parameter_1")
-                         .replace(/%CUSTOM2%/, "custom_parameter_2");
-
-  // Replace extension update URL
-  gPrefs.setCharPref("extensions.update.url", gTestURL);
-
-  // Initiate update
-  gEM.update([item], 1, Ci.nsIExtensionManager.UPDATE_SYNC_COMPATIBILITY, null);
-
-  do_check_true(gSeenExpectedURL);
-
-  gPrefs.clearUserPref("extensions.update.url");
-
-  shutdownTest();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug386153.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *   Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const URI_XPINSTALL_CONFIRM_DIALOG = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
-
-// Finds the index of the given xpi in the dialogparamblock strings
-function findXPI(dpb, name) {
-  for (var i = 0; i < 5; i++) {
-    if (dpb.GetString(i * 4 + 1).substr(-(name.length + 1)) == "/" + name)
-      return i * 4;
-  }
-  do_throw(name + " wasn't in the list");
-  return 0;
-}
-
-// Called to display the XPInstall dialog
-var WindowWatcher = {
-  openWindow: function(parent, url, name, features, arguments) {
-    do_check_eq(url, URI_XPINSTALL_CONFIRM_DIALOG);
-    var dpb = arguments.QueryInterface(Ci.nsISupportsInterfacePointer)
-                       .data.QueryInterface(Ci.nsIDialogParamBlock);
-    do_check_eq(dpb.GetInt(1), 20);
-
-    // Not defined what order they will be in so find them based on the filename
-    var unsigned = findXPI(dpb, "unsigned.xpi");
-    var signed = findXPI(dpb, "signed.xpi");
-    var untrusted = findXPI(dpb, "signed-untrusted.xpi");
-    var no_o = findXPI(dpb, "signed-no-o.xpi");
-    var no_cn = findXPI(dpb, "signed-no-cn.xpi");
-
-    // Test the names and certs are correct
-    do_check_eq(dpb.GetString(unsigned), "XPI Test");
-    do_check_eq(dpb.GetString(unsigned + 3), "");
-
-    do_check_eq(dpb.GetString(signed), "Signed XPI Test");
-    do_check_eq(dpb.GetString(signed + 3), "Object Signer");
-    do_check_eq(dpb.GetString(no_o), "Signed XPI Test (No Org)");
-    do_check_eq(dpb.GetString(no_o + 3), "Object Signer");
-    do_check_eq(dpb.GetString(no_cn), "Signed XPI Test (No Common Name)");
-    do_check_eq(dpb.GetString(no_cn + 3), "Mozilla Testing");
-
-    // XPIs signed by an unknown CA just appear to not be signed at all
-    do_check_eq(dpb.GetString(untrusted), "Signed XPI Test - Untrusted");
-    do_check_eq(dpb.GetString(untrusted + 3), "");
-
-    // Confirm the install
-    dpb.SetInt(0, 0);
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Ci.nsIWindowWatcher)
-     || iid.equals(Ci.nsISupports))
-      return this;
-
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  }
-}
-
-var WindowWatcherFactory = {
-  createInstance: function createInstance(outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return WindowWatcher.QueryInterface(iid);
-  }
-};
-
-var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
-                          "Fake Window Watcher",
-                          "@mozilla.org/embedcomp/window-watcher;1", WindowWatcherFactory);
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-
-  // Copy the certificate db to the profile
-  do_get_file("data/cert8.db").copyTo(gProfD, null);
-  do_get_file("data/key3.db").copyTo(gProfD, null);
-  do_get_file("data/secmod.db").copyTo(gProfD, null);
-
-  // Copy the test add-ons into the install location
-  var il = gProfD.clone();
-  il.append("extensions");
-  if (!il.exists())
-    il.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
-  do_get_file("data/unsigned.xpi").copyTo(il, null);
-  do_get_file("data/signed.xpi").copyTo(il, null);
-  do_get_file("data/signed-untrusted.xpi").copyTo(il, null);
-  do_get_file("data/signed-tampered.xpi").copyTo(il, null);
-  do_get_file("data/signed-no-o.xpi").copyTo(il, null);
-  do_get_file("data/signed-no-cn.xpi").copyTo(il, null);
-
-  // Starting the EM will detect and attempt to install the xpis
-  startupEM();
-  do_check_neq(gEM.getItemForID("signed-xpi@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("unsigned-xpi@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("untrusted-xpi@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("tampered-xpi@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("signed-xpi-no-o@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("signed-xpi-no-cn@tests.mozilla.org"), null);
-
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug391899.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const ADDON = "test_bug257155";
-const ID = "bug257155@tests.mozilla.org";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  startupEM();
-  
-  // Install an extension
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.id, ID);
-  restartEM();
-
-  // Check after the restart
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.id, ID);
-
-  // Dummy extension should not exist
-  addon = gEM.getItemForID("test-dummy-extension@mozilla.org");
-  do_check_eq(addon, null);
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug392180.js
+++ /dev/null
@@ -1,148 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-do_load_httpd_js();
-
-var server;
-
-var updateListener = {
-  onUpdateStarted: function() {
-  },
-
-  onUpdateEnded: function() {
-    gNext();
-  },
-
-  onAddonUpdateStarted: function(addon) {
-  },
-
-  onAddonUpdateEnded: function(addon, status) {
-    // No update rdf will get found so this should be a failure.
-    do_check_eq(status, Ci.nsIAddonUpdateCheckListener.STATUS_FAILURE);
-  }
-}
-
-var requestHandler = {
-  handle: function(metadata, response) {
-    var updateType = metadata.queryString;
-    do_check_eq(updateType, gType);
-    response.setStatusLine(metadata.httpVersion, 404, "Not Found");
-  }
-}
-
-var gAddon;
-var gNext;
-var gType;
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  startupEM();
-  gEM.installItemFromFile(do_get_addon("test_bug392180"), NS_INSTALL_LOCATION_APPPROFILE);
-  restartEM();
-
-  gAddon = gEM.getItemForID("bug392180@tests.mozilla.org");
-  do_check_neq(gAddon, null);
-
-  server = new nsHttpServer();
-  server.registerPathHandler("/update.rdf", requestHandler);
-  server.start(4444);
-  do_test_pending();
-
-  run_test_1();
-}
-
-function end_test() {
-  server.stop(do_test_finished);
-}
-
-function run_test_1() {
-  // UPDATE_TYPE_COMPATIBILITY | UPDATE_TYPE_NEWVERSION;
-  gType = 96;
-  gNext = run_test_2;
-  gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_NEWVERSION, updateListener);
-}
-
-function run_test_2() {
-  // UPDATE_TYPE_COMPATIBILITY;
-  gType = 32;
-  gNext = run_test_3;
-  gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_COMPATIBILITY, updateListener);
-}
-
-function run_test_3() {
-  // UPDATE_TYPE_COMPATIBILITY | UPDATE_TYPE_NEWVERSION | UPDATE_WHEN_USER_REQUESTED;
-  gType = 97;
-  gNext = run_test_4;
-  gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_NEWVERSION, updateListener,
-             Ci.nsIExtensionManager.UPDATE_WHEN_USER_REQUESTED);
-}
-
-function run_test_4() {
-  // UPDATE_TYPE_COMPATIBILITY | UPDATE_TYPE_NEWVERSION | UPDATE_WHEN_NEW_APP_DETECTED;
-  gType = 98;
-  gNext = run_test_5;
-  gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_NEWVERSION, updateListener,
-             Ci.nsIExtensionManager.UPDATE_WHEN_NEW_APP_DETECTED);
-}
-
-function run_test_5() {
-  // UPDATE_TYPE_COMPATIBILITY | UPDATE_WHEN_NEW_APP_INSTALLED;
-  gType = 35;
-  gNext = run_test_6;
-  gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_COMPATIBILITY, updateListener,
-             Ci.nsIExtensionManager.UPDATE_WHEN_NEW_APP_INSTALLED);
-}
-
-function run_test_6() {
-  // UPDATE_TYPE_COMPATIBILITY;
-  gType = 35;
-  gNext = end_test;
-  try {
-    gEM.update([gAddon], 1, Ci.nsIExtensionManager.UPDATE_CHECK_COMPATIBILITY, updateListener,
-               16);
-    do_throw("Should have thrown an exception");
-  }
-  catch (e) {
-    do_check_eq(e.result, Components.results.NS_ERROR_ILLEGAL_VALUE);
-    end_test();
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug393285.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  // We cannot force the blocklist to update so just copy our test list to the profile
-  var source = do_get_file("data/test_bug393285.xml");
-  source.copyTo(gProfD, "blocklist.xml");
-
-  var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
-                            .getService(Components.interfaces.nsIBlocklistService);
-  
-  // No info in blocklist, shouldn't be blocked
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_1@tests.mozilla.org", "1", "1", "1.9"));
-
-  // Should always be blocked
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_2@tests.mozilla.org", "1", "1", "1.9"));
-
-  // Only version 1 should be blocked
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_3@tests.mozilla.org", "1", "1", "1.9"));
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_3@tests.mozilla.org", "2", "1", "1.9"));
-
-  // Should be blocked for app version 1
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_4@tests.mozilla.org", "1", "1", "1.9"));
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_4@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Not blocklisted because we are a different OS
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_5@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Blocklisted based on OS
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_6@tests.mozilla.org", "1", "2", "1.9"));
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_7@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Not blocklisted because we are a different ABI
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_8@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Blocklisted based on ABI
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_9@tests.mozilla.org", "1", "2", "1.9"));
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_10@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Doesnt match both os and abi so not blocked
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_11@tests.mozilla.org", "1", "2", "1.9"));
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_12@tests.mozilla.org", "1", "2", "1.9"));
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_13@tests.mozilla.org", "1", "2", "1.9"));
-
-  // Matches both os and abi so blocked
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_14@tests.mozilla.org", "1", "2", "1.9"));
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug394300.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-do_load_httpd_js();
-var server;
-
-// nsIAddonUpdateCheckListener implementation
-var updateListener = {
-  _count: 0,
-  
-  onUpdateStarted: function onUpdateStarted()
-  {
-  },
-
-  onUpdateEnded: function onUpdateEnded()
-  {
-    do_check_eq(this._count, 2);
-    server.stop(do_test_finished);
-  },
-
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon)
-  {
-  },
-
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus)
-  {
-    this._count++;
-    do_check_eq(aStatus, Components.interfaces.nsIAddonUpdateCheckListener.STATUS_UPDATE);
-    do_check_eq(aAddon.version, 10);
-  }
-}
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-  
-  startupEM();
-  
-  gEM.installItemFromFile(do_get_addon("test_bug394300_1"),  NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_addon("test_bug394300_2"),  NS_INSTALL_LOCATION_APPPROFILE);
-  
-  restartEM();
-  
-  var updates = [
-    gEM.getItemForID("bug394300_1@tests.mozilla.org"),
-    gEM.getItemForID("bug394300_2@tests.mozilla.org")
-  ];
-  
-  do_check_neq(updates[0], null);
-  do_check_neq(updates[1], null);
-  
-  server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("data"));
-  server.start(4444);
-  
-  do_test_pending();
-  
-  gEM.update(updates, updates.length,
-             Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION,
-             updateListener);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug394717.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Alexander J. Vincent <ajvincent@gmail.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Use the internal webserver for regular update pings
-gPrefs.setCharPref("extensions.update.url", "http://localhost:4444/");
-
-const checkListener = {
-  _onUpdateStartedCalled: false,
-  _onUpdateEndedCalled: false,
-  _onAddonUpdateStartedCount: 0,
-  _onAddonUpdateEndedCount: 0,
-
-  // nsIAddonUpdateCheckListener
-  onUpdateStarted: function onUpdateStarted() {
-    this._onUpdateStartedCalled = true;
-  },
-
-  // nsIAddonUpdateCheckListener
-  onUpdateEnded: function onUpdateEnded() {
-    this._onUpdateEndedCalled = true;
-    run_test_pt2();
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon) {
-    this._onAddonUpdateStartedCount++;
-  },
-
-  // nsIAddonUpdateCheckListener
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
-    this._onAddonUpdateEndedCount++;
-  }
-}
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-
-/**
- * Run the test.
- */
-function run_test() {
-  // Start the http server. Will return empty update info but that's ok
-  testserver = new nsHttpServer();
-  testserver.start(4444);
-
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "5", "1.9");
-  startupEM();
-  const Ci = Components.interfaces;
-  gEM.update([], 0, Ci.nsIExtensionManager.UPDATE_SYNC_COMPATIBILITY, checkListener);
-  do_test_pending();
-}
-
-function run_test_pt2() {
-  dump("Checking onUpdateStarted\n");
-  do_check_true(checkListener._onUpdateStartedCalled);
-  dump("Checking onUpdateEnded\n");
-  do_check_true(checkListener._onUpdateEndedCalled);
-  do_check_eq(checkListener._onAddonUpdateStartedCount, checkListener._onAddonUpdateEndedCount);
-  testserver.stop(do_test_finished);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug396129.js
+++ /dev/null
@@ -1,345 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-// Use the internal webserver for regular update pings, will just return an error
-gPrefs.setCharPref("extensions.update.url", "http://localhost:4444/");
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-
-var next_state = null;
-var needs_compatibility = false;
-var next_test = null;
-
-// This allows the EM to attempt to display errors to the user without failing
-var promptService = {
-  alert: function(aParent, aDialogTitle, aText) {
-  },
-  
-  alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirm: function(aParent, aDialogTitle, aText) {
-  },
-  
-  confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
-  },
-  
-  prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
-  },
-  
-  promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
-  },
-  
-  select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
-  },
-  
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-  
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}"), "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1", PromptServiceFactory);
-
-// nsIAddonUpdateCheckListener
-var updateListener = {
-  onUpdateStarted: function onUpdateStarted() {
-  },
-
-  onUpdateEnded: function onUpdateEnded() {
-  },
-
-  onAddonUpdateStarted: function onAddonUpdateStarted(aAddon) {
-  },
-
-  onAddonUpdateEnded: function onAddonUpdateEnded(aAddon, aStatus) {
-    if (next_test)
-      next_test(aAddon, aStatus);
-  }
-}
-
-// nsIAddonInstallListener
-var installListener = {
-  onDownloadStarted: function(aAddon) {
-    do_check_eq(next_state, "onDownloadStarted");
-    dump(next_state+"\n");
-
-    next_state = "onDownloadEnded";
-  },
-
-  onDownloadEnded: function(aAddon) {
-    do_check_eq(next_state, "onDownloadEnded");
-    dump(next_state+"\n");
-
-    next_state = "onInstallStarted";
-  },
-
-  onInstallStarted: function(aAddon) {
-    do_check_eq(next_state, "onInstallStarted");
-    dump(next_state+"\n");
-
-    if (needs_compatibility)
-      next_state = "onCompatibilityCheckStarted";
-    else
-      next_state = "onInstallEnded";
-  },
-
-  onCompatibilityCheckStarted: function(aAddon) {
-    do_check_eq(next_state, "onCompatibilityCheckStarted");
-    dump(next_state+"\n");
-
-    next_state = "onCompatibilityCheckEnded";
-  },
-
-  onCompatibilityCheckEnded: function(aAddon, aStatus) {
-    do_check_eq(next_state, "onCompatibilityCheckEnded");
-    dump(next_state+"\n");
-
-    next_state = "onInstallEnded";
-  },
-
-  onInstallEnded: function(aAddon, aStatus) {
-    do_check_eq(next_state, "onInstallEnded");
-    dump(next_state+"\n");
-
-    next_state = "onInstallsCompleted";
-  },
-
-  onInstallsCompleted: function() {
-    do_check_eq(next_state, "onInstallsCompleted");
-    dump(next_state+"\n");
-
-    next_state = null;
-    if (next_test)
-      next_test();
-  },
-
-  onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
-  }
-}
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
-
-  const dataDir = do_get_file("data");
-  const addonsDir = do_get_addon("test_bug396129_a_1").parent;
-
-  // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
-  testserver.registerDirectory("/addons/", addonsDir);
-  testserver.registerDirectory("/data/", dataDir);
-  testserver.start(4444);
-
-  startupEM();
-
-  gEM.addInstallListener(installListener);
-
-  run_install_test();
-}
-
-function run_install_test() {
-  // All the v1 extensions should install synchronously
-  needs_compatibility = false;
-
-  var addons = ["test_bug396129_a_1", "test_bug396129_b_1", "test_bug396129_c_1", "test_bug396129_d_1"];
-  for (var i = 0; i < addons.length; i++) {
-    next_state = "onInstallStarted";
-    gEM.installItemFromFile(do_get_addon(addons[i]), NS_INSTALL_LOCATION_APPPROFILE);
-    do_check_eq(next_state, null);
-  }
-
-  restartEM();
-
-  var item = gEM.getItemForID("bug396129_a@tests.mozilla.org");
-  do_check_neq(item, null);
-
-  next_test = updatecheck_a;
-  gEM.update([item], 1, Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION, updateListener);
-
-  do_test_pending();
-}
-
-function updatecheck_a(addon, status) {
-  do_check_eq(status, Components.interfaces.nsIAddonUpdateCheckListener.STATUS_UPDATE);
-  do_check_eq(addon.version, 2);
-
-  next_test = updated_a;
-  needs_compatibility = true;
-  next_state = "onDownloadStarted";
-  gEM.addDownloads([addon], 1, null);
-}
-
-function updated_a() {
-  do_check_eq(next_state, null);
-
-  var item = gEM.getItemForID("bug396129_d@tests.mozilla.org");
-  do_check_neq(item, null);
-
-  next_test = updatecheck_d;
-  gEM.update([item], 1, Components.interfaces.nsIExtensionManager.UPDATE_CHECK_NEWVERSION, updateListener);
-}
-
-function updatecheck_d(addon, status) {
-  do_check_eq(status, Components.interfaces.nsIAddonUpdateCheckListener.STATUS_UPDATE);
-  do_check_eq(addon.version, 2);
-
-  next_test = updated_d;
-  needs_compatibility = false;
-  next_state = "onDownloadStarted";
-  gEM.addDownloads([addon], 1, null);
-}
-
-function updated_d() {
-  do_check_eq(next_state, null);
-  restartEM();
-  gEM.uninstallItem("bug396129_a@tests.mozilla.org");
-  gEM.uninstallItem("bug396129_b@tests.mozilla.org");
-  gEM.uninstallItem("bug396129_c@tests.mozilla.org");
-  gEM.uninstallItem("bug396129_d@tests.mozilla.org");
-  restartEM();
-  do_check_eq(gEM.getItemForID("bug396129_a@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug396129_b@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug396129_c@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug396129_d@tests.mozilla.org"), null);
-
-  next_state = "onInstallStarted";
-  needs_compatibility = true;
-  next_test = installed_a;
-  gEM.installItemFromFile(do_get_addon("test_bug396129_a_2"), NS_INSTALL_LOCATION_APPPROFILE);
-}
-
-function installed_a() {
-  do_check_eq(next_state, null);
-  restartEM();
-  // Should have been made compatible by the update information.
-  do_check_neq(gEM.getItemForID("bug396129_a@tests.mozilla.org"), null);
-  gEM.uninstallItem("bug396129_a@tests.mozilla.org");
-  restartEM();
-  do_check_eq(gEM.getItemForID("bug396129_a@tests.mozilla.org"), null);
-
-  next_state = "onInstallStarted";
-  needs_compatibility = true;
-  next_test = installed_b;
-  gEM.installItemFromFile(do_get_addon("test_bug396129_b_2"), NS_INSTALL_LOCATION_APPPROFILE);
-}
-
-function installed_b() {
-  do_check_eq(next_state, null);
-  restartEM();
-  // Should have failed compatibility check.
-  do_check_eq(gEM.getItemForID("bug396129_b@tests.mozilla.org"), null);
-
-  next_state = "onInstallStarted";
-  needs_compatibility = true;
-  next_test = installed_c;
-  gEM.installItemFromFile(do_get_addon("test_bug396129_c_2"), NS_INSTALL_LOCATION_APPPROFILE);
-}
-
-function installed_c() {
-  do_check_eq(next_state, null);
-
-  restartEM();
-  // Should have failed compatibility check.
-  do_check_eq(gEM.getItemForID("bug396129_c@tests.mozilla.org"), null);
-
-  var item = Components.classes["@mozilla.org/updates/item;1"]
-                       .createInstance(Components.interfaces.nsIUpdateItem);
-  item.init("bug396129_b@tests.mozilla.org", "", NS_INSTALL_LOCATION_APPPROFILE,
-            "", "", "", " http://localhost:4444/addons/test_bug396129_b_2.xpi",
-            "", "", "", "", 2, "");
-  next_state = "onDownloadStarted";
-  needs_compatibility = true;
-  next_test = downloaded_b;
-  gEM.addDownloads([item], 1, null);
-}
-
-function downloaded_b() {
-  do_check_eq(next_state, null);
-
-  restartEM();
-  // Should have failed compatibility check.
-  do_check_eq(gEM.getItemForID("bug396129_b@tests.mozilla.org"), null);
-
-  var item = Components.classes["@mozilla.org/updates/item;1"]
-                       .createInstance(Components.interfaces.nsIUpdateItem);
-  item.init("bug396129_c@tests.mozilla.org", "", NS_INSTALL_LOCATION_APPPROFILE,
-            "", "", "", " http://localhost:4444/addons/test_bug396129_c_2.xpi",
-            "", "", "", "", 2, "");
-  next_state = "onDownloadStarted";
-  needs_compatibility = true;
-  next_test = downloaded_c;
-  gEM.addDownloads([item], 1, null);
-}
-
-function downloaded_c() {
-  do_check_eq(next_state, null);
-
-  restartEM();
-  // Should have failed compatibility check.
-  do_check_eq(gEM.getItemForID("bug396129_c@tests.mozilla.org"), null);
-
-  test_complete();
-}
-
-function test_complete() {
-  testserver.stop(do_test_finished);
-}
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug397778.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
-const PREF_SELECTED_LOCALE = "general.useragent.locale";
-
-const ADDON = "test_bug397778";
-const ID = "bug397778@tests.mozilla.org";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  gPrefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
-
-  // Install test add-on
-  startupEM();
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr Name");
-  restartEM();
-
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr Name");
-  do_check_eq(getManifestProperty(ID, "description"), "fr Description");
-  
-  // Disable item
-  gEM.disableItem(ID);
-  restartEM();
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "fr Name");
-  
-  // Change locale. The more specific de-DE is the best match
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "de");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "de-DE Name");
-  do_check_eq(getManifestProperty(ID, "description"), "");
-  
-  // Change locale. Locale case should have no effect
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "DE-de");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "de-DE Name");
-  do_check_eq(getManifestProperty(ID, "description"), "");
-  
-  // Change locale. es-ES should closely match
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "es-AR");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "es-ES Name");
-  do_check_eq(getManifestProperty(ID, "description"), "es-ES Description");
-  
-  // Change locale. Either zh-CN or zh-TW could match
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "zh");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  if (addon.name != "zh-TW Name" && addon.name != "zh-CN Name")
-    do_throw("zh matched to " + addon.name);
-  
-  // Unknown locale should try to match against en-US as well. Of en,en-GB
-  // en should match as being less specific
-  gPrefs.setCharPref(PREF_SELECTED_LOCALE, "nl-NL");
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "en Name");
-  do_check_eq(getManifestProperty(ID, "description"), "en Description");
-  
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug406118.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  // We cannot force the blocklist to update so just copy our test list to the profile
-  var source = do_get_file("data/test_bug393285.xml");
-  source.copyTo(gProfD, "blocklist.xml");
-
-  var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
-                            .getService(Components.interfaces.nsIBlocklistService);
-  
-  // All these should be blocklisted for the current app.
-  do_check_false(blocklist.isAddonBlocklisted("test_bug393285_1@tests.mozilla.org", "1", null, null));
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_2@tests.mozilla.org", "1", null, null));
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_3@tests.mozilla.org", "1", null, null));
-  do_check_true(blocklist.isAddonBlocklisted("test_bug393285_4@tests.mozilla.org", "1", null, null));
-
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug424107.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test()
-{
-  // Copy an initial add-on into the profile.
-  var extension = gProfD.clone()
-  extension.append("extensions");
-  extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  extension.append("bug424107@tests.mozilla.org");
-  extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  var sourcerdf = do_get_file("data/test_bug424107_1.rdf");
-  sourcerdf.copyTo(extension, "install.rdf");
-  
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "5", "1.9");
-  startupEM();
-  var addon = gEM.getItemForID("bug424107@tests.mozilla.org");
-  do_check_neq(addon, null);
-  do_check_eq(addon.version, 1);
-
-  // Uninstall
-  extension.remove(true);
-
-  restartEM();
-  addon = gEM.getItemForID("bug424107@tests.mozilla.org");
-  do_check_eq(addon, null);
-
-  // Install a new version
-  extension.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  sourcerdf = do_get_file("data/test_bug424107_2.rdf");
-  sourcerdf.copyTo(extension, "install.rdf");
-
-  restartEM();
-  addon = gEM.getItemForID("bug424107@tests.mozilla.org");
-  do_check_neq(addon, null);
-  do_check_eq(addon.version, 2);
-}
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug425657.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const ADDON = "test_bug425657";
-const ID = "bug425657@tests.mozilla.org";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-
-  // Install test add-on
-  startupEM();
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "Deutsches W\u00f6rterbuch");
-  restartEM();
-
-  addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  do_check_eq(addon.name, "Deutsches W\u00f6rterbuch");
-  do_check_eq(addon.name.length, 20);
-
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug428341.js
+++ /dev/null
@@ -1,268 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Use the internal webserver for regular update pings, will just return an error
-gPrefs.setCharPref("extensions.update.url", "http://localhost:4444/");
-
-do_load_httpd_js();
-var testserver;
-
-// This allows the EM to attempt to display errors to the user without failing
-var promptService = {
-  alert: function(aParent, aDialogTitle, aText) {
-  },
-  
-  alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirm: function(aParent, aDialogTitle, aText) {
-  },
-  
-  confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-  
-  confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
-  },
-  
-  prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
-  },
-  
-  promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
-  },
-  
-  select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
-  },
-  
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-  
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}"), "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1", PromptServiceFactory);
-
-var gNextState = null;
-var gIndex = null;
-var ADDONS = [
-{
-  id: null,
-  addon: "test_bug428341_1",
-  error: -8,
-  checksCompatibility: false
-},
-{
-  id: null,
-  addon: "test_bug428341_2",
-  error: -8,
-  checksCompatibility: false
-},
-{
-  id: null,
-  addon: "test_bug428341_3",
-  error: -8,
-  checksCompatibility: false
-},
-{
-  id: "{invalid-guid}",
-  addon: "test_bug428341_4",
-  error: -2,
-  checksCompatibility: false
-},
-{
-  id: "bug428341_5@tests.mozilla.org",
-  addon: "test_bug428341_5",
-  error: -5,
-  checksCompatibility: false
-},
-{
-  id: "bug428341_6@tests.mozilla.org",
-  addon: "test_bug428341_6",
-  error: -7,
-  checksCompatibility: false
-},
-{
-  id: "bug428341_7@tests.mozilla.org",
-  addon: "test_bug428341_7",
-  error: -3,
-  checksCompatibility: false
-},
-{
-  id: "bug428341_8@tests.mozilla.org",
-  addon: "test_bug428341_8",
-  error: -3,
-  checksCompatibility: true
-},
-{
-  id: "bug428341_9@tests.mozilla.org",
-  addon: "test_bug428341_9",
-  error: -3,
-  checksCompatibility: true
-}
-];
-
-// nsIAddonInstallListener
-var installListener = {
-  onDownloadStarted: function(aAddon) {
-    do_throw("onDownloadStarted should not be called for a direct install");
-  },
-
-  onDownloadEnded: function(aAddon) {
-    do_throw("onDownloadEnded should not be called for a direct install");
-  },
-
-  onInstallStarted: function(aAddon) {
-    var state = "onInstallStarted";
-    if (gNextState != state) {
-      do_throw("Encountered invalid state installing add-on " + ADDONS[gIndex].addon +
-               ". Saw " + state + " but expected " + gNextState);
-    }
-
-    dump("Seen " + state + " for add-on " + ADDONS[gIndex].addon + "\n");
-
-    if (ADDONS[gIndex].checksCompatibility)
-      gNextState = "onCompatibilityCheckStarted";
-    else
-      gNextState = "onInstallEnded";
-  },
-
-  onCompatibilityCheckStarted: function(aAddon) {
-    var state = "onCompatibilityCheckStarted";
-    if (gNextState != state) {
-      do_throw("Encountered invalid state installing add-on " + ADDONS[gIndex].addon +
-               ". Saw " + state + " but expected " + gNextState);
-    }
-
-    dump("Seen " + state + " for add-on " + ADDONS[gIndex].addon + "\n");
-
-    gNextState = "onCompatibilityCheckEnded";
-  },
-
-  onCompatibilityCheckEnded: function(aAddon, aStatus) {
-    var state = "onCompatibilityCheckEnded";
-    if (gNextState != state) {
-      do_throw("Encountered invalid state installing add-on " + ADDONS[gIndex].addon +
-               ". Saw " + state + " but expected " + gNextState);
-    }
-
-    dump("Seen " + state + " for add-on " + ADDONS[gIndex].addon + "\n");
-
-    gNextState = "onInstallEnded";
-  },
-
-  onInstallEnded: function(aAddon, aStatus) {
-    var state = "onInstallEnded";
-    if (gNextState != state) {
-      do_throw("Encountered invalid state installing add-on " + ADDONS[gIndex].addon +
-               ". Saw " + state + " but expected " + gNextState);
-    }
-
-    if (ADDONS[gIndex].id && ADDONS[gIndex].id != aAddon.id)
-      do_throw("Add-on " + ADDONS[gIndex].addon + " had an incorrect id " + aAddon.id);
-
-    if (aStatus != ADDONS[gIndex].error)
-      do_throw("Add-on " + ADDONS[gIndex].addon + " returned incorrect status " + aStatus + ".");
-
-    dump("Seen " + state + " for add-on " + ADDONS[gIndex].addon + "\n");
-
-    gNextState = "onInstallsCompleted";
-  },
-
-  onInstallsCompleted: function() {
-    var state = "onInstallsCompleted";
-    if (gNextState != state) {
-      do_throw("Encountered invalid state installing add-on " + ADDONS[gIndex].addon +
-               ". Saw " + state + " but expected " + gNextState);
-    }
-
-    dump("Seen " + state + " for add-on " + ADDONS[gIndex].addon + "\n");
-
-    gNextState = null;
-    gIndex++;
-    installNextAddon();
-  },
-
-  onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
-    do_throw("onDownloadProgress should not be called for a direct install");
-  }
-}
-
-function installNextAddon() {
-  if (gIndex >= ADDONS.length) {
-    testserver.stop(do_test_finished);
-    return;
-  }
-
-  gNextState = "onInstallStarted";
-  try {
-    dump("Installing add-on " + ADDONS[gIndex].addon + "\n");
-    gEM.installItemFromFile(do_get_addon(ADDONS[gIndex].addon),
-                            NS_INSTALL_LOCATION_APPPROFILE);
-  }
-  catch (e) {
-    do_throw("Exception installing add-on " + ADDONS[gIndex].addon + " " + e);
-  }
-}
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-  startupEM();
-  gEM.addInstallListener(installListener);
-  gIndex = 0;
-  do_test_pending();
-
-  // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
-  testserver.start(4444);
-
-  installNextAddon();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug430120.js
+++ /dev/null
@@ -1,174 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const BLOCKLIST_TIMER                 = "blocklist-background-update-timer";
-const PREF_BLOCKLIST_URL              = "extensions.blocklist.url";
-const PREF_BLOCKLIST_ENABLED          = "extensions.blocklist.enabled";
-const PREF_APP_DISTRIBUTION           = "distribution.id";
-const PREF_APP_DISTRIBUTION_VERSION   = "distribution.version";
-const PREF_APP_UPDATE_CHANNEL         = "app.update.channel";
-const PREF_GENERAL_USERAGENT_LOCALE   = "general.useragent.locale";
-const CATEGORY_UPDATE_TIMER           = "update-timer";
-
-// Get the HTTP server.
-do_load_httpd_js();
-var testserver;
-var gOSVersion;
-var gBlocklist;
-
-// This is a replacement for the timer service so we can trigger timers
-var timerService = {
-
-  hasTimer: function(id) {
-    var catMan = Components.classes["@mozilla.org/categorymanager;1"]
-                           .getService(Components.interfaces.nsICategoryManager);
-    var entries = catMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
-    while (entries.hasMoreElements()) {
-      var entry = entries.getNext().QueryInterface(Components.interfaces.nsISupportsCString).data;
-      var value = catMan.getCategoryEntry(CATEGORY_UPDATE_TIMER, entry);
-      var timerID = value.split(",")[2];
-      if (id == timerID) {
-        return true;
-      }
-    }
-    return false;
-  },
-
-  fireTimer: function(id) {
-    gBlocklist.QueryInterface(Components.interfaces.nsITimerCallback).notify(null);
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIUpdateTimerManager)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var TimerServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return timerService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{61189e7a-6b1b-44b8-ac81-f180a6105085}"), "TimerService",
-                          "@mozilla.org/updates/timer-manager;1", TimerServiceFactory);
-
-function failHandler(metadata, response) {
-  do_throw("Should not have attempted to retrieve the blocklist when it is disabled");
-}
-
-function pathHandler(metadata, response) {
-  var ABI = "noarch-spidermonkey";
-  // the blacklist service special-cases ABI for Universal binaries,
-  // so do the same here.
-  if ("@mozilla.org/xpcom/mac-utils;1" in Components.classes) {
-    var macutils = Components.classes["@mozilla.org/xpcom/mac-utils;1"]
-                             .getService(Components.interfaces.nsIMacUtils);
-    if (macutils.isUniversalBinary)
-      ABI = "Universal-gcc3";
-  }
-  do_check_eq(metadata.queryString,
-              "xpcshell@tests.mozilla.org&1&XPCShell&1&2007010101&" +
-              "XPCShell_" + ABI + "&locale&updatechannel&" +
-              gOSVersion + "&1.9&distribution&distribution-version");
-  gBlocklist.observe(null, "quit-application", "");
-  gBlocklist.observe(null, "xpcom-shutdown", "");
-  testserver.stop(do_test_finished);
-}
-
-function run_test() {
-  var osVersion;
-  var sysInfo = Components.classes["@mozilla.org/system-info;1"]
-                          .getService(Components.interfaces.nsIPropertyBag2);
-  try {
-    osVersion = sysInfo.getProperty("name") + " " + sysInfo.getProperty("version");
-    if (osVersion) {
-      try {
-        osVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")";
-      }
-      catch (e) {
-      }
-      gOSVersion = encodeURIComponent(osVersion);
-    }
-  }
-  catch (e) {
-  }
-
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  testserver = new nsHttpServer();
-  testserver.registerPathHandler("/1", failHandler);
-  testserver.registerPathHandler("/2", pathHandler);
-  testserver.start(4444);
-
-  // Initialise the blocklist service
-  gBlocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
-                         .getService(Components.interfaces.nsIBlocklistService)
-                         .QueryInterface(Components.interfaces.nsIObserver);
-  gBlocklist.observe(null, "profile-after-change", "");
-
-  do_check_true(timerService.hasTimer(BLOCKLIST_TIMER));
-
-  do_test_pending();
-
-  // This should have no effect as the blocklist is disabled
-  gPrefs.setCharPref(PREF_BLOCKLIST_URL, "http://localhost:4444/1");
-  gPrefs.setBoolPref(PREF_BLOCKLIST_ENABLED, false);
-  timerService.fireTimer(BLOCKLIST_TIMER);
-
-  // Some values have to be on the default branch to work
-  var defaults = gPrefs.QueryInterface(Components.interfaces.nsIPrefService)
-                       .getDefaultBranch(null);
-  defaults.setCharPref(PREF_APP_UPDATE_CHANNEL, "updatechannel");
-  defaults.setCharPref(PREF_APP_DISTRIBUTION, "distribution");
-  defaults.setCharPref(PREF_APP_DISTRIBUTION_VERSION, "distribution-version");
-  defaults.setCharPref(PREF_GENERAL_USERAGENT_LOCALE, "locale");
-
-  // This should correctly escape everything
-  gPrefs.setCharPref(PREF_BLOCKLIST_URL, "http://localhost:4444/2?" +
-                     "%APP_ID%&%APP_VERSION%&%PRODUCT%&%VERSION%&%BUILD_ID%&" +
-                     "%BUILD_TARGET%&%LOCALE%&%CHANNEL%&" +
-                     "%OS_VERSION%&%PLATFORM_VERSION%&%DISTRIBUTION%&%DISTRIBUTION_VERSION%");
-  gPrefs.setBoolPref(PREF_BLOCKLIST_ENABLED, true);
-  timerService.fireTimer(BLOCKLIST_TIMER);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug436207.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const NO_INSTALL_SCRIPT = -204;
-
-var listener = {
-  onStateChange: function(index, state, value) {
-    if (state == Components.interfaces.nsIXPIProgressDialog.INSTALL_DONE)
-      do_check_eq(value, NO_INSTALL_SCRIPT);
-  },
-
-  onProgress: function(index, value, maxValue) {
-  }
-}
-
-function run_test() {
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  startupEM();
-
-  var xpi = do_get_addon("test_bug436207");
-  var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
-                            .getService(Components.interfaces.nsIIOService);
-  var uri = ioservice.newFileURI(xpi);
-
-  var xpim = Components.classes["@mozilla.org/xpinstall/install-manager;1"]
-                       .createInstance(Components.interfaces.nsIXPInstallManager);
-  xpim.initManagerFromChrome([uri.spec], 1, listener);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug465190.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *   Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-var installLocation = gProfD.clone();
-installLocation.append("baddir");
-installLocation.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0664);
-
-var dirProvider2 = {
-  getFile: function(prop, persistent) {
-    persistent.value = true;
-    if (prop == "XREUSysExt")
-      return installLocation.clone();
-    return null;
-  },
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIDirectoryServiceProvider) ||
-        iid.equals(Components.interfaces.nsISupports)) {
-      return this;
-    }
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-gDirSvc.QueryInterface(Components.interfaces.nsIDirectoryService)
-       .registerProvider(dirProvider2);
-
-function run_test()
-{
-  var log = gProfD.clone();
-  log.append("extensions.log");
-  do_check_false(log.exists());
-
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-
-  startupEM();
-  do_check_false(log.exists());
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug468528.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Blair McBride <bmcbride@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const nsIBLS = Components.interfaces.nsIBlocklistService;
-
-var PLUGINS = [{
-  // Normal blacklisted plugin, before an invalid regexp
-  name: "test_bug468528_1",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // Normal blacklisted plugin, with an invalid regexp
-  name: "test_bug468528_2",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // Normal blacklisted plugin, after an invalid regexp
-  name: "test_bug468528_3",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // Non-blocklisted plugin
-  name: "test_bug468528_4",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-}];
-
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  // We cannot force the blocklist to update so just copy our test list to the profile
-  var source = do_get_file("data/test_bug468528.xml");
-  source.copyTo(gProfD, "blocklist.xml");
-
-  var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
-                            .getService(nsIBLS);
-
-  // blocked (sanity check)
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9") == nsIBLS.STATE_BLOCKED);
-
-  // not blocked - won't match due to invalid regexp
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[1], "1", "1.9") == nsIBLS.STATE_NOT_BLOCKED);
-  
-  // blocked - the invalid regexp for the previous item shouldn't affect this one
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[2], "1", "1.9") == nsIBLS.STATE_BLOCKED);
-
-  // not blocked - the previous invalid regexp shouldn't act as a wildcard
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[3], "1", "1.9") == nsIBLS.STATE_NOT_BLOCKED);
-
-}
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug470377_1.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-// This allows the EM to attempt to display errors to the user without failing
-var promptService = {
-  alert: function(aParent, aDialogTitle, aText) {
-  },
-
-  alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-
-  confirm: function(aParent, aDialogTitle, aText) {
-  },
-
-  confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-
-  confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
-  },
-
-  prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
-  },
-
-  promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}"),
-                          "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1", PromptServiceFactory);
-
-var ADDONS = [
-  "test_bug470377_1",
-  "test_bug470377_2",
-  "test_bug470377_3",
-  "test_bug470377_4",
-  "test_bug470377_5",
-];
-
-var InstallListener = {
-  onDownloadStarted: function(aAddon) {
-  },
-
-  onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
-  },
-
-  onDownloadEnded: function(aAddon) {
-  },
-
-  onInstallStarted: function(aAddon) {
-  },
-
-  onCompatibilityCheckStarted: function(aAddon) {
-    if (aAddon.id == "bug470377_1@tests.mozilla.org")
-      do_throw("Shouldn't perform a compatibility check for test_bug470377_1");
-  },
-
-  onCompatibilityCheckEnded: function(aAddon, aStatus) {
-  },
-
-  onInstallEnded: function(aAddon, aStatus) {
-  },
-
-  onInstallsCompleted: function() {
-    if (ADDONS.length == 0) {
-      do_execute_soon(check_test);
-      return;
-    }
-    gEM.installItemFromFile(do_get_addon(ADDONS.shift()), NS_INSTALL_LOCATION_APPPROFILE);
-  }
-};
-
-do_load_httpd_js();
-var server;
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
-
-  server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("data/test_bug470377"));
-  server.start(4444);
-
-  do_test_pending();
-  startupEM();
-  gEM.addInstallListener(InstallListener);
-  gEM.installItemFromFile(do_get_addon(ADDONS.shift()), NS_INSTALL_LOCATION_APPPROFILE);
-}
-
-function check_test() {
-  restartEM();
-  do_check_eq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_test_finished();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug470377_2.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-// Disables compatibility checking
-gPrefs.setBoolPref("extensions.checkCompatibility.2", false);
-
-// This allows the EM to attempt to display errors to the user without failing
-var promptService = {
-  alert: function(aParent, aDialogTitle, aText) {
-  },
-
-  alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-
-  confirm: function(aParent, aDialogTitle, aText) {
-  },
-
-  confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
-  },
-
-  confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
-  },
-
-  prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
-  },
-
-  promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
-  },
-
-  select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPromptService)
-     || iid.equals(Components.interfaces.nsISupports))
-      return this;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-var PromptServiceFactory = {
-  createInstance: function (outer, iid) {
-    if (outer != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return promptService.QueryInterface(iid);
-  }
-};
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-registrar.registerFactory(Components.ID("{6cc9c9fe-bc0b-432b-a410-253ef8bcc699}"),
-                          "PromptService",
-                          "@mozilla.org/embedcomp/prompt-service;1", PromptServiceFactory);
-
-var ADDONS = [
-  "test_bug470377_1",
-  "test_bug470377_2",
-  "test_bug470377_3",
-  "test_bug470377_4",
-  "test_bug470377_5",
-];
-
-var InstallListener = {
-  onDownloadStarted: function(aAddon) {
-  },
-
-  onDownloadProgress: function onProgress(aAddon, aValue, aMaxValue) {
-  },
-
-  onDownloadEnded: function(aAddon) {
-  },
-
-  onInstallStarted: function(aAddon) {
-  },
-
-  onCompatibilityCheckStarted: function(aAddon) {
-    do_throw("Shouldn't perform any compatibility checks but did for " + aAddon.id);
-  },
-
-  onCompatibilityCheckEnded: function(aAddon, aStatus) {
-  },
-
-  onInstallEnded: function(aAddon, aStatus) {
-  },
-
-  onInstallsCompleted: function() {
-    if (ADDONS.length == 0) {
-      do_execute_soon(check_test);
-      return;
-    }
-    gEM.installItemFromFile(do_get_addon(ADDONS.shift()), NS_INSTALL_LOCATION_APPPROFILE);
-  }
-};
-
-do_load_httpd_js();
-var server;
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
-
-  server = new nsHttpServer();
-  server.registerDirectory("/", do_get_file("data/test_bug470377"));
-  server.start(4444);
-
-  do_test_pending();
-  startupEM();
-  gEM.addInstallListener(InstallListener);
-  gEM.installItemFromFile(do_get_addon(ADDONS.shift()), NS_INSTALL_LOCATION_APPPROFILE);
-}
-
-function check_test() {
-  restartEM();
-  do_check_eq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_test_finished();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug470377_3.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.2.3", "2");
-
-  // inject the add-ons into the profile
-  var dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_1@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  var source = do_get_file("data/test_bug470377/install_1.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_2@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_2.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_3@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_3.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_4@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_4.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_5@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_5.rdf");
-  source.copyTo(dest, "install.rdf");
-
-  startupEM();
-
-  do_check_neq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_1@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_2@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_3@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_4@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_5@tests.mozilla.org", "isDisabled"), "false");
-
-  // Disable compatibility checks
-  gPrefs.setBoolPref("extensions.checkCompatibility.2.2", false);
-  restartEM();
-
-  do_check_neq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_1@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_2@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_3@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_4@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_5@tests.mozilla.org", "isDisabled"), "false");
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug470377_4.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.1a4", "2");
-
-  // inject the add-ons into the profile
-  var dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_1@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  var source = do_get_file("data/test_bug470377/install_1.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_2@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_2.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_3@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_3.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_4@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_4.rdf");
-  source.copyTo(dest, "install.rdf");
-  dest = gProfD.clone();
-  dest.append("extensions");
-  dest.append("bug470377_5@tests.mozilla.org");
-  dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
-  source = do_get_file("data/test_bug470377/install_5.rdf");
-  source.copyTo(dest, "install.rdf");
-
-  // Disable compatibility checks
-  gPrefs.setBoolPref("extensions.checkCompatibility.2.1a", false);
-  startupEM();
-
-  do_check_neq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_1@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_2@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_3@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_4@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_5@tests.mozilla.org", "isDisabled"), "false");
-
-  // Enable compatibility checks
-  gPrefs.setBoolPref("extensions.checkCompatibility.2.1a", true);
-  restartEM();
-
-  do_check_neq(gEM.getItemForID("bug470377_1@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_1@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_2@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_2@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_3@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_3@tests.mozilla.org", "isDisabled"), "true");
-  do_check_neq(gEM.getItemForID("bug470377_4@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_4@tests.mozilla.org", "isDisabled"), "false");
-  do_check_neq(gEM.getItemForID("bug470377_5@tests.mozilla.org"), null);
-  do_check_eq(getManifestProperty("bug470377_5@tests.mozilla.org", "isDisabled"), "false");
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug474988.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-var installListenerA = {};
-var installListenerB = {};
-var installListenerC = {};
-var installListenerD = {};
-var installListenerE = {};
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
-  startupEM();
-
-  // Add some listeners
-  do_check_eq(gEM.addInstallListener(installListenerA), 0);
-  do_check_eq(gEM.addInstallListener(installListenerB), 1);
-  do_check_eq(gEM.addInstallListener(installListenerC), 2);
-  // Now stack is ABC
-
-  // Should get back the same id if adding the same listener twice
-  do_check_eq(gEM.addInstallListener(installListenerA), 0);
-  do_check_eq(gEM.addInstallListener(installListenerB), 1);
-  do_check_eq(gEM.addInstallListener(installListenerC), 2);
-  // Stack is still ABC
-
-  // Removing a listener shouldn't affect the id of the others
-  gEM.removeInstallListenerAt(0);
-  do_check_eq(gEM.addInstallListener(installListenerB), 1);
-  do_check_eq(gEM.addInstallListener(installListenerC), 2);
-  // Stack is .BC
-
-  // Adding a new listener should still give a higher id than previously
-  do_check_eq(gEM.addInstallListener(installListenerD), 3);
-  // Stack is .BCD
-
-  // Removing and re-adding the highest listener should give the same result.
-  gEM.removeInstallListenerAt(3);
-  do_check_eq(gEM.addInstallListener(installListenerE), 3);
-  // Stack is .BCE
-
-  do_check_eq(gEM.addInstallListener(installListenerD), 4);
-  gEM.removeInstallListenerAt(3);
-  do_check_eq(gEM.addInstallListener(installListenerE), 5);
-  // Stack is .BC.DE
-
-  // Stack should shorten down to the last listener
-  gEM.removeInstallListenerAt(4);
-  gEM.removeInstallListenerAt(5);
-  do_check_eq(gEM.addInstallListener(installListenerD), 3);
-  // Stack is .BCD
-
-  // Stack should get down to 0
-  gEM.removeInstallListenerAt(1);
-  gEM.removeInstallListenerAt(2);
-  gEM.removeInstallListenerAt(3);
-  do_check_eq(gEM.addInstallListener(installListenerE), 0);
-  gEM.removeInstallListenerAt(0);
-  // Stack is empty
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug486195.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *   Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const ID = "bug486195@tests.mozilla.org";
-const REGKEY = "SOFTWARE\\Mozilla\\XPCShell\\Extensions";
-
-function run_test()
-{
-  if (!("nsIWindowsRegKey" in Ci))
-    return;
-
-  var extension = do_get_file("data/test_bug486195");
-
-  Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-  // --- Modified nsIWindowsRegKey implementation ---
-
-  /**
-   * This is a mock nsIWindowsRegistry implementation. It only implements the
-   * methods that the extension manager requires.
-   */
-  function MockWindowsRegKey() {
-  }
-
-  MockWindowsRegKey.prototype = {
-    // --- Overridden nsISupports interface functions ---
-
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowsRegKey]),
-
-    // --- Overridden nsIWindowsRegKey interface functions ---
-
-    open: function(aRootKey, aRelPath, aMode) {
-      if (aRootKey != Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE)
-        throw Components.results.NS_ERROR_FAILURE;
-      if (aRelPath != REGKEY)
-        throw Components.results.NS_ERROR_FAILURE;
-    },
-
-    close: function() {
-    },
-
-    get valueCount() {
-      return 1;
-    },
-
-    getValueName: function(aIndex) {
-      if (aIndex == 0)
-        return ID;
-      throw Components.results.NS_ERROR_FAILURE;
-    },
-
-    readStringValue: function(aName) {
-      if (aName == ID)
-        return extension.path;
-      throw Components.results.NS_ERROR_FAILURE;
-    }
-  };
-
-  var factory = {
-    createInstance: function(aOuter, aIid) {
-      if (aOuter != null)
-        throw Cr.NS_ERROR_NO_AGGREGATION;
-
-      var key = new MockWindowsRegKey();
-      return key.QueryInterface(aIid);
-    }
-  };
-
-  Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
-            .registerFactory(Components.ID("{0478de5b-0f38-4edb-851d-4c99f1ed8eba}"),
-                             "Mock Windows Registry Implementation",
-                             "@mozilla.org/windows-registry-key;1", factory);
-
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-
-  // Install test add-on
-  startupEM();
-  var addon = gEM.getItemForID(ID);
-  do_check_neq(addon, null);
-  var installLocation = gEM.getInstallLocation(ID);
-  var path = installLocation.getItemLocation(ID);
-  do_check_eq(extension.path, path.path);
-  path.append("install.rdf");
-  path = installLocation.getItemLocation(ID);
-  do_check_eq(extension.path, path.path);
-
-  shutdownEM();
-
-  Components.manager.unregisterFactory(Components.ID("{0478de5b-0f38-4edb-851d-4c99f1ed8eba}"),
-                                       factory);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug509194.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *      Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const ID = "{972ce4c6-7e08-4474-a285-3208198ce6fd}";
-
-function run_test()
-{
-  // Setup for test
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
-  startupEM();
-
-  var addon = gEM.getItemForID(ID);
-  // Some applications don't have the default theme defined
-  if (!addon)
-    return;
-
-  var iconURL = getManifestProperty(ID, "iconURL");
-  var location = gEM.getInstallLocation(ID);
-  var file = location.getItemFile(ID, "icon.png");
-  var ioservice = Components.classes["@mozilla.org/network/io-service;1"]
-                            .getService(Components.interfaces.nsIIOService);
-  var uri = ioservice.newURI(iconURL, null, null);
-  uri.QueryInterface(Components.interfaces.nsIFileURL);
-  do_check_true(uri.file.equals(file));
-
-  shutdownEM();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug514327_1.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Blair McBride <bmcbride@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const nsIBLS = Ci.nsIBlocklistService;
-
-var PLUGINS = [{
-  // blocklisted - default severity
-  name: "test_bug514327_1",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // outdated - severity of "0"
-  name: "test_bug514327_2",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // outdated - severity of "0"
-  name: "test_bug514327_3",
-  version: "5",
-  disabled: false,
-  blocklisted: false
-},
-{
-  // not blocklisted, not outdated
-  name: "test_bug514327_4",
-  version: "5",
-  disabled: false,
-  blocklisted: false,
-  outdated: false
-}];
-
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  var source = do_get_file("data/test_bug514327_1.xml");
-  source.copyTo(gProfD, "blocklist.xml");
-
-  var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].getService(nsIBLS);
-
-  // blocked (sanity check)
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9") == nsIBLS.STATE_BLOCKED);
-
-  // outdated
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[1], "1", "1.9") == nsIBLS.STATE_OUTDATED);
-
-  // outdated
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[2], "1", "1.9") == nsIBLS.STATE_OUTDATED);
-
-  // not blocked
-  do_check_true(blocklist.getPluginBlocklistState(PLUGINS[3], "1", "1.9") == nsIBLS.STATE_NOT_BLOCKED);
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug514327_2.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Blair McBride <bmcbride@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-const nsIBLS = Ci.nsIBlocklistService;
-
-// Finds the test nsIPluginTag
-function get_test_plugintag() {
-  var host = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  var tags = host.getPluginTags();
-  for (var i = 0; i < tags.length; i++) {
-    if (tags[i].name == "Test Plug-in")
-      return tags[i];
-  }
-  return null;
-}
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-
-  var source = do_get_file("data/test_bug514327_2.xml");
-  source.copyTo(gProfD, "blocklist.xml");
-
-  var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].getService(nsIBLS);
-  var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
-
-  var plugin = get_test_plugintag();
-  if (!plugin)
-    do_throw("Plugin tag not found");
-
-  // should be marked as outdated by the blocklist
-  do_check_true(blocklist.getPluginBlocklistState(plugin, "1", "1.9") == nsIBLS.STATE_OUTDATED);
-
-  // should indicate that a warning should be shown
-  do_check_true(prefs.getBoolPref("plugins.update.notifyUser"));
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug521905.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>.
- *
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-const ADDON = "test_bug521905";
-const ID = "bug521905@tests.mozilla.org";
-
-// Disables security checking our updates which haven't been signed
-gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
-// Disables compatibility checking
-gPrefs.setBoolPref("extensions.checkCompatibility.2.0pre", false);
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2");
-
-  startupEM();
-  gEM.installItemFromFile(do_get_addon(ADDON), NS_INSTALL_LOCATION_APPPROFILE);
-
-  restartEM();
-  do_check_neq(gEM.getItemForID(ID), null);
-  do_check_eq(getManifestProperty(ID, "isDisabled"), "false");
-
-  gPrefs.setBoolPref("extensions.checkCompatibility.2.0pre", true);
-
-  restartEM();
-  do_check_neq(gEM.getItemForID(ID), null);
-  do_check_eq(getManifestProperty(ID, "isDisabled"), "true");
-
-  gPrefs.setBoolPref("extensions.checkCompatibility.2.0p", false);
-
-  restartEM();
-  do_check_neq(gEM.getItemForID(ID), null);
-  do_check_eq(getManifestProperty(ID, "isDisabled"), "true");
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/unit/test_bug526598.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Dave Townsend <dtownsend@oxymoronical.com>
- *
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL
- *
- * ***** END LICENSE BLOCK *****
- */
-
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
-
-  const dataDir = do_get_file("data");
-
-  startupEM();
-
-  gEM.installItemFromFile(do_get_file("data/test_bug526598_1.xpi"),
-                          NS_INSTALL_LOCATION_APPPROFILE);
-  gEM.installItemFromFile(do_get_file("data/test_bug526598_2.xpi"),
-                          NS_INSTALL_LOCATION_APPPROFILE);
-
-  restartEM();
-  do_check_neq(gEM.getItemForID("bug526598_1@tests.mozilla.org"), null);
-  do_check_neq(gEM.getItemForID("bug526598_2@tests.mozilla.org"), null);
-
-  var il = gEM.getInstallLocation("bug526598_1@tests.mozilla.org");
-  var file = il.getItemFile("bug526598_1@tests.mozilla.org", "install.rdf");
-  do_check_true(file.exists());
-  do_check_true(file.isReadable());
-  do_check_true(file.isWritable());
-
-  il = gEM.getInstallLocation("bug526598_2@tests.mozilla.org");
-  file = il.getItemFile("bug526598_2@tests.mozilla.org", "install.rdf");
-  do_check_true(file.exists());
-  do_check_true(file.isReadable());
-  do_check_true(file.isWritable());
-
-  gEM.uninstallItem("bug526598_1@tests.mozilla.org");
-  gEM.uninstallItem("bug526598_2@tests.mozilla.org");
-
-  restartEM();
-  do_check_eq(gEM.getItemForID("bug526598_1@tests.mozilla.org"), null);
-  do_check_eq(gEM.getItemForID("bug526598_2@tests.mozilla.org"), null);
-}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug299716.rdf
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE RDF:RDF [
+  <!ENTITY bug299716 "urn:mozilla:extension:bug299716">
+  <!ENTITY addons_prefix "http://localhost:4444/addons/test_bug299716">
+  <!ENTITY v0.2 "<em:version>0.2</em:version>">
+
+  <!ENTITY xpcshell.app "
+    <em:id>xpcshell@tests.mozilla.org</em:id>
+    <em:minVersion>5</em:minVersion>
+    <em:maxVersion>5</em:maxVersion>
+  ">
+
+  <!ENTITY toolkit.app "
+    <em:id>toolkit@mozilla.org</em:id>
+    <em:minVersion>1.9</em:minVersion>
+    <em:maxVersion>1.9</em:maxVersion>
+  ">
+
+  <!ENTITY invalidRange "
+    <em:minVersion>30</em:minVersion>
+    <em:maxVersion>30</em:maxVersion>
+  ">
+
+  <!ENTITY xpcshell.invalid "
+    <em:id>xpcshell@tests.mozilla.org</em:id>
+    &invalidRange;
+  ">
+
+  <!ENTITY toolkit.invalid "
+    <em:id>toolkit@mozilla.org</em:id>
+    &invalidRange;
+  ">
+]>
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <!-- XPCShell -->
+  <RDF:Description about="&bug299716;-a@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-a@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-a@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_a_2.xpi">
+        &xpcshell.app;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- Toolkit -->
+  <RDF:Description about="&bug299716;-b@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-b@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-b@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_b_2.xpi">
+        &toolkit.app;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- XPCShell + Toolkit -->
+  <RDF:Description about="&bug299716;-c@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-c@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-c@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_c_2.xpi">
+        &xpcshell.app;
+      </RDF:Description>
+    </em:targetApplication>
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_c_2.xpi">
+        &toolkit.app;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- XPCShell (Toolkit invalid) -->
+  <RDF:Description about="&bug299716;-d@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-d@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-d@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_d_2.xpi">
+        &xpcshell.app;
+      </RDF:Description>
+    </em:targetApplication>
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_d_2.xpi">
+        &toolkit.invalid;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- Toolkit (XPCShell invalid), should not install -->
+  <RDF:Description about="&bug299716;-e@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-e@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-e@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_e_2.xpi">
+        &xpcshell.invalid;
+      </RDF:Description>
+    </em:targetApplication>
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_e_2.xpi">
+        &toolkit.app;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- None (XPCShell, Toolkit invalid), should not install -->
+  <RDF:Description about="&bug299716;-f@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-f@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-f@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_f_2.xpi">
+        &xpcshell.invalid;
+      </RDF:Description>
+    </em:targetApplication>
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_f_2.xpi">
+        &toolkit.invalid;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+
+  <!-- Toolkit (invalid), should not install -->
+  <RDF:Description about="&bug299716;-g@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li RDF:resource="&bug299716;-g@tests.mozilla.org:0.2"/>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="&bug299716;-g@tests.mozilla.org:0.2">
+    &v0.2;
+    <em:targetApplication>
+      <RDF:Description em:updateLink="&addons_prefix;_g_2.xpi">
+        &toolkit.invalid;
+      </RDF:Description>
+    </em:targetApplication>
+  </RDF:Description>
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug299716_2.rdf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <RDF:Description about="urn:mozilla:extension:bug299716-2@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>0.1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>1.9</em:minVersion>
+                <em:maxVersion>2.0.*</em:maxVersion>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug324121.rdf
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:bug324121_2@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- app id compatible update available -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>2</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>3</em:minVersion>
+                <em:maxVersion>3</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="urn:mozilla:extension:bug324121_3@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- app id incompatible update available -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>2</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="urn:mozilla:extension:bug324121_6@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- toolkit id compatible update available -->
+	<RDF:li>
+          <RDF:Description>
+            <em:version>2</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>3</em:minVersion>
+                <em:maxVersion>3</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="urn:mozilla:extension:bug324121_7@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- toolkit id incompatible update available -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>2</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
+
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug393285.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
+  <emItems>
+    <emItem id="test_bug393285_2@tests.mozilla.org"/>
+    <emItem id="test_bug393285_3@tests.mozilla.org">
+      <versionRange minVersion="1.0" maxVersion="1.0"/>
+    </emItem>
+    <emItem id="test_bug393285_4@tests.mozilla.org">
+      <versionRange minVersion="1.0" maxVersion="1.0">
+        <targetApplication id="xpcshell@tests.mozilla.org">
+          <versionRange minVersion="1.0" maxVersion="1.0"/>
+        </targetApplication>
+      </versionRange>
+    </emItem>
+    <emItem id="test_bug393285_5@tests.mozilla.org" os="Darwin"/>
+    <emItem id="test_bug393285_6@tests.mozilla.org" os="XPCShell"/>
+    <emItem id="test_bug393285_7@tests.mozilla.org" os="Darwin,XPCShell,WINNT"/>
+    <emItem id="test_bug393285_8@tests.mozilla.org" xpcomabi="x86-msvc"/>
+    <emItem id="test_bug393285_9@tests.mozilla.org" xpcomabi="noarch-spidermonkey"/>
+    <emItem id="test_bug393285_10@tests.mozilla.org" xpcomabi="ppc-gcc3,noarch-spidermonkey,x86-msvc"/>
+    <emItem id="test_bug393285_11@tests.mozilla.org" os="Darwin" xpcomabi="ppc-gcc3,x86-msvc"/>
+    <emItem id="test_bug393285_12@tests.mozilla.org" os="Darwin" xpcomabi="ppc-gcc3,noarch-spidermonkey,x86-msvc"/>
+    <emItem id="test_bug393285_13@tests.mozilla.org" os="XPCShell" xpcomabi="ppc-gcc3,x86-msvc"/>
+    <emItem id="test_bug393285_14@tests.mozilla.org" os="XPCShell,WINNT" xpcomabi="ppc-gcc3,x86-msvc,noarch-spidermonkey"/>
+  </emItems>
+</blocklist>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug394300.rdf
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:bug394300_1@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- Not a valid install - incompatible app versions -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>20</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Valid install should be the version detected -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>10</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>1</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Valid install. Detecting this would indicate that the order
+             of entries is playing a part in the update detection. -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>6</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>1</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Not a valid install - no minVersion or maxVersion specified -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>40</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Not a valid install - incompatible app versions -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>30</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+  <RDF:Description about="urn:mozilla:extension:bug394300_2@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <!-- Not a valid install - incompatible app versions -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>20</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Valid install should be the version detected -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>10</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>1.9</em:minVersion>
+                <em:maxVersion>1.9</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Valid install. Detecting this would indicate that the order
+             of entries is playing a part in the update detection. -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>6</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>1.9</em:minVersion>
+                <em:maxVersion>1.9</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Not a valid install - no minVersion or maxVersion specified -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>40</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+        <!-- Not a valid install - incompatible app versions -->
+        <RDF:li>
+          <RDF:Description>
+            <em:version>30</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>2</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
+
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug468528.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
+  <pluginItems>
+    <pluginItem>
+      <match name="name" exp="^test_bug468528_1"/>
+    </pluginItem>
+    <pluginItem>
+      <match name="name" exp="^test_bug468528_2["/>
+    </pluginItem>
+    <pluginItem>
+      <match name="name" exp="^test_bug468528_3"/>
+    </pluginItem>
+  </pluginItems>
+</blocklist>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_1.rdf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>bug470377_1@tests.mozilla.org</em:id>
+    <em:version>1</em:version>
+    <em:targetApplication>
+      <Description>
+        <em:id>unknown@tests.mozilla.org</em:id>
+        <em:minVersion>1</em:minVersion>
+        <em:maxVersion>1</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+    <em:name>Test for Bug 470377</em:name>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_2.rdf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>bug470377_2@tests.mozilla.org</em:id>
+    <em:version>1</em:version>
+    <em:targetApplication>
+      <Description>
+        <em:id>toolkit@mozilla.org</em:id>
+        <em:minVersion>1</em:minVersion>
+        <em:maxVersion>1</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+    <em:name>Test for Bug 470377</em:name>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_3.rdf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>bug470377_3@tests.mozilla.org</em:id>
+    <em:version>1</em:version>
+    <em:targetApplication>
+      <Description>
+        <em:id>xpcshell@tests.mozilla.org</em:id>
+        <em:minVersion>1</em:minVersion>
+        <em:maxVersion>1</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+    <em:name>Test for Bug 470377</em:name>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_4.rdf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>bug470377_4@tests.mozilla.org</em:id>
+    <em:version>1</em:version>
+    <em:targetApplication>
+      <Description>
+        <em:id>toolkit@mozilla.org</em:id>
+        <em:minVersion>1</em:minVersion>
+        <em:maxVersion>2</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+    <em:name>Test for Bug 470377</em:name>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/install_5.rdf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>bug470377_5@tests.mozilla.org</em:id>
+    <em:version>1</em:version>
+    <em:targetApplication>
+      <Description>
+        <em:id>xpcshell@tests.mozilla.org</em:id>
+        <em:minVersion>1</em:minVersion>
+        <em:maxVersion>3</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+    <em:name>Test for Bug 470377</em:name>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_1.rdf
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:test_bug470377_1@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>unknown@tests.mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_2.rdf
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:test_bug470377_2@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>1</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_3.rdf
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:test_bug470377_3@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>1</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_4.rdf
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:test_bug470377_4@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>toolkit@mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>2</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug470377/update_5.rdf
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <RDF:Description about="urn:mozilla:extension:test_bug470377_5@tests.mozilla.org">
+    <em:updates>
+      <RDF:Seq>
+        <RDF:li>
+          <RDF:Description>
+            <em:version>1</em:version>
+            <em:targetApplication>
+              <RDF:Description>
+                <em:id>xpcshell@tests.mozilla.org</em:id>
+                <em:minVersion>1</em:minVersion>
+                <em:maxVersion>3</em:maxVersion>
+                <em:updateLink>http://localhost:4444/broken.xpi</em:updateLink>
+              </RDF:Description>
+            </em:targetApplication>
+          </RDF:Description>
+        </RDF:li>
+      </RDF:Seq>
+    </em:updates>
+  </RDF:Description>
+
+</RDF:RDF>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_1.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
+  <pluginItems>
+    <pluginItem>
+      <match name="name" exp="^test_bug514327_1"/>
+    </pluginItem>
+    <pluginItem>
+      <match name="name" exp="^test_bug514327_2"/>
+      <versionRange severity="0"/>
+    </pluginItem>
+    <pluginItem>
+      <match name="name" exp="^test_bug514327_3"/>
+      <versionRange severity="0"/>
+    </pluginItem>
+  </pluginItems>
+</blocklist>
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_bug514327_2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
+  <pluginItems>
+    <pluginItem>
+      <match name="name" exp="Test Plug-in"/>
+      <versionRange severity="0"/>
+    </pluginItem>
+  </pluginItems>
+</blocklist>
new file mode 100644
index 0000000000000000000000000000000000000000..a4954351c8659223daf33c28d5ced3f773ab4f19
GIT binary patch
literal 544
zc$^FHW@Zs#U}E54=!$5vPIit9R%K*h@MB_N;ASXd$jmD)NzBR7D@sWVc8O(J!T<yu
z42S<T$R?*GWC|uGBp4(#Fvu&UrLY=Dx;D1lU4QEG)XkUDZMil)u0Pll-8Zqbv9VLJ
zsZmlzd%>X(^8@A9Tk<do37Gl_m~uHdF&+^UXzVa{I?~#}!Vnt5%fN23OUxUDdv=I<
zw+0;yYBmtr^I3G_yvqzx?h*@LCFIB1RJ>g>;nEqEMo+n>y1kiE8G-3%bo0yazpM7#
zCAY*u-bec0iZlGv8~2~H)vwhyJE3$c<sah$Uyhf*>u%oHla8Hi(3dRaqSCct-M1Sx
zS__!N(jHd7sF-7rShQ^FS#j~EU2K5@cLde?U$y4H74YIt^Ew;7!BF6?sccH!^3b9%
z)fmYIP6?i(_l=puN=v+E`czDPzpG00?)pdVxj#6>Ot0r@T253uSb6IX-|Gz@-}&+^
z*p>F-%C@HIA~Mg|W*?Qw4(?j0d$y7Dqkl`F;?64h$rgt~6aAJP=6|%*;F;3?Cd+5?
z&2tV&_gr){=ep3n>Vh_NRKNm`$ERnBOx3A>msJwA_Vx3ucYB|;X>OEP`@WAcz?+dt
uoEujR3W6exfssLxL8TGILWxfnaD0Y_utI`8z?+o~qMDJx3rHVe1n~f0ipkjk
new file mode 100644
index 0000000000000000000000000000000000000000..30cf7590735aa749e55d4b4a722ba8bf8026d7f4
GIT binary patch
literal 464
zc$^FHW@Zs#U}E54*c;Jgedb60Ulm3M20tbS25tr!hRnR;lEj=Gy`q$~&=5`r=Bc~H
zyg|6Mf}4Sn<ttDnP%{HVYtX@<W&@EupG7CmbJmD*m+-oJ@ZO$^54Susy^JTbs8w?O
z`q~zd5tx2PH^2P;yK2u}FPAvT`$)&F+`6B~seW>0+^=c*6J4i7{#I|WQe2XId%<2_
zt=LJaGRIYVJVX*}Es{R3Y$%JE+4_FrKa0dePkgjj>+7+U@-8yiqwMqTRcroR0k7gT
zuCv)23<d6n^RD^pw))8$uN_7Xtp_G))uphlSyk>e)8~icZS$vEyW)@X?|vbuleO+{
zkkJISgO#_=@V(yf@trTvf?X*eLasN7i^x1<n|)L!JGg6|-kDC$kNz!ziaV?1CtDl}
zP4ruGm;cdHgJ(+nn=GHnH}gE;J(jUroArgO>;-M+S-}f99-p2iGF7KK&&y=ZwXemd
z-{Xo8Pr1QAx$=I1HzSiAGp?YPU;qI|AY^C+u}}h@6%z1hfga$^$_CRE2-3m`;sF4K
C6s;=&
new file mode 100644
index 0000000000000000000000000000000000000000..d5d1e91da9793d1508a422ece91768ee0d632431
GIT binary patch
literal 602
zc$^FHW@Zs#U}E54Sn6YD^ZEtzJS9d31|KE{25tr!hRnR;lEj=Gy`q$~&=5`rX17O?
z-XL6B!Og(P@)f8OsF{JGHRxc_VFiJ`&$SI~gD*+&pS=(=_ttE2{(IYbeP=RGYV7T-
z+uLH6yZGFR-rDzXt9Ku`zBlZNbA)>K<}UHiDske0NA8<NKN5T#_EB)-Ny*o{^6uR|
zpB=sNXwl9T&r_GC-1_8jce&$>m4%xvln!$qih0o)c0E2wlY{q?%E=iQnybXBt(|_j
z?bth&_m>1qS!ws`9b47xR~Kc<GzEn;Ph@|1VKtk&UWwl6r0Ze)H<i36yMLLn`|G1O
zE;}!r-z-*lrJ?uxi$e|@rXE<nEU<`QVuQgol_wFqQ(ny8Yt6OvU#EfA7L)hMlN@$v
z`gC6SuMo$btoKbjBH^Fm3C=x>r{v`3PS`VJ(jKlBUIhWK_1Q)XTtD6kd$Q%m1^p|B
zvVD0iKi^;4v5zqT7|dJ@AmHe0X2XC4*nq*Dl$n=UR0$5@%*T=5AdD8m0p5&Ea?H3Q
zN&;*Wkjt>75yV1?HdaWqVKoq!lO*8mw~gsQEiebNLL7);7AqS_EfWyV1=7nwE@1!w
D_6Ewk
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -257,27 +257,42 @@ function isItemInAddonsList(type, dir, i
 function isThemeInAddonsList(dir, id) {
   return isItemInAddonsList("themes", dir, id);
 }
 
 function isExtensionInAddonsList(dir, id) {
   return isItemInAddonsList("extensions", dir, id);
 }
 
+/**
+ * Escapes any occurances of &, ", < or > with XML entities.
+ *
+ * @param   str
+ *          The string to escape
+ * @return  The escaped string
+ */
+function escapeXML(str) {
+  return str.toString()
+            .replace(/&/g, "&amp;")
+            .replace(/"/g, "&quot;")
+            .replace(/</g, "&lt;")
+            .replace(/>/g, "&gt;");
+}
+
 function writeLocaleStrings(data) {
   let rdf = "";
   ["name", "description", "creator", "homepageURL"].forEach(function(prop) {
     if (prop in data)
-      rdf += "<em:" + prop + ">" + data[prop] + "</em:" + prop + ">\n";
+      rdf += "<em:" + prop + ">" + escapeXML(data[prop]) + "</em:" + prop + ">\n";
   });
 
   ["developer", "translator", "contributor"].forEach(function(prop) {
     if (prop in data) {
       data[prop].forEach(function(value) {
-        rdf += "<em:" + prop + ">" + value + "</em:" + prop + ">\n";
+        rdf += "<em:" + prop + ">" + escapeXML(value) + "</em:" + prop + ">\n";
       });
     }
   });
   return rdf;
 }
 
 /**
  * Writes an install.rdf manifest into a directory using the properties passed
@@ -295,27 +310,27 @@ function writeInstallRDFToDir(data, dir)
   var rdf = '<?xml version="1.0"?>\n';
   rdf += '<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' +
          '     xmlns:em="http://www.mozilla.org/2004/em-rdf#">\n';
   rdf += '<Description about="urn:mozilla:install-manifest">\n';
 
   ["id", "version", "type", "internalName", "updateURL", "updateKey",
    "optionsURL", "aboutURL", "iconURL"].forEach(function(prop) {
     if (prop in data)
-      rdf += "<em:" + prop + ">" + data[prop] + "</em:" + prop + ">\n";
+      rdf += "<em:" + prop + ">" + escapeXML(data[prop]) + "</em:" + prop + ">\n";
   });
 
   rdf += writeLocaleStrings(data);
 
   if ("targetApplications" in data) {
     data.targetApplications.forEach(function(app) {
       rdf += "<em:targetApplication><Description>\n";
       ["id", "minVersion", "maxVersion"].forEach(function(prop) {
         if (prop in app)
-          rdf += "<em:" + prop + ">" + app[prop] + "</em:" + prop + ">\n";
+          rdf += "<em:" + prop + ">" + escapeXML(app[prop]) + "</em:" + prop + ">\n";
       });
       rdf += "</Description></em:targetApplication>\n";
     });
   }
 
   rdf += "</Description>\n</RDF>\n";
 
   if (!dir.exists())
@@ -535,16 +550,84 @@ function ensure_test_completed() {
     if (gExpectedEvents[i].length > 0)
       do_throw("Didn't see all the expected events for " + i);
   }
   gExpectedEvents = {};
   if (gExpectedInstalls)
     do_check_eq(gExpectedInstalls.length, 0);
 }
 
+/**
+ * A helper method to install an array of AddonInstall to completion and then
+ * call a provided callback.
+ *
+ * @param   installs
+ *          The array of AddonInstalls to install
+ * @param   callback
+ *          The callback to call when all installs have finished
+ */
+function completeAllInstalls(installs, callback) {
+  if (count == 0) {
+    callback();
+    return;
+  }
+
+  let count = installs.length;
+
+  function installCompleted(install) {
+    install.removeListener(listener);
+
+    if (--count == 0)
+      callback();
+  }
+
+  let listener = {
+    onDownloadFailed: installCompleted,
+    onDownloadCancelled: installCompleted,
+    onInstallFailed: installCompleted,
+    onInstallCancelled: installCompleted,
+    onInstallEnded: installCompleted
+  };
+
+  installs.forEach(function(install) {
+    install.addListener(listener);
+    install.install();
+  });
+}
+
+/**
+ * A helper method to install an array of files and call a callback after the
+ * installs are completed.
+ *
+ * @param   files
+ *          The array of files to install
+ * @param   callback
+ *          The callback to call when all installs have finished
+ * @param   ignoreIncompatible
+ *          Optional parameter to ignore add-ons that are incompatible in
+ *          aome way with the application
+ */
+function installAllFiles(files, callback, ignoreIncompatible) {
+  let count = files.length;
+  let installs = [];
+
+  files.forEach(function(file) {
+    AddonManager.getInstallForFile(file, function(install) {
+      if (!install)
+        do_throw("No AddonInstall created for " + file.path);
+
+      if (!ignoreIncompatible || !install.addon.appDisabled)
+        installs.push(install);
+
+      if (--count == 0)
+        completeAllInstalls(installs, callback);
+    });
+  });
+}
+
 if ("nsIWindowsRegKey" in AM_Ci) {
   var MockRegistry = {
     LOCAL_MACHINE: {},
     CURRENT_USER: {},
 
     setValue: function(root, path, name, value) {
       switch (root) {
       case AM_Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE:
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_LightweightThemeManager.js
@@ -0,0 +1,435 @@
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
+const MANDATORY = ["id", "name", "headerURL"];
+const OPTIONAL = ["footerURL", "textcolor", "accentcolor", "iconURL",
+                  "previewURL", "author", "description", "homepageURL",
+                  "updateURL", "version"];
+
+function dummy(id) {
+  return {
+    id: id || Math.random().toString(),
+    name: Math.random().toString(),
+    headerURL: "http://lwttest.invalid/a.png",
+    footerURL: "http://lwttest.invalid/b.png",
+    textcolor: Math.random().toString(),
+    accentcolor: Math.random().toString()
+  };
+}
+
+function run_test() {
+  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
+  startupManager();
+
+  var temp = {};
+  Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
+  do_check_eq(typeof temp.LightweightThemeManager, "object");
+
+  var ltm = temp.LightweightThemeManager;
+
+  do_check_eq(typeof ltm.usedThemes, "object");
+  do_check_eq(ltm.usedThemes.length, 0);
+  do_check_eq(ltm.currentTheme, null);
+
+  ltm.previewTheme(dummy("preview0"));
+  do_check_eq(ltm.usedThemes.length, 0);
+  do_check_eq(ltm.currentTheme, null);
+
+  ltm.previewTheme(dummy("preview1"));
+  do_check_eq(ltm.usedThemes.length, 0);
+  do_check_eq(ltm.currentTheme, null);
+  ltm.resetPreview();
+
+  ltm.currentTheme = dummy("x0");
+  do_check_eq(ltm.usedThemes.length, 1);
+  do_check_eq(ltm.currentTheme.id, "x0");
+  do_check_eq(ltm.usedThemes[0].id, "x0");
+  do_check_eq(ltm.getUsedTheme("x0").id, "x0");
+
+  ltm.previewTheme(dummy("preview0"));
+  do_check_eq(ltm.usedThemes.length, 1);
+  do_check_eq(ltm.currentTheme.id, "x0");
+
+  ltm.resetPreview();
+  do_check_eq(ltm.usedThemes.length, 1);
+  do_check_eq(ltm.currentTheme.id, "x0");
+
+  ltm.currentTheme = dummy("x1");
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme.id, "x1");
+  do_check_eq(ltm.usedThemes[1].id, "x0");
+
+  ltm.currentTheme = dummy("x2");
+  do_check_eq(ltm.usedThemes.length, 3);
+  do_check_eq(ltm.currentTheme.id, "x2");
+  do_check_eq(ltm.usedThemes[1].id, "x1");
+  do_check_eq(ltm.usedThemes[2].id, "x0");
+
+  ltm.currentTheme = dummy("x3");
+  ltm.currentTheme = dummy("x4");
+  ltm.currentTheme = dummy("x5");
+  ltm.currentTheme = dummy("x6");
+  ltm.currentTheme = dummy("x7");
+  do_check_eq(ltm.usedThemes.length, 8);
+  do_check_eq(ltm.currentTheme.id, "x7");
+  do_check_eq(ltm.usedThemes[1].id, "x6");
+  do_check_eq(ltm.usedThemes[7].id, "x0");
+
+  ltm.currentTheme = dummy("x8");
+  do_check_eq(ltm.usedThemes.length, 8);
+  do_check_eq(ltm.currentTheme.id, "x8");
+  do_check_eq(ltm.usedThemes[1].id, "x7");
+  do_check_eq(ltm.usedThemes[7].id, "x1");
+  do_check_eq(ltm.getUsedTheme("x0"), null);
+
+  ltm.forgetUsedTheme("nonexisting");
+  do_check_eq(ltm.usedThemes.length, 8);
+  do_check_neq(ltm.currentTheme, null);
+
+  ltm.forgetUsedTheme("x8");
+  do_check_eq(ltm.usedThemes.length, 7);
+  do_check_eq(ltm.currentTheme, null);
+  do_check_eq(ltm.usedThemes[0].id, "x7");
+  do_check_eq(ltm.usedThemes[6].id, "x1");
+
+  ltm.forgetUsedTheme("x7");
+  ltm.forgetUsedTheme("x6");
+  ltm.forgetUsedTheme("x5");
+  ltm.forgetUsedTheme("x4");
+  ltm.forgetUsedTheme("x3");
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme, null);
+  do_check_eq(ltm.usedThemes[0].id, "x2");
+  do_check_eq(ltm.usedThemes[1].id, "x1");
+
+  ltm.currentTheme = dummy("x1");
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme.id, "x1");
+  do_check_eq(ltm.usedThemes[0].id, "x1");
+  do_check_eq(ltm.usedThemes[1].id, "x2");
+
+  ltm.currentTheme = dummy("x2");
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme.id, "x2");
+  do_check_eq(ltm.usedThemes[0].id, "x2");
+  do_check_eq(ltm.usedThemes[1].id, "x1");
+
+  ltm.currentTheme = ltm.getUsedTheme("x1");
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme.id, "x1");
+  do_check_eq(ltm.usedThemes[0].id, "x1");
+  do_check_eq(ltm.usedThemes[1].id, "x2");
+
+  ltm.forgetUsedTheme("x1");
+  ltm.forgetUsedTheme("x2");
+  do_check_eq(ltm.usedThemes.length, 0);
+  do_check_eq(ltm.currentTheme, null);
+
+  // Use chinese name to test utf-8, for bug #541943
+  var chineseTheme = dummy("chinese0");
+  chineseTheme.name = "中文0";
+  chineseTheme.description = "中文1";
+  ltm.currentTheme = chineseTheme;
+  do_check_eq(ltm.usedThemes.length, 1);
+  do_check_eq(ltm.currentTheme.name, "中文0");
+  do_check_eq(ltm.currentTheme.description, "中文1");
+  do_check_eq(ltm.usedThemes[0].name, "中文0");
+  do_check_eq(ltm.usedThemes[0].description, "中文1");
+  do_check_eq(ltm.getUsedTheme("chinese0").name, "中文0");
+  do_check_eq(ltm.getUsedTheme("chinese0").description, "中文1");
+
+  // This name used to break the usedTheme JSON causing all LWTs to be lost
+  var chineseTheme1 = dummy("chinese1");
+  chineseTheme1.name = "植物大战僵尸~最爱";
+  chineseTheme1.description = "植物大战僵尸~最爱";
+  ltm.currentTheme = chineseTheme1;
+  do_check_neq(ltm.currentTheme, null);
+  do_check_eq(ltm.usedThemes.length, 2);
+  do_check_eq(ltm.currentTheme.name, "植物大战僵尸~最爱");
+  do_check_eq(ltm.currentTheme.description, "植物大战僵尸~最爱");
+  do_check_eq(ltm.usedThemes[1].name, "中文0");
+  do_check_eq(ltm.usedThemes[1].description, "中文1");
+  do_check_eq(ltm.usedThemes[0].name, "植物大战僵尸~最爱");
+  do_check_eq(ltm.usedThemes[0].description, "植物大战僵尸~最爱");
+