Bug 638113: Add-ons manager does not return results when searching for preliminarily reviewed add-ons. r=robstrong, a=dolske
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 02 Mar 2011 14:13:37 -0800
changeset 63320 a6eb991e7f05
parent 63319 646c6004d9d6
child 63321 ed9c526f93b5
push idunknown
push userunknown
push dateunknown
reviewersrobstrong, dolske
bugs638113
milestone2.0b13pre
Bug 638113: Add-ons manager does not return results when searching for preliminarily reviewed add-ons. r=robstrong, a=dolske
toolkit/mozapps/extensions/AddonRepository.jsm
toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository.xml
toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_getAddonsByIDs.xml
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
--- a/toolkit/mozapps/extensions/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/AddonRepository.jsm
@@ -1060,22 +1060,16 @@ var AddonRepository = {
   },
 
   _parseAddons: function(aElements, aTotalResults, aSkip) {
     let self = this;
     let results = [];
     for (let i = 0; i < aElements.length && results.length < this._maxResults; i++) {
       let element = aElements[i];
 
-      // Ignore sandboxed add-ons
-      let status = this._getUniqueDescendant(element, "status");
-      // The status element has a unique id for each status type. 4 is Public.
-      if (status == null || status.getAttribute("id") != 4)
-        continue;
-
       // Ignore add-ons not compatible with this Application
       let tags = this._getUniqueDescendant(element, "compatible_applications");
       if (tags == null)
         continue;
 
       let applications = tags.getElementsByTagName("appID");
       let compatible = Array.some(applications, function(aAppNode) {
         if (self._getTextContent(aAppNode) != Services.appinfo.ID)
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository.xml
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository.xml
@@ -7,17 +7,17 @@
     <guid>test1@tests.mozilla.org</guid>
     <version>1.1</version>
     <authors>
       <author>
         <name>Test Creator 1</name>
         <link>http://localhost:4444/creator1.html</link>
       </author>
     </authors>
-    <status id="4">Public</status>
+    <status id="8">Preliminarily Reviewed</status>
     <compatible_applications>
       <application>
         <appID>xpcshell@tests.mozilla.org</appID>
         <min_version>1</min_version>
         <max_version>1</max_version>
       </application>
     </compatible_applications>
     <!-- Test that a negative rating is ignored -->
@@ -128,17 +128,17 @@
         <link>   http://localhost:4444/developer2-3.html   </link>
       </author>
     </authors>
     <summary>   Test Summary 3   </summary>
     <description>   Test Description 3&lt;br&gt;&lt;ul&gt;&lt;li&gt;List item 1&lt;li&gt;List item 2&lt;/ul&gt;   </description>
     <developer_comments>   Test Developer Comments 3   </developer_comments>
     <eula>   Test EULA 3   </eula>
     <icon>   http://localhost:4444/icon3.png   </icon>
-    <status id="   4   ">Public</status>
+    <status id="   8   ">Preliminarily Reviewed</status>
     <!-- Test that an incompatible + compatible application list passes -->
     <compatible_applications>
       <application>
         <appID>   unknown@tests.mozilla.org   </appID>
         <min_version>   1   </min_version>
         <max_version>   1   </max_version>
       </application>
       <application>
--- a/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_getAddonsByIDs.xml
+++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_AddonRepository_getAddonsByIDs.xml
@@ -17,17 +17,17 @@
         <link>http://localhost:4444/developer1.html</link>
       </author>
     </authors>
     <summary>Test Summary 1</summary>
     <description>Test Description 1</description>
     <eula>Test EULA 1</eula>
     <developer_comments>Test Developer Comments 1</developer_comments>
     <icon>http://localhost:4444/icon1.png</icon>
-    <status id="4">Public</status>
+    <status id="8">Preliminarily Reviewed</status>
     <compatible_applications>
       <application>
         <appID>xpcshell@tests.mozilla.org</appID>
         <min_version>1</min_version>
         <max_version>1</max_version>
       </application>
     </compatible_applications>
     <previews>
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
@@ -71,17 +71,17 @@ var GET_RESULTS = [{
   contributionAmount:     "$11.11",
   averageRating:          4,
   reviewCount:            1111,
   reviewURL:              BASE_URL + "/review1.html",
   totalDownloads:         2222,
   weeklyDownloads:        3333,
   dailyUsers:             4444,
   sourceURI:              BASE_URL + INSTALL_URL2,
-  repositoryStatus:       4,
+  repositoryStatus:       8,
   size:                   5555,
   updateDate:             new Date(1265033045000)
 }, {
   id:                     "test_AddonRepository_1@tests.mozilla.org",
   version:                "1.4",
   repositoryStatus:       9999
 }];
 
@@ -89,17 +89,17 @@ var GET_RESULTS = [{
 var SEARCH_RESULTS = [{
   id:                     "test1@tests.mozilla.org",
   type:                   "extension",
   version:                "1.1",
   creator:                {
                             name: "Test Creator 1",
                             url:  BASE_URL + "/creator1.html"
                           },
-  repositoryStatus:       4,
+  repositoryStatus:       8,
   sourceURI:              BASE_URL + "/test1.xpi"
 }, {
   id:                     "test2@tests.mozilla.org",
   type:                   "extension",
   version:                "1.2",
   creator:                {
                             name: "Test Creator 2",
                             url:  BASE_URL + "/creator2.html"
@@ -165,17 +165,17 @@ var SEARCH_RESULTS = [{
   contributionAmount:     "$11.11",
   averageRating:          2,
   reviewCount:            1111,
   reviewURL:              BASE_URL + "/review3.html",
   totalDownloads:         2222,
   weeklyDownloads:        3333,
   dailyUsers:             4444,
   sourceURI:              BASE_URL + "/test3.xpi",
-  repositoryStatus:       4,
+  repositoryStatus:       8,
   size:                   5555,
   updateDate:             new Date(1265033045000)
 }, {
   id:                     "purchase1@tests.mozilla.org",
   type:                   "extension",
   version:                "2.0",
   creator:                {
                             name: "Test Creator - Last Passing",