Bug 1161221 - Split http referrer tests and enable them on all platforms except https on b2g. r=sstamm
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Thu, 14 May 2015 11:07:38 -0700
changeset 245479 27ebc65071e5c42dd1b5184678540ee13bdfb21b
parent 245478 0db3b7dbcdf64c8c4b56003105ad696c491a246b
child 245480 3082e57356c76f8bac3ca8fc13973e189e38d1c5
push id28806
push userphilringnalda@gmail.com
push dateTue, 26 May 2015 02:10:16 +0000
treeherdermozilla-central@4362d9251296 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstamm
bugs1161221
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161221 - Split http referrer tests and enable them on all platforms except https on b2g. r=sstamm
dom/base/test/bug704320.sjs
dom/base/test/mochitest.ini
dom/base/test/referrerHelper.js
dom/base/test/test_bug1163743.html
dom/base/test/test_bug704320.html
dom/base/test/test_bug704320_http_http.html
dom/base/test/test_bug704320_http_https.html
dom/base/test/test_bug704320_https_http.html
dom/base/test/test_bug704320_https_https.html
dom/base/test/test_bug704320_policyset.html
dom/base/test/test_bug704320_preload.html
--- a/dom/base/test/bug704320.sjs
+++ b/dom/base/test/bug704320.sjs
@@ -75,16 +75,17 @@ function createTest(schemeFrom, schemeTo
            <audio src="' + _createTestUrl('audio') + '"></audio>\n\
            <video src="' + _createTestUrl('video') + '"></video>\n\
            <object type="bogus" data="' + _createTestUrl('object') + '"></object>\n\
            <object type="image/svg+xml" data="' + _createTestUrl('object-svg') + '"></object>\n\
            <a id="link" href="' + _createTestUrl('link') + '" ping="' + _createTestUrl('link-ping') + '"></a>\n\
            <iframe src="' + _create2ndLevelIframeUrl('form') + '"></iframe>\n\
            <iframe src="' + _create2ndLevelIframeUrl('window.location') + '"></iframe>\n\
            <script>\n\
+              var _testFinished = 0\n\
              (function() {\n\
                var x = new XMLHttpRequest();\n\
                x.open("GET", "' + _createTestUrl('xmlhttprequest') + '");\n\
                x.send();\n\
              })();\n\
              (function() {\n\
                var eventSource = new EventSource("' + _createTestUrl('eventsource') + '");\n\
              })();' +
@@ -108,18 +109,20 @@ function createTest(schemeFrom, schemeTo
                  this.checkForFinish();\n\
                }\n\
              }.bind(window), false);\n\
              var win = window.open("' + _createTestUrl('window.open') + '", "");' +
 
              // called by the two things that must complete: window.open page
              // and the window load event.  When both are complete, this
              // "finishes" the iframe subtest by clicking the link.
+             // _testFinished avoids calling this function twice (which may happen)
              'function checkForFinish() {\n\
-               if (window._isLoaded && window._openedWindowLoaded) {\n\
+               if (window._isLoaded && window._openedWindowLoaded && !window._testFinished) {\n\
+                 window._testFinished = 1;\n\
                  document.getElementById("link").click();\n\
                }\n\
              }\n\
            </script>\n\
          </body>\n\
          </html>';
 }
 
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -606,18 +606,26 @@ skip-if = buildapp == 'b2g'
 [test_bug693615.html]
 [test_bug693875.html]
 [test_bug694754.xhtml]
 [test_bug696301-1.html]
 [test_bug696301-2.html]
 [test_bug698381.html]
 [test_bug698384.html]
 [test_bug704063.html]
