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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/leaktests/window-frames.html

Issue 2015623004: Import wpt@ed94c51f3dfaa5ff4c9c311add1a560408059c51 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 <html>
3 <head>
4 <meta name='author' title='Google' href='http://www.google.com'>
5 <meta name='assert' content='Shadow DOM should not leak via window.frames.'>
6 <link rel='help' href='https://w3c.github.io/webcomponents/spec/shadow/'>
7 <script src='../../../../resources/testharness.js'></script>
8 <script src='../../../../resources/testharnessreport.js'></script>
9 </head>
10 <body>
11 <div id='log'></div>
12 <iframe src='about:blank' name='mainFrame1'></iframe>
13 <div id='host-open'></div>
14 <div id='host-closed'></div>
15 </body>
16 <script>
17 'use strict';
18
19 var host_open = document.getElementById('host-open');
20 var root_open = host_open.attachShadow({mode: 'open'});
21 root_open.innerHTML = '<iframe src="about:blank" name="shadowFrame1"></iframe>';
22
23 var host_closed = document.getElementById('host-closed');
24 var root_closed = host_closed.attachShadow({mode: 'closed'});
25 root_closed.innerHTML = '<iframe src="about:blank" name="shadowFrame2"></iframe> ';
26
27 test(() => {
28 assert_equals(window.frames.length, 1, 'window.frames should return only frame s in document.');
29 assert_equals(window.frames[0].name, 'mainFrame1', 'window.frames[0] should be mainFrame1.');
30 assert_equals(window.frames['mainFrame1'], window.frames[0], 'window.frames[\' mainFrame1\'] should be equal to mainFrame1.');
31 assert_equals(window.frames['shadowFrame1'], undefined, 'shadowFrame1 should n ot leak.');
32 assert_equals(window.frames['shadowFrame2'], undefined, 'shadowFrame2 should n ot leak.');
33
34 }, 'window.frames should not leak frames in Shadow DOM.');
35 </script>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698