Bug 1063837 - Test that the response documents principal is the nullPrincipal. r=smaug
authorTanvi Vyas <tvyas@mozilla.com>
Mon, 22 Sep 2014 15:34:28 -0700
changeset 206603 de9ba02af7a66ff03493d58de550769296329783
parent 206602 84c5652507ced6eed9b0d1f521c7c503213ad8a4
child 206604 5a12875dfd1ca830a60c7888fda0b8ecc165c48a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug
bugs1063837
milestone35.0a1
Bug 1063837 - Test that the response documents principal is the nullPrincipal. r=smaug
content/base/test/chrome/chrome.ini
content/base/test/chrome/test_bug1063837.xul
--- a/content/base/test/chrome/chrome.ini
+++ b/content/base/test/chrome/chrome.ini
@@ -47,14 +47,15 @@ skip-if = buildapp == 'mulet'
 [test_bug765993.html]
 [test_bug780199.xul]
 [test_bug780529.xul]
 [test_bug800386.xul]
 [test_bug814638.xul]
 [test_bug816340.xul]
 [test_bug914381.html]
 [test_bug990812.xul]
+[test_bug1063837.xul]
 [test_cpows.xul]
 skip-if = buildapp == 'mulet'
 [test_document_register.xul]
 [test_domparsing.xul]
 [test_fileconstructor.xul]
 [test_title.xul]
new file mode 100644
--- /dev/null
+++ b/content/base/test/chrome/test_bug1063837.xul
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=206691
+-->
+<window title="Mozilla Bug 1063837"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <!-- test results are displayed in the html:body -->
+  <body xmlns="http://www.w3.org/1999/xhtml">
+  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1063837"
+     target="_blank">Mozilla Bug 1063837</a>
+  </body>
+
+  <!-- test code goes here -->
+  <script type="application/javascript"><![CDATA[
+
+  /** Test for Bug 1063837 **/
+  SimpleTest.waitForExplicitFinish();
+
+  addLoadEvent(function() {
+    var xhr = new XMLHttpRequest();
+    xhr.open("GET", location, false);
+    xhr.onload = function() {
+      ok(xhr.responseXML, "We should have response content!");
+      var principal = xhr.responseXML.nodePrincipal;
+      ok(principal.URI.schemeIs("moz-nullprincipal"), "The response document should have a null principal");
+      SimpleTest.finish();
+    }
+    xhr.send();
+  });
+  ]]></script>
+</window>