OLD | NEW |
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 <body> | 4 <body> |
5 <script> | 5 <script> |
6 test(function () { | 6 test(function () { |
7 var A = document.register('x-a'); | 7 var A = document.registerElement('x-a'); |
8 assert_equals(A.prototype.constructor, A, | 8 assert_equals(A.prototype.constructor, A, |
9 'the default prototype\'s constructor should be the ' + | 9 'the default prototype\'s constructor should be the ' + |
10 'generated constructor'); | 10 'generated constructor'); |
11 | 11 |
12 assert_true(A.prototype instanceof HTMLElement, | 12 assert_true(A.prototype instanceof HTMLElement, |
13 'the default prototype should be HTMLElement'); | 13 'the default prototype should be HTMLElement'); |
14 | 14 |
15 function m() { } | 15 function m() { } |
16 A.prototype.myMethod = m; | 16 A.prototype.myMethod = m; |
17 var x = new A(); | 17 var x = new A(); |
18 assert_equals(x.myMethod, m, | 18 assert_equals(x.myMethod, m, |
19 'the element should get methods from the default prototype'); | 19 'the element should get methods from the default prototype'); |
20 }, 'a default prototype object should be provided if one is not specified'); | 20 }, 'a default prototype object should be provided if one is not specified'); |
21 </script> | 21 </script> |
OLD | NEW |