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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html

Issue 2100403002: calling whenDefined with invalid name should throw SyntaxError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Custom Elements: whenDefined with invalid name</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharness-helpers.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="resources/custom-elements-helpers.js"></script>
7 <body>
8 <script>
9
10 'use strict';
11
12 test_with_window((w) => {
13 // https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element- name
14 let invalid_names = [
15 'annotation-xml',
16 'color-profile',
17 'font-face',
18 'font-face-src',
19 'font-face-uri',
20 'font-face-format',
21 'font-face-name',
22 'missing-glyph',
23 'div', 'p',
24 'nothtmlbutnohyphen',
25 '-not-initial-a-z', '0not-initial-a-z', 'Not-initial-a-z',
26 'intermediate-UPPERCASE-letters',
27 'bad-\u00b6', 'bad-\u00b8', 'bad-\u00bf', 'bad-\u00d7', 'bad-\u00f7',
28 'bad-\u037e', 'bad-\u037e', 'bad-\u2000', 'bad-\u200e', 'bad-\u203e',
29 'bad-\u2041', 'bad-\u206f', 'bad-\u2190', 'bad-\u2bff', 'bad-\u2ff0',
30 'bad-\u3000', 'bad-\ud800', 'bad-\uf8ff', 'bad-\ufdd0', 'bad-\ufdef',
31 'bad-\ufffe', 'bad-\uffff', 'bad-' + String.fromCodePoint(0xf0000)
32 ];
33 invalid_names.forEach((name) => {
34 promise_test((t) => {
35 return promise_rejects(t, new SyntaxError(), w.customElements.whenDefined( name));
kojii 2016/06/28 04:26:00 s/new SyntaxError()/'SYNTAX_ERR'/ "new SyntaxErro
36 });
37 });
38 }, 'calling whenDefined() with invalid names should return rejected promise');
39 </script>
40 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698