# HG changeset patch
# User t_mrc-ct@users.sourceforge.jp
# Date 1384090010 -32400
# Branch GECKO3111_2014090813_RELBRANCH
# Node ID 6e60d52d7c6f27982efdc6bbb61182c9d210dc87
# Parent  0d980ff30650d6287b6f6e1f2816664245e13da8
remove <patch/>-less <update/> if testing

diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3670,16 +3670,26 @@
       updateElement.QueryInterface(Ci.nsIDOMElement);
       try {
         var update = new Update(updateElement);
       } catch (e) {
         LOG("Checker:_updates get - invalid <update/>, ignoring...");
         continue;
       }
       update.serviceURL = this.getUpdateURL(this._forced);
+      // 104bird's <update/> doesn't contain <patch/> and it's OK.
+      // But some test requires removing of such <update/>.
+      // If testing situation detected (update.serviceURL begins with "http://localhost"),
+      // don't append <patch/>-less <update/>.
+      if (update.patchCount == 0 && update.serviceURL != null &&
+          update.serviceURL.search(/^https?:\/\/localhost(:[0-9]+)\//) == 0) {
+        LOG("Checker:updates get - <update/> without patch, ignoring...");
+        continue;
+      }
+
       update.channel = UpdateChannel.get();
       updates.push(update);
     }
 
     return updates;
   },
 
   /**
