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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/registering-custom-elements/definition-construction-algorithm-duplicate-definition.html

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Check duplicate definition</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="If there already exists a definition with the same TYPE, set ERROR to DuplicateDefinition and stop">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-custom- elements">
8 <script src="../../../../resources/testharness.js"></script>
9 <script src="../../../../resources/testharnessreport.js"></script>
10 <script src="../testcommon.js"></script>
11 <link rel="stylesheet" href="../../../../resources/testharness.css">
12 </head>
13 <body>
14 <div id="log"></div>
15 <script>
16 test(function() {
17 var doc = newHTMLDocument();
18 var name = 'x-a';
19 doc.registerElement(name);
20 assert_throws('NotSupportedError', function() {
21 doc.registerElement(name);
22 }, 'Exception should be thrown if definition with the same type already exis ts');
23 }, 'Check duplicate definition');
24
25
26 test(function() {
27 var doc = newHTMLDocument();
28 var name = 'x-b';
29 doc.registerElement(name);
30 HTML5_ELEMENTS.forEach(function(tagName) {
31 assert_throws('NotSupportedError', function() {
32 doc.registerElement(name, {
33 extends: tagName
34 });
35 }, 'Exception should be thrown if definition with the same type already exists');
36 });
37 }, 'Check duplicate definition. Specify constructor');
38
39
40 test(function() {
41 var doc = newHTMLDocument();
42 var name = 'x-c';
43 doc.registerElement(name, {
44 prototype: Object.create(HTMLAnchorElement.prototype),
45 extends: 'a'
46 });
47 HTML5_ELEMENTS.forEach(function(tagName) {
48 assert_throws('NotSupportedError', function() {
49 doc.registerElement(name, {
50 extends: tagName
51 });
52 }, 'Exception should be thrown if definition with the same type already exists');
53 });
54 }, 'Check duplicate definition. Test different prototypes and extends');
55 </script>
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698