Backed out changeset d2cecf099715 (bug 1192940) for wptlint failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 22 Mar 2017 12:03:04 +0100
changeset 379185 ccd778892fcf082fac94b499d0fada57dd2b712a
parent 379184 d01bf6283507b6820bd0961173426d6c21ebfc50
child 379186 44f9af6ad433e022479f2e32fb499036ee1440d5
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1192940
milestone53.0
backs outd2cecf0997150e0d18e459d058db82b5253dc9f8
Backed out changeset d2cecf099715 (bug 1192940) for wptlint failures
dom/base/Navigator.cpp
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html.ini
testing/web-platform/meta/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html.ini
testing/web-platform/meta/beacon/headers/header-referrer-strict-origin.https.html.ini
testing/web-platform/meta/beacon/headers/header-referrer-unsafe-url.https.html.ini
testing/web-platform/tests/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html
testing/web-platform/tests/beacon/headers/header-referrer-no-referrer.html
testing/web-platform/tests/beacon/headers/header-referrer-origin-when-cross-origin.html
testing/web-platform/tests/beacon/headers/header-referrer-origin.html
testing/web-platform/tests/beacon/headers/header-referrer-same-origin.html
testing/web-platform/tests/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html
testing/web-platform/tests/beacon/headers/header-referrer-strict-origin.https.html
testing/web-platform/tests/beacon/headers/header-referrer-unsafe-url.https.html
testing/web-platform/tests/beacon/headers/header-referrer.js
testing/web-platform/tests/beacon/resources/inspect-header.py
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1290,19 +1290,17 @@ Navigator::SendBeacon(const nsAString& a
   }
 
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(channel);
   if (!httpChannel) {
     // Beacon spec only supports HTTP requests at this time
     aRv.Throw(NS_ERROR_DOM_BAD_URI);
     return false;
   }
-  mozilla::net::ReferrerPolicy referrerPolicy = doc->GetReferrerPolicy();
-  rv = httpChannel->SetReferrerWithPolicy(documentURI, referrerPolicy);
-  MOZ_ASSERT(NS_SUCCEEDED(rv));
+  httpChannel->SetReferrer(documentURI);
 
   nsCString mimeType;
   if (!aData.IsNull()) {
     nsCOMPtr<nsIInputStream> in;
 
     if (aData.Value().IsString()) {
       nsCString stringData = NS_ConvertUTF16toUTF8(aData.Value().GetAsString());
       nsCOMPtr<nsIStringInputStream> strStream = do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID, &rv);
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -17556,26 +17556,16 @@
      {}
     ]
    ],
    "battery-status/support-window-open.html": [
     [
      {}
     ]
    ],
-   "beacon/headers/header-referrer.js": [
-    [
-     {}
-    ]
-   ],
-   "beacon/resources/inspect-header.py": [
-    [
-     {}
-    ]
-   ],
    "bluetooth/bluetooth-helpers.js": [
     [
      {}
     ]
    ],
    "clear-site-data/support/echo-clear-site-data.py": [
     [
      {}
@@ -80667,64 +80657,16 @@
     ]
    ],
    "battery-status/battery-promise.html": [
     [
      "/battery-status/battery-promise.html",
      {}
     ]
    ],
