chromium/third_party/blink/web_tests/http/tests/xmlhttprequest/authorization-header.html

<p>Test that Authorization header can be set via setRequestHeader.</p>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

try {
    var req = new XMLHttpRequest;
    req.open("GET", "resources/basic-auth/basic-auth.php?uid=Authorization-Header", false);
    req.setRequestHeader("Authorization", "Basic QXV0aG9yaXphdGlvbi1IZWFkZXI6QXV0aG9yaXphdGlvbi1IZWFkZXI=");
    req.send(null);
    document.write(req.responseText.match(/Authorization\-Header/) ? "PASS" : ("FAIL. Unexpected response: " + req.responseText));
} catch (ex) {
    document.write("FAIL. Exception: " + ex);
}
</script>