# HG changeset patch
# User t_mrc-ct@users.sourceforge.jp
# Date 1384090010 -32400
#      Sun Nov 10 22:26:50 2013 +0900
# Branch THUNDERBIRD3880_2016050308_RELBRANCH
# Node ID c124941cc1f4b2eb51940913342d3e84682a68db
# Parent  7cf0882c6d2e9cbaa1797a9cfd856b40365e04ea
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
@@ -3759,16 +3759,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;
   },
 
   /**