-   "beacon/headers/header-referrer-no-referrer-when-downgrade.https.html": [
-    [
-     "/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-no-referrer.html": [
-    [
-     "/beacon/headers/header-referrer-no-referrer.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-origin-when-cross-origin.html": [
-    [
-     "/beacon/headers/header-referrer-origin-when-cross-origin.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-origin.html": [
-    [
-     "/beacon/headers/header-referrer-origin.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-same-origin.html": [
-    [
-     "/beacon/headers/header-referrer-same-origin.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html": [
-    [
-     "/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-strict-origin.https.html": [
-    [
-     "/beacon/headers/header-referrer-strict-origin.https.html",
-     {}
-    ]
-   ],
-   "beacon/headers/header-referrer-unsafe-url.https.html": [
-    [
-     "/beacon/headers/header-referrer-unsafe-url.https.html",
-     {}
-    ]
-   ],
    "clear-site-data/navigation.html": [
     [
      "/clear-site-data/navigation.html",
      {}
     ]
    ],
    "compat/webkit-text-fill-color-currentColor.html": [
     [
@@ -136570,56 +136512,16 @@
   "battery-status/support-iframe.html": [
    "3c203529afca2f6b2a075eb8a42bf2206e4f16af",
    "support"
   ],
   "battery-status/support-window-open.html": [
    "61b61d09a21daee964e0ebd26f7bdfdd1964c8ae",
    "support"
   ],
-  "beacon/headers/header-referrer-no-referrer-when-downgrade.https.html": [
-   "273c7d0110d5efc9fac0029cd257256894d3eb4b",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-no-referrer.html": [
-   "26a0a9453b36efbadb05c8185efe7f9a0d9d54c9",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-origin-when-cross-origin.html": [
-   "9633758fe59279cfe93333989d26c017f59ab2ac",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-origin.html": [
-   "1329850363c327533f50e509c6a48f6e4b1ed4bb",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-same-origin.html": [
-   "9701f2f0a83c6eeefe781d7de2c0cdbcff38b58e",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html": [
-   "79b4a278f0e35646cfdffeebf8f0523e2772bc9b",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-strict-origin.https.html": [
-   "295ef746c475fca0ae8b492375a48948b4ea19c3",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer-unsafe-url.https.html": [
-   "a7b6e697be165124ed5d6846335c8d3a38ee98f5",
-   "testharness"
-  ],
-  "beacon/headers/header-referrer.js": [
-   "1836174ce84714c39333a4cf863ec994ed70ff93",
-   "support"
-  ],
-  "beacon/resources/inspect-header.py": [
-   "e70503e7fb71617b9be631d5f2a9e73cacd83e3f",
-   "support"
-  ],
   "bluetooth/bluetooth-helpers.js": [
    "f071d5f76a960d7a973402cbfdcd6f664812fd34",
    "support"
   ],
   "clear-site-data/navigation.html": [
    "daf340429ca71997c7d9c6021354522f0285c4d1",
    "testharness"
   ],
@@ -161594,17 +161496,17 @@
   "geolocation-API/getCurrentPosition_permission_allow.html": [
    "695f80f5a06279b3a0bdd137e6a402da66a5eeee",
    "testharness"
   ],
   "geolocation-API/getCurrentPosition_permission_deny-manual.html": [
    "44b2d8846c79ddf7eb8cb3ab76d8899b7e783fad",
    "manual"
   ],
-  "geolocation-API/getCurrentPosition_permission_deny.https.html": [
+  "geolocation-API/getCurrentPosition_permission_deny.html": [
    "28939dd8e719ba66497a814edd1f4500ad348e95",
    "testharness"
   ],
   "geolocation-API/interfaces.html": [
    "c5e300b504b6bf75818fbe79728c87b086ccce3d",
    "testharness"
   ],
   "geolocation-API/support.js": [
@@ -214687,17 +214589,17 @@
    "cfaa1c59bdfefe7682fd73152e2d4a706a415aaa",
    "support"
   ],
   "webvtt/webvtt-file-format-parsing/webvtt-file-parsing/support/ids.vtt": [
    "e94efc2cea87f5ebaba3d7a46bdfe1f74cd556ef",
    "support"
   ],
   "webvtt/webvtt-file-format-parsing/webvtt-file-parsing/support/newlines.vtt": [
-   "a5bfb88a0066da230fbf05f0cf9d200f73c0bb12",
+   "ba3848383a2197647a9c34c52150991ecb87f22a",
    "support"
   ],
   "webvtt/webvtt-file-format-parsing/webvtt-file-parsing/support/no-signature.vtt": [
    "71ffec71e6a8923027309dd41c591302ac880550",
    "support"
   ],
   "webvtt/webvtt-file-format-parsing/webvtt-file-parsing/support/nulls.vtt": [
    "140e16000f93f8565c28c2fd12a638afcc6bbf05",
deleted file mode 100644
--- a/testing/web-platform/meta/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[header-referrer-no-referrer-when-downgrade.https.html]
-  type: testharness
-  prefs: [security.mixed_content.block_active_content:false, security.mixed_content.block_display_content:false]
deleted file mode 100644
--- a/testing/web-platform/meta/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[header-referrer-strict-origin-when-cross-origin.https.html]
-  type: testharness
-  prefs: [security.mixed_content.block_active_content:false, security.mixed_content.block_display_content:false]
-
deleted file mode 100644
--- a/testing/web-platform/meta/beacon/headers/header-referrer-strict-origin.https.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[header-referrer-strict-origin.https.html]
-  type: testharness
-  prefs: [security.mixed_content.block_active_content:false, security.mixed_content.block_display_content:false]
deleted file mode 100644
--- a/testing/web-platform/meta/beacon/headers/header-referrer-unsafe-url.https.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[header-referrer-unsafe-url.https.html]
-  type: testharness
-  prefs: [security.mixed_content.block_active_content:false, security.mixed_content.block_display_content:false]
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header No Referrer When Downgrade Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='no-referrer-when-downgrade'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="/beacon/headers/header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTPS_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerUrl);
-      testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, "");
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-no-referrer.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header No Referrer Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='no-referrer'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="header-referrer.js"></script>
-    <script>
-      var testBase = RESOURCES_DIR;
-      testReferrerHeader(testBase, "");
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-origin-when-cross-origin.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Origin When Cross Origin Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='origin-when-cross-origin'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerUrl);
-      testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerOrigin);
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-origin.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Origin Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='origin'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerOrigin);
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-same-origin.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Same Origin Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='same-origin'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="header-referrer.js"></script>
-    <script>
-      var testBase = RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerUrl);
-      testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, "");
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Strict Origin Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='strict-origin'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="/beacon/headers/header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTPS_ORIGIN +  RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerOrigin);
-      testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, "");
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-strict-origin.https.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Strict Origin Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='strict-origin'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="/beacon/headers/header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTPS_ORIGIN +  RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerOrigin);
-      testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, "");
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer-unsafe-url.https.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>SendBeacon Referrer Header Unsafe Url Policy</title>
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <meta name='referrer' content='unsafe-url'>
-  </head>
-  <body>
-    <script src="/common/utils.js"></script>
-    <script src="/common/get-host-info.sub.js"></script>
-    <script src="/beacon/headers/header-referrer.js"></script>
-    <script>
-      var testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
-      testReferrerHeader(testBase, referrerUrl);
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/headers/header-referrer.js
+++ /dev/null
@@ -1,41 +0,0 @@
-var RESOURCES_DIR = "/beacon/resources/";
-
-var referrerOrigin = self.location.origin + '/';
-var referrerUrl = self.location.href;
-
-function testReferrerHeader(testBase, expectedReferrer) {
-  var id = self.token();
-  var testUrl = testBase + "inspect-header.py?header=referer&cmd=put&id=" + id;
-
-  promise_test(function(test) {
-    assert_true(navigator.sendBeacon(testUrl), "SendBeacon Succeeded");
-    return pollResult(expectedReferrer, id) .then(result => {
-      assert_equals(result, expectedReferrer, "Correct referrer header result");
-    });
-  }, "Successful test ");
-}
-
-// SendBeacon is an asynchronous and non-blocking request to a web server.
-// We may have to create a poll loop to get result from server
-function pollResult(expectedReferrer, id) {
-  var checkUrl = RESOURCES_DIR + "inspect-header.py?header=referer&cmd=get&id=" + id;
-
-  return new Promise(resolve => {
-    function checkResult() {
-      fetch(checkUrl).then(
-        function(response) {
-          assert_equals(response.status, 200, "Inspect header response's status is 200");
-          let result = response.headers.get("x-request-referer");
-
-          if (result != undefined) {
-            resolve(result);
-          } else {
-            step_timeout(checkResult.bind(this), 100);
-          }
-        });
-    }
-
-    checkResult();
-  });
-
-}
deleted file mode 100644
--- a/testing/web-platform/tests/beacon/resources/inspect-header.py
+++ /dev/null
@@ -1,18 +0,0 @@
-def main(request, response):
-    headers = [("Content-Type", "text/plain")]
-    command = request.GET.first("cmd").lower();
-    test_id = request.GET.first("id")
-    header = request.GET.first("header")
-    if command == "put":
-        request.server.stash.put(test_id, request.headers.get(header, ""))
-
-    elif command == "get":
-        stashed_header = request.server.stash.take(test_id)
-        if stashed_header is not None:
-            headers.append(("x-request-" + header, stashed_header ))
-
-    else:
-        response.set_error(400, "Bad Command")
-        return "ERROR: Bad Command!"
-
-    return headers, ""