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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/attach-shadow-with-parameter.html

Issue 2333623003: Convert remaining focus tests in shadow-dom to use testharness.js (Closed)
Patch Set: Created 4 years, 3 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 | third_party/WebKit/LayoutTests/shadow-dom/attach-shadow-with-parameter-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 <!doctype html> 1 <!DOCTYPE html>
2 <script src="../resources/js-test.js"></script> 2 <script src='../resources/testharness.js'></script>
3 <script src="../fast/dom/shadow/resources/shadow-dom.js"></script> 3 <script src='../resources/testharnessreport.js'></script>
4 <body> 4 <script src='resources/shadow-dom.js'></script>
5 <div id="host1"></div> 5 <div id='host1'></div>
6 <div id="host2"></div> 6 <div id='host2'></div>
7 <div id="host3"></div> 7 <div id='host3'></div>
8 </body>
9 <script> 8 <script>
10 debug('Attach open shadow root.'); 9 'use strict';
11 var host1 = document.querySelector('#host1');
12 shouldBeNonNull("host1.attachShadow({mode: 'open'})");
13 10
14 debug('Attach closed shadow root.'); 11 test(() => {
15 var host2 = document.querySelector('#host2'); 12 let root1 = host1.attachShadow({mode: 'open'});
16 shouldBeNonNull("host2.attachShadow({mode: 'closed'})"); 13 assert_not_equals(root1, null, 'Attach open shadow root should succeed.');
14 assert_equals(Object.getPrototypeOf(root1), ShadowRoot.prototype,
15 'ShadowRoot object should be returned by attachShadow({mode:"open"}).');
17 16
18 debug('Attach shadow root whose mode is neither open nor closed.'); 17 let root2 = host2.attachShadow({mode: 'closed'});
19 var host4 = document.querySelector('#host3'); 18 assert_not_equals(root2, null, 'Attach closed shadow root should succeed.');
20 shouldThrow("host4.attachShadow({mode: 'illegal'})"); 19 assert_equals(Object.getPrototypeOf(root2), ShadowRoot.prototype,
20 'ShadowRoot object should be returned by attachShadow({mode:"closed"}).' );
21 21
22 debug('Attach open shadow root with shadow-dom.js utility.'); 22 assert_throws({name: 'TypeError'}, () => { host3.attachShadow({mode: 'illega l'}); },
23 document.body.appendChild( 23 'Attach shadow root whose mode is neither open nor closed should throw T ypeError.');
24 createDOM('div', {id: 'host5'},
25 attachShadow({mode: 'open'})));
26 var host5 = document.querySelector('#host5');
27 var root5 = host5.shadowRoot;
28 shouldBeNonNull(root5);
29 24
30 debug('Attach shadow root on already shadowed host will raise InvalidStateError exception.'); 25 assert_throws({name: 'InvalidStateError'}, () => { host1.attachShadow({mode: 'open'}); },
31 shouldThrow("host1.attachShadow({mode: 'open'})"); 26 'Attach shadow on a host which has open shadow root will raise InvalidSt ateError exception.');
27 assert_throws({name: 'InvalidStateError'}, () => { host2.attachShadow({mode: 'open'}); },
28 'Attach shadow on a host wich has closed shadow root will raise InvalidS tateError exception.');
29 }, 'Test for Element.attachShadow() with mode parameter.');
32 </script> 30 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/attach-shadow-with-parameter-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698