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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../../resources/js-test.js"></script> 3 <script src="../../../../resources/js-test.js"></script>
4 <script src="resources/location-tests-functions.js"></script> 4 <script src="resources/location-tests-functions.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 window.location.valueOf = function() { return "haxored"; } 8 window.location.valueOf = function() { return "haxored"; }
9 9
10 var result = normalizeURL(String(window.location)); 10 var result = normalizeURL(String(window.location));
11 var correctValue = normalizeURL(document.URL); 11 var correctValue = normalizeURL(document.URL);
12 shouldBe("result", "correctValue"); 12 shouldBe("result", "correctValue");
13 result = normalizeURL(String(window.location.valueOf()));
14 shouldBe("result", "correctValue");
15 shouldThrow("(function() { 'use strict'; location.valueOf = 'haxored'; retur n location.valueOf(); }())");
16 shouldNotThrow("(function() { location.valueOf = 'haxored'; return location. valueOf(); }())");
17 shouldThrow("(function() { 'use strict'; delete location.valueOf; }())");
18 shouldBe("(function() { delete location.valueOf; return !!location.valueOf}( ))", "true");
13 </script> 19 </script>
14 </body> 20 </body>
15 </html> 21 </html>
OLDNEW
« 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