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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/creating-and-passing-registries/no-registry-test.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>New document without browsing context must not have a registry</title>
5 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru ">
6 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
7 <meta name="assert" content="In all other cases, new documents must not have a r egistry.">
8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#creating-and-passin g-registries">
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 = document.implementation.createDocument(null, 'test', null);
19 assert_throws(
20 'NotSupportedError',
21 function() { doc.registerElement('x-element'); },
22 'Registering valid custom element in a document ' +
23 'without registry should fail');
24 }, 'Document of type other than HTML, not loaded into browsing context, must not have a registry');
25
26 async_test(function(t) {
27 var request = new XMLHttpRequest();
28 request.onreadystatechange = t.step_func(function() {
29 if (request.readyState == 4){
30 assert_equals(200, request.status, 'Test document is not loaded corr ectly');
31 var doc = request.response;
32 assert_true(doc instanceof HTMLDocument,
33 'XMLHttpRequest\'s asynchronous response should be HTML document ');
34 assert_throws(
35 'NotSupportedError',
36 function() { doc.registerElement('x-element'); },
37 'Registering valid custom element in ' +
38 'an XMLHttpRequest\'s response document should fail');
39 t.done();
40 }
41 });
42
43 request.open('GET', '../resources/blank.html', true);
44 request.responseType = 'document';
45 request.send();
46 }, 'XMLHttpRequest\'s asynchronous response HTML document must not have a regist ry');
47 </script>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698