Bug 1335645 - Part 5 - Fix warning when test.relativeURI is undefined
MozReview-Commit-ID: HosOLS1Rzpi
--- 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;