From ee22d3b856ea1cd2cef46fa4fd7440d4eb9c339c Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Mon, 11 Aug 2014 17:05:44 -0700 Subject: [PATCH] Add test for calling document.registerElement without 2nd argument --- test/js/customElements.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/js/customElements.js b/test/js/customElements.js index 5d5c41f..f48b9b0 100644 --- a/test/js/customElements.js +++ b/test/js/customElements.js @@ -36,6 +36,16 @@ suite('customElements', function() { assert.ok(false, 'document.registerElement failed to throw when given no arguments'); }); + // http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register + test('document.registerElement second argument is optional', function() { + try { + document.registerElement('x-no-proto'); + } catch(x) { + return; + } + assert.ok(true, 'document.registerElement failed to function without ElementRegistionOptions argument'); + }); + test('document.registerElement requires name argument to not conflict with a reserved name', function() { try { document.registerElement('font-face', {prototype: Object.create(HTMLElement.prototype)});