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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-blocks-top-navigation.html

Issue 2371993003: Throw when blocking top-level navigation. (Closed)
Patch Set: Test. Created 4 years, 2 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script>
5 async_test(t => {
6 window.addEventListener("message", t.step_func_done(e => {
7 assert_equals(e.data.name, 'SecurityError', 'Should throw a security error.');
8 assert_equals(e.data.location, 'about:srcdoc', 'Exception is same-or igin with the embedee.');
9 }));
10 }, "Sandboxed frames should throw when navigating the top-level window.");
11 </script>
12 <iframe sandbox="allow-scripts"
13 srcdoc="<script>
14 try {
15 top.location = '/security/frameNavigation/resources/fail.htm l';
16 top.postMessage('No Exception', '*');
17 } catch (e) {
18 top.postMessage({
19 'name': e.name,
20 'location': e.constructor.constructor('return location.hre f')()
Mike West 2016/09/28 12:26:13 Jochen: Does this (and the assertion on #8) addres
21 }, '*');
22 }
23 </script>"></iframe>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698