blob: 78ba5f6e401dadf43034c772118bba466e678131 [file] [log] [blame]
<!doctype html>
<title>Set location.protocol from an HTTP URL</title>
<!-- In particular, valid non-broken schemes that are nevertheless not going to work -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<iframe src=/common/blank.html></iframe>
<script>
self.onload = () => {
[
'x',
'data',
'file',
'ftp',
'http+x'
].forEach((val, index) => {
async_test((t) => {
self[index].location.protocol = val
t.step_timeout(() => {
assert_equals(self[index].location.protocol, location.protocol)
assert_equals(self[index].location.host, location.host)
assert_equals(self[index].location.port, location.port)
t.done()
}, 500)
}, "Set location.protocol to " + val)
})
}
</script>