Part 2: Replace inapplicable tests with a web-platform-test for reloading after setting javascript: URI, and fix other tests relying on javascript: URI.

Some notes about the changes:

Both test_bug384014.html and test_bug123696.html were testing reloading of
javascript: URI. The expected result of the iframes after reloading would
become about:blank. I deleted both file and instead wrote with
web-platform-test to cover reloading of javascript: URI since wpt is more
preferable.

storage-cache-error.html was utilizing javascript: URI to test bug 1262766.
javascript: URI would cause CacheStorage::Keys to throw a dom security
exception because the URI's principal (which did not match the principal of the
document in this case!) was a nullpricipal.  With my patches the iframe's URL
would no longer be the javascript: URI, so it's no longer applicable for the
test case. Instead we can test what bug 1262766 was originally about - that
CacheStorage::Keys would throw a dom security exception if it's in a private
browsing window.

Differential Revision: https://phabricator.services.mozilla.com/D59465

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=836567
gecko-commit: 68447a9ccb6afbde6bf3817c72bae89a5f7d242d
gecko-integration-branch: autoland
gecko-reviewers: Gijs, miker
diff --git a/html/browsers/history/the-location-interface/location_reload_javascript_url.html b/html/browsers/history/the-location-interface/location_reload_javascript_url.html
new file mode 100644
index 0000000..737cafb
--- /dev/null
+++ b/html/browsers/history/the-location-interface/location_reload_javascript_url.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <title>location_reload_javascript_url</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+
+    <iframe></iframe>
+
+    <script>
+    async_test(function(t) {
+      const URL = "/common/blank.html";
+      const URL2 = "/common/blank.html#foo";
+      const JS_URL_TEXT = "javascript generated page";
+      const JS_URL = "javascript:'<html>" + JS_URL_TEXT + "</html>'";
+
+      var iframe = document.querySelector("iframe");
+      var count = 0;
+      iframe.onload = t.step_func(function() {
+        // The URL should initially be "blank.html", and then "blank.html#foo";
+        // The textContent of the iframe's document should initially be blank,
+        // then become js generated text, and then be blank again after reload.
+        switch (count) {
+        case 0:
+          assert_equals(iframe.contentWindow.document.URL,
+                        location.href.replace(location.pathname, URL),
+                        "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent, "",
+                        "text of blank page");
+          iframe.contentWindow.location = JS_URL;
+          iframe.contentWindow.location = URL2;
+          break;
+        case 1:
+          assert_equals(iframe.contentWindow.document.URL,
+                        location.href.replace(location.pathname, URL2),
+                        "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent,
+                        JS_URL_TEXT, "text of js generated page");
+          iframe.contentWindow.location.reload();
+          break;
+        case 2:
+          assert_equals(iframe.contentWindow.document.URL,
+                          location.href.replace(location.pathname, URL2),
+                          "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent, "",
+                        "text of blank page");
+          t.done();
+          break;
+        }
+        count++;
+      });
+      iframe.src = URL;
+    });
+    </script>
+
+  </body>
+</html>