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

Unified Diff: LayoutTests/fast/dom/custom/class-side-inheritence.html

Issue 1069953002: Implement Custom Element's class side inheritance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed context delete test case Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/inherited-prototype.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/custom/class-side-inheritence.html
diff --git a/LayoutTests/fast/dom/custom/class-side-inheritence.html b/LayoutTests/fast/dom/custom/class-side-inheritence.html
new file mode 100644
index 0000000000000000000000000000000000000000..11177c004857944017ed8fdc8301d998fae81810
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/class-side-inheritence.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<body>
+<script>
+test(function () {
+ "use strict";
+
+ class Foo extends HTMLDivElement {
+ static staticFunction () { return "static function called"; }
+ }
+
+ var customFoo = document.registerElement("custom-foo", {
+ prototype: Foo.prototype,
+ });
+
+ assert_equals(Object.getPrototypeOf(customFoo), Foo,
+ 'generated constructor prototype should be base element constructor');
+
+ assert_equals(customFoo.staticFunction(), "static function called",
+ 'static function should be called using inherited element');
+
+ assert_equals(Object.getPrototypeOf(customFoo).__proto__, HTMLDivElement,
+ 'prototype chain should have base constructor\'s prototype');
+}, 'should inherit from passed constructor');
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/inherited-prototype.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698