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

Unified Diff: LayoutTests/fast/dom/Window/Location/location-override-valueOf.html

Issue 938593002: [LayoutTests] Add missing location.valueOf override tests to verify unforgeable behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding deletion test cases! 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/Window/Location/location-override-valueOf-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/Location/location-override-valueOf.html
diff --git a/LayoutTests/fast/dom/Window/Location/location-override-valueOf.html b/LayoutTests/fast/dom/Window/Location/location-override-valueOf.html
index 2ec9888beb74138a47bd73882aadcd7969e7fd11..2d28c2e80dd0f8473c574ed47cbc7e95b31fab16 100644
--- a/LayoutTests/fast/dom/Window/Location/location-override-valueOf.html
+++ b/LayoutTests/fast/dom/Window/Location/location-override-valueOf.html
@@ -10,6 +10,12 @@
var result = normalizeURL(String(window.location));
var correctValue = normalizeURL(document.URL);
shouldBe("result", "correctValue");
+ result = normalizeURL(String(window.location.valueOf()));
+ shouldBe("result", "correctValue");
+ shouldThrow("(function() { 'use strict'; location.valueOf = 'haxored'; return location.valueOf(); }())");
+ shouldNotThrow("(function() { location.valueOf = 'haxored'; return location.valueOf(); }())");
+ shouldThrow("(function() { 'use strict'; delete location.valueOf; }())");
+ shouldBe("(function() { delete location.valueOf; return !!location.valueOf}())", "true");
</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/Location/location-override-valueOf-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698