# HG changeset patch
# User t_mrc-ct@users.sourceforge.jp
# Date 1384090010 -32400
# Branch GECKO2470_2014071714_RELBRANCH
# Node ID f18512e7d34603fab1f339a9d132197fde6f1cbc
# Parent  8e135c642d79e86b2b3a8a08799dd4c191777c1d
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
@@ -3343,16 +3343,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;
   },
 
   /**
