Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified 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: drop DoNotCheckSecurity Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLDocument/document-special-properties-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Document/location-unforgeable.html
diff --git a/LayoutTests/fast/dom/Document/location-unforgeable.html b/LayoutTests/fast/dom/Document/location-unforgeable.html
new file mode 100644
index 0000000000000000000000000000000000000000..ac764ac582e792eb5b06e2801a0a54cf7d38ac94
--- /dev/null
+++ b/LayoutTests/fast/dom/Document/location-unforgeable.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>Document has an unforgeable attribute location</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+// https://html.spec.whatwg.org/#document
+// https://heycam.github.io/webidl/#Unforgeable
+test(function() {
+ assert_true(document.hasOwnProperty("location"), "property exist on the object itself");
+ var descriptor = Object.getOwnPropertyDescriptor(document, "location");
+ assert_false(descriptor.configurable, "property is not configurable");
+ assert_throws(new TypeError(), function() {
+ Object.defineProperty(document, "location", {get: function () {}});
+ }, "attempting to modify property throws TypeError");
+});
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLDocument/document-special-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698