Bug 1335645 - Part 5 - Fix warning when test.relativeURI is undefined draft
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 27 Feb 2017 19:35:16 +0100
changeset 490141 6c344dad154043dceeb41d7ebc3559be5a8dd176
parent 490140 216349aeef2b6f3b2e83c78cd2adb5687b71708e
child 490142 407f5d64d2bb30fa38d503104b16fca96ab355e8
push id47011
push uservalentin.gosu@gmail.com
push dateMon, 27 Feb 2017 18:38:56 +0000
bugs1335645
milestone54.0a1
Bug 1335645 - Part 5 - Fix warning when test.relativeURI is undefined MozReview-Commit-ID: HosOLS1Rzpi
netwerk/test/unit/test_URIs.js
--- a/netwerk/test/unit/test_URIs.js
+++ b/netwerk/test/unit/test_URIs.js
@@ -1,9 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
 var gIoService = Components.classes["@mozilla.org/network/io-service;1"]
                            .getService(Components.interfaces.nsIIOService);
 
 
 // Run by: cd objdir;  make -C netwerk/test/ xpcshell-tests    
 // or: cd objdir; make SOLO_FILE="test_URIs.js" -C netwerk/test/ check-one
@@ -295,17 +301,18 @@ function do_check_property(aTest, aURI, 
     do_check_eq(aURI[aPropertyName], expectedVal);
   }
 }
 
 // Test that a given URI parses correctly into its various components.
 function do_test_uri_basic(aTest) {
   var URI;
 
-  do_info("Basic tests for " + aTest.spec + " relative URI: " + aTest.relativeURI);
+  do_info("Basic tests for " + aTest.spec +
+          " relative URI: " + (aTest.relativeURI === undefined ? "(none)" : aTest.relativeURI) );
 
   try {
     URI = NetUtil.newURI(aTest.spec);
   } catch(e) {
     do_info("Caught error on parse of" + aTest.spec + " Error: " + e.result);
     if (aTest.fail) {
       do_check_eq(e.result, aTest.result);
       return;