blob: 9c99380fc8f9a8f8f338bbc1a1ccb5cd4d7f92a6 [file] [log] [blame]
<!DOCTYPE html>
<title>Geolocation On An Insecure Origin</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/get-host-info.js"></script>
<script>
if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname;
} else {
if (window.testRunner)
testRunner.overridePreference("WebKitStrictPowerfulFeatureRestrictions", true);
async_test(function() {
navigator.geolocation.getCurrentPosition(
this.step_func(function() {
assert_unreached('getCurrentPosition should fail, but succeeded.');
this.done();
}),
this.step_func(function(error) {
assert_equals(error.message, 'Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).');
this.done();
}));
}, 'getCurrentPosition');
async_test(function() {
navigator.geolocation.watchPosition(
this.step_func(function() {
assert_unreached('watchPosition should fail, but succeeded.');
this.done();
}),
this.step_func(function(error) {
assert_equals(error.message, 'Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).');
this.done();
}));
}, 'watchPosition');
}
</script>