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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/instantiating-custom-elements/custom-element-constructor-local-name.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>Custom element constructor sets local name to the name from custom elemen t definition</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru ">
7 <meta name="assert" content="Set ELEMENT's local name to NAME">
8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custo m-elements">
9 <script src="../../../../resources/testharness.js"></script>
10 <script src="../../../../resources/testharnessreport.js"></script>
11 <script src="../testcommon.js"></script>
12 <link rel="stylesheet" href="../../../../resources/testharness.css">
13 </head>
14 <body>
15 <div id="log"></div>
16 <script>
17 test(function() {
18 var doc = newHTMLDocument();
19 var GeneratedConstructor = doc.registerElement('x-a');
20 var customElement = new GeneratedConstructor();
21 assert_equals(customElement.localName, 'x-a',
22 'Custom element local name should be equal to the name in custom element definition');
23 }, 'Custom element constructor sets local name to the name from custom element d efinition');
24
25
26 test(function() {
27 var doc = newHTMLDocument();
28 HTML5_ELEMENTS.forEach(function(tagName) {
29 var obj = doc.createElement(tagName);
30 var name = 'x-b-' + tagName;
31 var proto = Object.create(obj.constructor.prototype);
32 var GeneratedConstructor = doc.registerElement(name, {
33 prototype: proto,
34 extends: tagName
35 });
36 var customElement = new GeneratedConstructor();
37
38 assert_equals(customElement.localName, tagName,
39 'Custom element local name should be equal to the name in custom ele ment definition');
40 });
41 }, 'Custom element constructor sets local name to the name from custom element d efinition. ' +
42 'Test constructor of extended HTML element');
43 </script>
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698