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