haikuwebkit/LayoutTests/js/navigator-set-geolocation-e...

16 lines
448 B
Plaintext
Raw Permalink Normal View History

Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype https://bugs.webkit.org/show_bug.cgi?id=154304 <rdar://problem/24685092> Reviewed by Gavin Barraclough. LayoutTests/imported/w3c: Rebaseline test now that more checks are passing. * web-platform-tests/html/dom/interfaces-expected.txt: Source/WebCore: 1. Drop the [Replaceable] IDL extended attribute for navigator.geolocation as this does not match other browsers or the specification: - https://dev.w3.org/geo/api/spec-source.html#geolocation_interface 2. Move Navigator attributes to the prototype, where they should be as per the Web IDL specification. The previous behavior was meant as a workaround for a bug in the Amazon iOS app (rdar://problem/16332749). However, I have confirmed that the latest Amazon App no longer has any issue with those changes. Test: js/navigator-set-geolocation.html * Modules/geolocation/NavigatorGeolocation.idl: * bindings/scripts/CodeGeneratorJS.pm: (InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted. LayoutTests: * fast/dom/Geolocation/enabled-expected.txt: * fast/dom/Geolocation/script-tests/enabled.js: * js/dom/delete-syntax-expected.txt: * js/dom/script-tests/delete-syntax.js: Update tests as they expected the navigator properties to be on the instance rather than the prototype. * js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Removed. * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Removed. * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Removed. Drop outdated test. * js/navigator-set-geolocation-expected.txt: Added. * js/navigator-set-geolocation.html: Added. Add test to make sure that Navigator.geolocation cannot be set. I verified that this test passes in both Firefox and Chrome. Canonical link: https://commits.webkit.org/172433@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-17 01:11:29 +00:00
Tests that navigator.geolocation cannot be shadowed.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
* Strict mode
PASS navigator.geolocation = 1 threw exception TypeError: Attempted to assign to readonly property..
PASS navigator.geolocation is not 1
* Non-Strict mode
PASS navigator.geolocation = 1 did not throw exception.
PASS navigator.geolocation is not 1
PASS successfullyParsed is true
TEST COMPLETE