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

Unified Diff: LayoutTests/fast/dom/custom/document-register-basic.html

Issue 117313008: Update Custom Elements API to new names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update for forgotten tests. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/custom/document-register-basic.html
diff --git a/LayoutTests/fast/dom/custom/document-register-basic.html b/LayoutTests/fast/dom/custom/document-register-basic.html
index cf680e500aa53be4e1072e1361656fa19e2c8dbd..a79832f940f021cdb7d163a50e3246aaf655d7a8 100644
--- a/LayoutTests/fast/dom/custom/document-register-basic.html
+++ b/LayoutTests/fast/dom/custom/document-register-basic.html
@@ -6,7 +6,7 @@
<body>
<div id="container"></div>
<script>
-description('Testing document.register() basic behaviors.');
+description('Testing document.registerElement() basic behaviors.');
if (window.testRunner)
testRunner.dumpAsText();
@@ -18,20 +18,20 @@ function createRegisterParameters()
};
}
-var fooConstructor = document.register('x-foo', createRegisterParameters());
+var fooConstructor = document.registerElement('x-foo', createRegisterParameters());
shouldBe('typeof fooConstructor', '"function"');
shouldBe('fooConstructor.prototype.__proto__', 'HTMLElement.prototype');
shouldBeTrue('fooConstructor.prototype.thisIsPrototype');
// Bad prototype: prototype is already a built-in interface prototype object
-shouldThrow('document.register("x-bad-a", HTMLElement)', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-a\'. The prototype is already in-use as an interface prototype object."');
+shouldThrow('document.registerElement("x-bad-a", HTMLElement)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-a\'. The prototype is already in-use as an interface prototype object."');
// Bad prototype: prototype is already a Custom Element interface prototype object
-shouldThrow('document.register("x-bad-b", fooConstructor)', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-b\'. The prototype is already in-use as an interface prototype object."');
+shouldThrow('document.registerElement("x-bad-b", fooConstructor)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-b\'. The prototype is already in-use as an interface prototype object."');
// Bad prototype: 'constructor' is not configurable
var proto = Object.create(HTMLElement.prototype, {
constructor: {configurable: false, writable: true}
});
-shouldThrow('document.register("x-bad-c", { prototype: proto })', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-c\'. Prototype constructor property is not configurable."');
+shouldThrow('document.registerElement("x-bad-c", { prototype: proto })', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-c\'. Prototype constructor property is not configurable."');
// Call as function
shouldThrow('fooConstructor()', '"TypeError: DOM object constructor cannot be called as a function."')
@@ -67,13 +67,13 @@ parsedFoo.someProperty = 'hello';
shouldBe('parsedFoo.someProperty', 'container.firstChild.someProperty');
// Having another constructor
-var barConstructor = document.register('x-bar', createRegisterParameters());
+var barConstructor = document.registerElement('x-bar', createRegisterParameters());
shouldBeTrue('barConstructor !== fooConstructor');
var createdBar = new barConstructor();
shouldBe('createdBar.tagName', '"X-BAR"');
// Having a subclass
-var bazConstructor = document.register('x-baz', { prototype: Object.create(fooConstructor.prototype, { thisIsAlsoPrototype: { value: true } }) });
+var bazConstructor = document.registerElement('x-baz', { prototype: Object.create(fooConstructor.prototype, { thisIsAlsoPrototype: { value: true } }) });
var createdBaz = new bazConstructor();
shouldBe('createdBaz.tagName', '"X-BAZ"');
shouldBeTrue('createdBaz.thisIsPrototype');
« no previous file with comments | « LayoutTests/fast/dom/custom/default-prototype.html ('k') | LayoutTests/fast/dom/custom/document-register-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698