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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/registering-custom-elements/definition-construction-algorithm-name-is-null.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>If NAME is null then localName must be set to TYPE</title>
5 <meta name="author" title="Vasiliy Degtyarev" href="mailto:vasya@unipro.ru">
6 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
7 <meta name="assert" content="If NAME is null then localName must be set to TYPE" >
8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-custom- 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 name = 'x-a';
20 var proto = Object.create(HTMLElement.prototype);
21 var GeneratedConstructor = doc.registerElement(name, {prototype: proto});
22 var customElement = new GeneratedConstructor();
23
24 assert_equals(customElement.localName, name, 'LocalName should be a type in case of ' +
25 'attempt to register a custom element and local name is not provided');
26 }, 'If NAME is not specified then localName must be set to TYPE');
27
28
29 test(function() {
30 var doc = newHTMLDocument();
31 var name = 'x-b';
32 var proto = Object.create(HTMLElement.prototype);
33 var GeneratedConstructor = doc.registerElement(name, {prototype: proto, exte nds: null});
34 var customElement = new GeneratedConstructor();
35
36 assert_equals(customElement.localName, name, 'LocalName should be a type in case of ' +
37 'attempt to register a custom element and name is null');
38 }, 'If NAME is null then localName must be set to TYPE');
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698