Bug 1335645 - Part 5 - Fix warning when test.relativeURI is undefined r=junior
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 27 Feb 2017 19:35:16 +0100
changeset 374404 c43904b6fb097226fae5c2a3e34d0b5814b371ef
parent 374403 bf61d746391e14a8aca696372de9f9336f1f2105
child 374405 b727a8641d40f1dbe796117333532693f1376e07
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjunior
bugs1335645
milestone54.0a1
Bug 1335645 - Part 5 - Fix warning when test.relativeURI is undefined r=junior 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;