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

Side by Side Diff: LayoutTests/fast/dom/custom/resources/document-register-fuzz.js

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 1
2 function setupObjectHooks(hooks) 2 function setupObjectHooks(hooks)
3 { 3 {
4 // Wrapper for these object should be materialized before setting hooks. 4 // Wrapper for these object should be materialized before setting hooks.
5 console.log; 5 console.log;
6 document.register; 6 document.register;
7 HTMLSpanElement.prototype; 7 HTMLSpanElement.prototype;
8 8
9 Object.defineProperty(Object.prototype, "prototype", { 9 Object.defineProperty(Object.prototype, "prototype", {
10 get: function() { return hooks.prototypeGet(); }, 10 get: function() { return hooks.prototypeGet(); },
(...skipping 11 matching lines...) Expand all
22 function exerciseDocumentRegister() 22 function exerciseDocumentRegister()
23 { 23 {
24 register('x-a', {}); 24 register('x-a', {});
25 register('x-b', {prototype: Object.create(HTMLElement.prototype)}); 25 register('x-b', {prototype: Object.create(HTMLElement.prototype)});
26 } 26 }
27 27
28 function register(name, options) 28 function register(name, options)
29 { 29 {
30 var myConstructor = null; 30 var myConstructor = null;
31 try { 31 try {
32 myConstructor = document.register(name, options); 32 myConstructor = document.registerElement(name, options);
33 } catch (e) { } 33 } catch (e) { }
34 34
35 try { 35 try {
36 if (!myConstructor) { 36 if (!myConstructor) {
37 debug("Constructor object isn't created."); 37 debug("Constructor object isn't created.");
38 return; 38 return;
39 } 39 }
40 40
41 if (myConstructor.prototype != options.prototype) { 41 if (myConstructor.prototype != options.prototype) {
42 console.log("FAIL: bad prototype"); 42 console.log("FAIL: bad prototype");
43 return; 43 return;
44 } 44 }
45 45
46 var element = new myConstructor(); 46 var element = new myConstructor();
47 if (!element) 47 if (!element)
48 return; 48 return;
49 if (element.constructor != myConstructor) { 49 if (element.constructor != myConstructor) {
50 console.log("FAIL: bad constructor"); 50 console.log("FAIL: bad constructor");
51 return; 51 return;
52 } 52 }
53 } catch (e) { console.log(e); } 53 } catch (e) { console.log(e); }
54 } 54 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/custom/registration-context-sharing.html ('k') | LayoutTests/fast/dom/custom/type-extensions.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698