Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 const BinaryInputStream =
2 Components.Constructor("@mozilla.org/binaryinputstream;1",
3 "nsIBinaryInputStream", "setInputStream");
4 const BinaryOutputStream =
5 Components.Constructor("@mozilla.org/binaryoutputstream;1",
6 "nsIBinaryOutputStream", "setOutputStream");
8 const Pipe =
9 Components.Constructor("@mozilla.org/pipe;1", "nsIPipe", "init");
11 const kNestedAboutCID = "{2f277c00-0eaf-4ddb-b936-41326ba48aae}";
13 function run_test()
14 {
15 var ios = Cc["@mozilla.org/network/io-service;1"].createInstance(Ci.nsIIOService);
17 var baseURI = ios.newURI("http://example.com/", "UTF-8", null);
19 // This depends on the redirector for about:license having the
20 // nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT flag.
21 var aboutLicense = ios.newURI("about:license", "UTF-8", baseURI);
23 var pipe = new Pipe(false, false, 0, 0, null);
24 var output = new BinaryOutputStream(pipe.outputStream);
25 var input = new BinaryInputStream(pipe.inputStream);
26 output.QueryInterface(Ci.nsIObjectOutputStream);
27 input.QueryInterface(Ci.nsIObjectInputStream);
29 output.writeCompoundObject(aboutLicense, Ci.nsIURI, true);
30 var copy = input.readObject(true);
31 copy.QueryInterface(Ci.nsIURI);
33 do_check_eq(copy.asciiSpec, aboutLicense.asciiSpec);
34 do_check_true(copy.equals(aboutLicense));
35 }