Chromium Code Reviews

Side by Side Diff: LayoutTests/fast/dom/Document/location-unforgeable.html

Issue 884213006: Make document.location unforgeable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
(Empty)
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 obje ct 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>
OLDNEW

Powered by Google App Engine