Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Document / location-unforgeable.html
blobac764ac582e792eb5b06e2801a0a54cf7d38ac94
1 <!DOCTYPE html>
2 <title>Document has an unforgeable attribute location</title>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script>
6 // https://html.spec.whatwg.org/#document
7 // https://heycam.github.io/webidl/#Unforgeable
8 test(function() {
9 assert_true(document.hasOwnProperty("location"), "property exist on the object itself");
10 var descriptor = Object.getOwnPropertyDescriptor(document, "location");
11 assert_false(descriptor.configurable, "property is not configurable");
12 assert_throws(new TypeError(), function() {
13 Object.defineProperty(document, "location", {get: function () {}});
14 }, "attempting to modify property throws TypeError");
15 });
16 </script>