-[test_bug704320.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g (Needs multiple window.open support) android(times out, bug 1100609) e10s(randomly fails, bug 1100362)
+[test_bug704320_http_http.html]
+support-files = referrerHelper.js
+[test_bug704320_http_https.html]
+support-files = referrerHelper.js
+[test_bug704320_https_http.html]
+support-files = referrerHelper.js
+skip-if = buildapp == 'b2g'  # b2g (https://example.com not working bug 1162353)
+[test_bug704320_https_https.html]
+support-files = referrerHelper.js
+skip-if = buildapp == 'b2g'  # b2g (https://example.com not working bug 1162353)
 [test_bug704320_policyset.html]
 support-files = referrerHelper.js
 [test_bug704320_preload.html]
 [test_bug707142.html]
 [test_bug708620.html]
 [test_bug711047.html]
 [test_bug711180.html]
 [test_bug719533.html]
--- a/dom/base/test/referrerHelper.js
+++ b/dom/base/test/referrerHelper.js
@@ -14,17 +14,16 @@ window.addEventListener("message", funct
       // something else failed in the test frame, abort.
       ok(false, "Child failed the test with error " + event.data.substr(5));
       SimpleTest.finish();
     }});
 
 
 /**
  * helper to perform an XHR.
- * Used by resetCounter() and checkResults().
  */
 function doXHR(url, onSuccess, onFail) {
   var xhr = new XMLHttpRequest();
   xhr.onload = function () {
     if (xhr.status == 200) {
       onSuccess(xhr);
     } else {
       onFail(xhr);
@@ -46,17 +45,17 @@ function resetCounter() {
           ok(false, "Need to be able to reset the request counter");
           SimpleTest.finish();
         });
 }
 
 /**
  * Grabs the results via XHR and passes to checker.
  */
-function checkResults(testname, expected) {
+function checkIndividualResults(testname, expected) {
   doXHR('/tests/dom/base/test/bug704320_counter.sjs?results',
         function(xhr) {
           var results = JSON.parse(xhr.responseText);
           info(xhr.responseText);
 
           ok('img' in results,
               testname + " test: some image loads required in results object.");
           is(results['img'].count, 2,
@@ -69,8 +68,168 @@ function checkResults(testname, expected
             });
           advance();
         },
         function(xhr) {
           ok(false, "Can't get results from the counter server.");
           SimpleTest.finish();
         });
 }
+
+/**
+ * Grabs the results via XHR and checks them
+ */
+function checkExpectedGlobalResults() {
+  var url = 'bug704320.sjs?action=get-test-results';
+  doXHR(url,
+	function(xhr) {
+	      var response = JSON.parse(xhr.response);
+
+	      for (type in response) {
+		for (scheme in response[type]) {
+		  for (policy in response[type][scheme]) {
+		    var expectedResult = EXPECTED_RESULTS[type] === undefined ?
+		      	EXPECTED_RESULTS['default'][scheme][policy] :
+		      	EXPECTED_RESULTS[type][scheme][policy];
+		    is(response[type][scheme][policy], expectedResult, type + ' ' + scheme + ' ' + policy);
+		  }
+		}
+	      }
+		advance();
+	},
+	function(xhr) {
+          	ok(false, "Can't get results from the counter server.");
+		SimpleTest.finish();
+	});
+}
+
+
+var EXPECTED_RESULTS = {
+  // From docshell/base/nsDocShell.cpp:
+  //   "If the document containing the hyperlink being audited was not retrieved
+  //    over an encrypted connection and its address does not have the same
+  //    origin as "ping URL", send a referrer."
+  'link-ping': {
+    // Same-origin
+    'http-to-http': {
+      'no-referrer': '',
+      'unsafe-url': '',
+      'origin': '',
+      'origin-when-cross-origin': '',
+      'no-referrer-when-downgrade': ''
+    },
+    'http-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
+    },
+    // Encrypted and not same-origin
+    'https-to-http': {
+      'no-referrer': '',
+      'unsafe-url': '',
+      'origin': '',
+      'origin-when-cross-origin': '',
+      'no-referrer-when-downgrade': ''
+    },
+    // Encrypted
+    'https-to-https': {
+      'no-referrer': '',
+      'unsafe-url': '',
+      'origin': '',
+      'origin-when-cross-origin': '',
+      'no-referrer-when-downgrade': ''
+    }
+  },
+  // form is tested in a 2nd level iframe.
+  'form': {
+    'http-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=form',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=form',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=form'
+    },
+    'http-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=form',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
+    },
+    'https-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=form',
+      'origin': 'https://example.com',
+      'origin-when-cross-origin': 'https://example.com',
+      'no-referrer-when-downgrade': ''
+    },
+    'https-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=form',
+      'origin': 'https://example.com',
+     'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=form',
+      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
+    }
+  },
+  // window.location is tested in a 2nd level iframe.
+  'window.location': {
+    'http-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=window.location',
+     'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=window.location',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=window.location'
+    },
+    'http-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=window.location',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
+    },
+    'https-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=window.location',
+      'origin': 'https://example.com',
+      'origin-when-cross-origin': 'https://example.com',
+      'no-referrer-when-downgrade': ''
+    },
+    'https-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=window.location',
+      'origin': 'https://example.com',
+      'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=window.location',
+      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
+    }
+  },
+  'default': {
+    'http-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade'
+    },
+    'http-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
+      'origin': 'http://example.com',
+      'origin-when-cross-origin': 'http://example.com',
+      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
+    },
+    'https-to-http': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
+      'origin': 'https://example.com',
+      'origin-when-cross-origin': 'https://example.com',
+      'no-referrer-when-downgrade': ''
+    },
+    'https-to-https': {
+      'no-referrer': '',
+      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
+      'origin': 'https://example.com',
+      'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin',
+      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade'
+    }
+  }
+};
--- a/dom/base/test/test_bug1163743.html
+++ b/dom/base/test/test_bug1163743.html
@@ -22,17 +22,17 @@ var advance = function() { tests.next();
  */
 var tests = (function() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
 
   // origin when crossorigin (trimming whitespace)
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' origin-when-crossorigin');
-  yield checkResults("origin-when-cross-origin", ["origin", "full"]);
+  yield checkIndividualResults("origin-when-cross-origin", ["origin", "full"]);
 
   // complete.  Be sure to yield so we don't call this twice.
   yield SimpleTest.finish();
 })();
 
 </script>
 </head>
 
