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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/custom-elements/resources/custom-elements-helpers.js

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: 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
OLDNEW
1 function create_window_in_test(t, srcdoc) { 1 function create_window_in_test(t, srcdoc) {
2 let p = new Promise((resolve) => { 2 let p = new Promise((resolve) => {
3 let f = document.createElement('iframe'); 3 let f = document.createElement('iframe');
4 f.srcdoc = srcdoc ? srcdoc : ''; 4 f.srcdoc = srcdoc ? srcdoc : '';
5 f.onload = (event) => { 5 f.onload = (event) => {
6 let w = f.contentWindow; 6 let w = f.contentWindow;
7 t.add_cleanup(() => f.parentNode && f.remove()); 7 t.add_cleanup(() => f.parentNode && f.remove());
8 resolve(w); 8 resolve(w);
9 }; 9 };
10 document.body.appendChild(f); 10 document.body.appendChild(f);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 connectedCallback() { log.push({type: 'connected', element: this}); } 58 connectedCallback() { log.push({type: 'connected', element: this}); }
59 disconnectedCallback() { log.push({type: 'disconnected', element: this}) ; } 59 disconnectedCallback() { log.push({type: 'disconnected', element: this}) ; }
60 adoptedCallback(oldDocument, newDocument) { log.push({type: 'adopted', e lement: this, oldDocument: oldDocument, newDocument: newDocument}); } 60 adoptedCallback(oldDocument, newDocument) { log.push({type: 'adopted', e lement: this, oldDocument: oldDocument, newDocument: newDocument}); }
61 } 61 }
62 CustomElement.observedAttributes = observedAttributes; 62 CustomElement.observedAttributes = observedAttributes;
63 63
64 customElements.define(name, CustomElement); 64 customElements.define(name, CustomElement);
65 65
66 return { 66 return {
67 name: name, 67 name: name,
68 class: CustomElement,
68 takeLog: function () { 69 takeLog: function () {
69 let currentLog = log; log = []; 70 let currentLog = log; log = [];
70 currentLog.types = () => currentLog.map((entry) => entry.type); 71 currentLog.types = () => currentLog.map((entry) => entry.type);
71 currentLog.last = () => currentLog[currentLog.length - 1]; 72 currentLog.last = () => currentLog[currentLog.length - 1];
72 return currentLog; 73 return currentLog;
73 } 74 }
74 }; 75 };
75 } 76 }
76 define_new_custom_element._element_number = 1; 77 define_new_custom_element._element_number = 1;
77 78
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 xhr.overrideMimeType('text/xml'); 154 xhr.overrideMimeType('text/xml');
154 xhr.onload = function () { resolve(xhr.responseXML); } 155 xhr.onload = function () { resolve(xhr.responseXML); }
155 xhr.onerror = function () { reject('Failed to fetch the docu ment'); } 156 xhr.onerror = function () { reject('Failed to fetch the docu ment'); }
156 xhr.send(); 157 xhr.send();
157 }); 158 });
158 }, 159 },
159 hasBrowsingContext: false, 160 hasBrowsingContext: false,
160 } 161 }
161 ]; 162 ];
162 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698