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

Side by Side Diff: LayoutTests/fast/dom/custom/entered-left-document.html

Issue 117313008: Update Custom Elements API to new names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update for forgotten tests. Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <script src="test-harness-utils.js"></script> 4 <script src="test-harness-utils.js"></script>
5 <body> 5 <body>
6 <script> 6 <script>
7 (function () { 7 (function () {
8 var t = async_test('entered, left callbacks should only be invoked when ' + 8 var t = async_test('entered, left callbacks should only be invoked when ' +
9 'entering or leaving a document with a view'); 9 'entering or leaving a document with a view');
10 withFrame(t.step_func(function (frame) { 10 withFrame(t.step_func(function (frame) {
11 // Set up a definition 11 // Set up a definition
12 12
13 var docA = frame.contentDocument; 13 var docA = frame.contentDocument;
14 var docB = docA.implementation.createHTMLDocument(); 14 var docB = docA.implementation.createHTMLDocument();
15 15
16 var invocations = []; 16 var invocations = [];
17 function log(msg) { 17 function log(msg) {
18 return function () { invocations.push(msg); }; 18 return function () { invocations.push(msg); };
19 } 19 }
20 20
21 var proto = Object.create(frame.contentWindow.HTMLElement.prototype); 21 var proto = Object.create(frame.contentWindow.HTMLElement.prototype);
22 proto.createdCallback = log('created'); 22 proto.createdCallback = log('created');
23 proto.attributeChangedCallback = log('attribute changed'); 23 proto.attributeChangedCallback = log('attribute changed');
24 proto.enteredViewCallback = log('entered'); 24 proto.attachedCallback = log('entered');
25 proto.leftViewCallback = log('left'); 25 proto.detachedCallback = log('left');
26 26
27 // Created, owned by a document without a view 27 // Created, owned by a document without a view
28 28
29 var A = docB.register('x-a', {prototype: proto}); 29 var A = docB.registerElement('x-a', {prototype: proto});
30 var a = new A(); 30 var a = new A();
31 assert_equals(a.ownerDocument, docB, 31 assert_equals(a.ownerDocument, docB,
32 'new instance should be owned by the document the ' + 32 'new instance should be owned by the document the ' +
33 'definition was registered with'); 33 'definition was registered with');
34 assert_array_equals(invocations, ['created'], 34 assert_array_equals(invocations, ['created'],
35 'calling the constructor should invoke the created ' + 35 'calling the constructor should invoke the created ' +
36 'callback'); 36 'callback');
37 37
38 // Entered document without a view 38 // Entered document without a view
39 39
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 assert_array_equals(invocations, ['entered'], 136 assert_array_equals(invocations, ['entered'],
137 'the entered callback should be invoked when ' + 137 'the entered callback should be invoked when ' +
138 'inserted into a document with a view as part of ' + 138 'inserted into a document with a view as part of ' +
139 'a subtree'); 139 'a subtree');
140 140
141 frame.remove(); 141 frame.remove();
142 t.done(); 142 t.done();
143 })); 143 }));
144 })(); 144 })();
145 </script> 145 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/custom/element-upgrade.html ('k') | LayoutTests/fast/dom/custom/frameElement-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698