deleted file mode 100644
--- a/dom/base/test/test_bug704320.html
+++ /dev/null
@@ -1,252 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=704320
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 704320</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320</a>
-<p id="display"></p>
-<pre id="content">
-</pre>
-<pre id="test">
-</pre>
-
-<script type="application/javascript">
-
-
-var testIframeUrls = [
-  // HTTP to HTTP
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
-  // HTTP to HTTPS
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin',
-  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin-when-cross-origin',
-  // HTTPS to HTTP
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer-when-downgrade',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin-when-cross-origin',
-  // HTTPS to HTTPS
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin',
-  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin'
-];
-
-var expectedResults = {
-  // From docshell/base/nsDocShell.cpp:
-  //   "If the document containing the hyperlink being audited was not retrieved
-  //    over an encrypted connection and its address does not have the same
-  //    origin as "ping URL", send a referrer."
-  'link-ping': {
-    // Same-origin
-    'http-to-http': {
-      'no-referrer': '',
-      'unsafe-url': '',
-      'origin': '',
-      'origin-when-cross-origin': '',
-      'no-referrer-when-downgrade': ''
-    },
-    'http-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
-    },
-    // Encrypted and not same-origin
-    'https-to-http': {
-      'no-referrer': '',
-      'unsafe-url': '',
-      'origin': '',
-      'origin-when-cross-origin': '',
-      'no-referrer-when-downgrade': ''
-    },
-    // Encrypted
-    'https-to-https': {
-      'no-referrer': '',
-      'unsafe-url': '',
-      'origin': '',
-      'origin-when-cross-origin': '',
-      'no-referrer-when-downgrade': ''
-    }
-  },
-  // form is tested in a 2nd level iframe.
-  'form': {
-    'http-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=form',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=form',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=form'
-    },
-    'http-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=form',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
-    },
-    'https-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=form',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com',
-      'no-referrer-when-downgrade': ''
-    },
-    'https-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=form',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=form',
-      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
-    }
-  },
-  // window.location is tested in a 2nd level iframe.
-  'window.location': {
-    'http-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=window.location',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=window.location',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=window.location'
-    },
-    'http-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=window.location',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
-    },
-    'https-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=window.location',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com',
-      'no-referrer-when-downgrade': ''
-    },
-    'https-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=window.location',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=window.location',
-      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
-    }
-  },
-  'default': {
-    'http-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade'
-    },
-    'http-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
-      'origin': 'http://example.com',
-      'origin-when-cross-origin': 'http://example.com',
-      'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
-    },
-    'https-to-http': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com',
-      'no-referrer-when-downgrade': ''
-    },
-    'https-to-https': {
-      'no-referrer': '',
-      'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
-      'origin': 'https://example.com',
-      'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin',
-      'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade'
-    }
-  }
-};
-
-function runit() {
-  var url = 'bug704320.sjs?action=get-test-results';
-  var xhr = new XMLHttpRequest();
-
-  xhr.open('GET', url);
-  xhr.onreadystatechange = function() {
-    //dump("\n\n >>>>>>>>>>> XHR ReadyState change \n" + url + "\n\n\n\n");
-    if (this.readyState == 4) {
-      document.getElementById('content').textContent +=
-          JSON.stringify(JSON.parse(this.response), null, 4);
-
-      //dump("\n\n >>>>>>>>>>> GOT RESPONSE: \n" + this.response + "\n\n\n\n");
-      var response = JSON.parse(this.response);
-
-      for (type in response) {
-        for (scheme in response[type]) {
-          for (policy in response[type][scheme]) {
-            var expectedResult = expectedResults[type] === undefined ?
-              expectedResults['default'][scheme][policy] :
-              expectedResults[type][scheme][policy];
-
-            is(response[type][scheme][policy], expectedResult,
-               type + ' ' + scheme + ' ' + policy);
-          }
-        }
-      }
-
-      SimpleTest.finish();
-    }
-  };
-  xhr.send();
-}
-
-// BEGIN
-// Currently triggers assertions on e10s due to bug 820466.  If you try to run
-// this on e10s, you'll get some ssl-related assertions and should add this line:
-// SimpleTest.expectAssertions(0,15);
-// But this test is disabled on e10s for unexpected failures.  See bug 1100362.
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({
-    'set': [['security.mixed_content.block_active_content',   false],
-            ['security.mixed_content.block_display_content',  false],
-            ['browser.send_pings',                            true],
-            ['browser.send_pings.max_per_link',               1],
-            ['browser.send_pings.require_same_host',          false]]
-    },
-    function() {
-      var testContainer = document.getElementById('test');
-
-      testIframeUrls.forEach(function(url) {
-        var iframe = document.createElement('iframe');
-        iframe.setAttribute('class', 'test');
-        iframe.src = url;
-        testContainer.appendChild(iframe);
-      });
-
-      var numFrames = testIframeUrls.length;
-      var numFramesReady = 0;
-
-      window.addEventListener('message', function(event) {
-        ++numFramesReady;
-        if (numFramesReady >= numFrames) {
-          runit();
-        }
-      }, false);
-    });
-</script>
-
-</body>
-</html>
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_bug704320_http_http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=704320
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 704320 - HTTP to HTTP</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="referrerHelper.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+
+<script type="application/javascript;version=1.7">
+
+var testIframeUrls = [
+  // HTTP to HTTP
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
+];
+
+SimpleTest.waitForExplicitFinish();
+var advance = function() { tests.next(); };
+
+/**
+ * This is the main test routine -- serialized by use of a generator.
+ * It performs all tests in sequence using in the same iframe.
+ */
+var tests = (function() {
+  var iframe = document.getElementById("testframe");
+  iframe.onload = function() {
+     advance();
+  }
+
+  // load the test frame from testIframeUrls[url]
+  // it will call back into this function via postMessage when it finishes loading.
+  // and continue beyond the yield.
+  for(url in testIframeUrls) {
+    yield iframe.src = testIframeUrls[url];
+    // run test and check result for loaded test URL
+    yield checkExpectedGlobalResults();
+  }
+
+  // complete.  Be sure to yield so we don't call this twice.
+  yield SimpleTest.finish();
+})();
+
+</script>
+</head>
+
+<body onload="tests.next();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320 - HTTP to HTTP</a>
+<p id="display"></p>
+<pre id="content">
+</pre>
+  <iframe id="testframe"></iframe>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_bug704320_http_https.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=704320
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 704320 - HTTP to HTTPS</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="referrerHelper.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+
+<script type="application/javascript;version=1.7">
+
+var testIframeUrls = [
+  // HTTP to HTTPS
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin',
+  'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin-when-cross-origin',
+];
+
+SimpleTest.waitForExplicitFinish();
+var advance = function() { tests.next(); };
+
+/**
+ * This is the main test routine -- serialized by use of a generator.
+ * It performs all tests in sequence using in the same iframe.
+ */
+var tests = (function() {
+  var iframe = document.getElementById("testframe");
+  iframe.onload = function() {
+     advance();
+  }
+
+  // load the test frame from testIframeUrls[url]
+  // it will call back into this function via postMessage when it finishes loading.
+  // and continue beyond the yield.
+  for(url in testIframeUrls) {
+    yield iframe.src = testIframeUrls[url];
+    // run test and check result for loaded test URL
+    yield checkExpectedGlobalResults();
+  }
+
+  // complete.  Be sure to yield so we don't call this twice.
+  yield SimpleTest.finish();
+})();
+
+</script>
+</head>
+
+<body onload="tests.next();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320 - HTTP to HTTPS</a>
+<p id="display"></p>
+<pre id="content">
+</pre>
+  <iframe id="testframe"></iframe>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_bug704320_https_http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=704320
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 704320 - HTTPS to HTTP</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="referrerHelper.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+
+<script type="application/javascript;version=1.7">
+
+var testIframeUrls = [
+  // HTTPS to HTTP
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer-when-downgrade',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin-when-cross-origin',
+];
+
+SimpleTest.waitForExplicitFinish();
+var advance = function() { tests.next(); };
+
+/**
+ * This is the main test routine -- serialized by use of a generator.
+ * It performs all tests in sequence using in the same iframe.
+ */
+var tests = (function() {
+  var iframe = document.getElementById("testframe");
+  iframe.onload = function() {
+     advance();
+  }
+
+  // load the test frame from testIframeUrls[url]
+  // it will call back into this function via postMessage when it finishes loading.
+  // and continue beyond the yield.
+  for(url in testIframeUrls) {
+    yield iframe.src = testIframeUrls[url];
+    // run test and check result for loaded test URL
+    yield checkExpectedGlobalResults();
+  }
+
+  // complete.  Be sure to yield so we don't call this twice.
+  yield SimpleTest.finish();
+})();
+
+</script>
+</head>
+
+<body onload="tests.next();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320 - HTTPS to HTTP</a>
+<p id="display"></p>
+<pre id="content">
+</pre>
+  <iframe id="testframe"></iframe>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_bug704320_https_https.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=704320
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 704320 - HTTPS to HTTPS</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="referrerHelper.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+
+<script type="application/javascript;version=1.7">
+
+var testIframeUrls = [
+  // HTTPS to HTTPS
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin',
+  'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin'
+];
+
+SimpleTest.waitForExplicitFinish();
+var advance = function() { tests.next(); };
+
+/**
+ * This is the main test routine -- serialized by use of a generator.
+ * It performs all tests in sequence using in the same iframe.
+ */
+var tests = (function() {
+  var iframe = document.getElementById("testframe");
+  iframe.onload = function() {
+     advance();
+  }
+
+  // load the test frame from testIframeUrls[url]
+  // it will call back into this function via postMessage when it finishes loading.
+  // and continue beyond the yield.
+  for(url in testIframeUrls) {
+    yield iframe.src = testIframeUrls[url];
+    // run test and check result for loaded test URL
+    yield checkExpectedGlobalResults();
+  }
+
+  // complete.  Be sure to yield so we don't call this twice.
+  yield SimpleTest.finish();
+})();
+
+</script>
+</head>
+
+<body onload="tests.next();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320 - HTTPS to HTTPS</a>
+<p id="display"></p>
+<pre id="content">
+</pre>
+  <iframe id="testframe"></iframe>
+
+</body>
+</html>
+
--- a/dom/base/test/test_bug704320_policyset.html
+++ b/dom/base/test/test_bug704320_policyset.html
@@ -32,66 +32,66 @@ var tests = (function() {
   yield resetCounter();
 
   // load the first test frame
   // it will call back into this function via postMessage when it finishes loading.
   // and continue beyond the yield.
   yield iframe.src = sjs + "&policy=" + escape('default');
 
   // check the first test (two images, no referrers)
-  yield checkResults("default", ["full"]);
+  yield checkIndividualResults("default", ["full"]);
 
   // check invalid policy
   // According to the spec section 6.4, if there is a policy token
   // and it is not one of the expected tokens, "No Referrer"
   // should be the policy used.
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('invalid-policy');
-  yield checkResults("invalid", ["none"]);
+  yield checkIndividualResults("invalid", ["none"]);
 
   // whitespace checks.
   // according to the spec section 4.1, the content attribute's value
   // is fed to the token policy algorithm after stripping leading and
   // trailing whitespace.
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('default   ');
-  yield checkResults("trailing whitespace", ["full"]);
+  yield checkIndividualResults("trailing whitespace", ["full"]);
 
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' origin\f');
-  yield checkResults("trailing form feed", ["origin"]);
+  yield checkIndividualResults("trailing form feed", ["origin"]);
 
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('\f origin');
-  yield checkResults("leading form feed", ["origin"]);
+  yield checkIndividualResults("leading form feed", ["origin"]);
 
   // origin when cross-origin (trimming whitespace)
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' origin-when-cross-origin');
-  yield checkResults("origin-when-cross-origin", ["origin", "full"]);
+  yield checkIndividualResults("origin-when-cross-origin", ["origin", "full"]);
 
   // according to the spec section 4.1:
   // "If the meta element lacks a content attribute, or if that attribute’s
   //  value is the empty string, then abort these steps."
   // This means empty or missing content attribute means to ignore the meta
   // tag and use default policy.
   // Whitespace here is space, tab, LF, FF and CR.
   // http://www.w3.org/html/wg/drafts/html/CR/infrastructure.html#space-character
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' \t  ');
-  yield checkResults("basic whitespace only policy", ["full"]);
+  yield checkIndividualResults("basic whitespace only policy", ["full"]);
 
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' \f\r\n\t  ');
-  yield checkResults("whitespace only policy", ["full"]);
+  yield checkIndividualResults("whitespace only policy", ["full"]);
 
   // and double-check that no-referrer works.
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('no-referrer');
-  yield checkResults("no-referrer", ["none"]);
+  yield checkIndividualResults("no-referrer", ["none"]);
 
   // complete.  Be sure to yield so we don't call this twice.
   yield SimpleTest.finish();
 })();
 
 </script>
 </head>
 
