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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-in-page-navigation.php

Issue 2472963002: Suborigins should not crash fragment navigations. (Closed)
Patch Set: history.pushState Created 4 years, 1 month 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 | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <?php
2 header("Suborigin: foo");
3 ?>
4 <!DOCTYPE html>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <body>
8 <a id="bar"></a>
9 <script>
10 window.onload = _ => {
11 async_test(t => {
12 history.pushState({"name": "value"}, "navigation", "foo.html");
13 history.pushState({"name": "value"}, "navigation", "bar.html");
14 assert_equals(window.location.href, "http://127.0.0.1:8000/security/subori gins/bar.html");
15
16 window.addEventListener("popstate", t.step_func(e => {
17 if (e.state) {
18 assert_equals(window.location.href, "http://127.0.0.1:8000/security/su borigins/foo.html");
19 assert_equals(e.state.name, "value");
20 t.done();
21 }
22 }));
23
24 history.back();
25 }, "History state manipulation is allowed in suborigins.");
26
27 async_test(t => {
28 var original = window.location.href;
29 window.location.hash = "bar";
30 assert_equals(window.location.href, original + "#bar");
31
32 window.addEventListener("hashchange", t.step_func_done(e => {
33 assert_equals(e.newURL, original + "#bar");
34 }));
35 }, "Hash navigations are allowed in suborigins.");
36 };
37 </script>
38 </body>
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698