--- a/dom/base/test/test_bug704320_preload.html
+++ b/dom/base/test/test_bug704320_preload.html
@@ -4,42 +4,25 @@
 This is a spot check for whether the speculative parser reuses style, script or image loads after the referrer policy has changed.
 https://bugzilla.mozilla.org/show_bug.cgi?id=704320
 -->
 
 <head>
   <meta charset="utf-8">
   <title>Test preloads for Bug 704320</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="referrerHelper.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
 <script type="application/javascript;version=1.7">
 
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
- * Listen for notifications from the child.
- * These are sent in case of error, or when the loads we await have completed.
- */
-window.addEventListener("message", function(event) {
-    if (event.data == "childLoadComplete") {
-      // all three loads happen, continue the test.
-      advance();
-    } else if (event.data == "childOverload") {
-      // too many loads happened in a test frame, abort.
-      ok(false, "Too many load handlers called in test.");
-      SimpleTest.finish();
-    } else if (event.data.indexOf("fail-") == 0) {
-      // something else failed in the test frame, abort.
-      ok(false, "Child failed the test with error " + event.data.substr(5));
-      SimpleTest.finish();
-    }});
-
-/**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
 var tests = (function() {
   var iframe = document.getElementById("testframe");
 
   // reset the counter
@@ -133,43 +116,16 @@ function finalizePreloadReuse(results) {
        "No loads for " + x + " should have a missing referrer.");
     is(results[x].referrers.indexOf('full'), -1,
        "No loads for " + x + " should have an 'full' referrer.")
   }
 
   advance();
 }
 
-/**
- * helper to perform an XHR.
- * Used by resetCounter() and checkResults().
- */
-function doXHR(url, onSuccess, onFail) {
-  var xhr = new XMLHttpRequest();
-  xhr.onload = function () {
-    if (xhr.status == 200) {
-      onSuccess(xhr);
-    } else {
-      onFail(xhr);
-    }
-  };
-  xhr.open('GET', url, true);
-  xhr.send(null);
-}
-
-/**
- * This triggers state-resetting on the counter server.
- */
-function resetCounter() {
-  doXHR('/tests/dom/base/test/bug704320_counter.sjs?reset',
-        advance,
-        function(xhr) {
-          ok(false, "Need to be able to reset the request counter");
-        });
-}
 
 /**
  * Grabs the results via XHR and passes to checker.
  */
 function checkResults(checker) {
   doXHR('/tests/dom/base/test/bug704320_counter.sjs?results',
         function(xhr) {
           checker(JSON.parse(xhr.responseText));