Index: pkg/web_components/test/created_watcher_test.html |
diff --git a/pkg/web_components/test/created_watcher_test.html b/pkg/web_components/test/created_watcher_test.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..21a33c9b2e9ea2df7eccce2fa03bc066db7be2cf |
--- /dev/null |
+++ b/pkg/web_components/test/created_watcher_test.html |
@@ -0,0 +1,61 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
+ <meta name="dart.unittest" content="full-stack-traces"> |
+ <title> created_watcher_test.html </title> |
+ <style> |
+ .unittest-table { font-family:monospace; border:1px; } |
+ .unittest-pass { background: #6b3;} |
+ .unittest-fail { background: #d55;} |
+ .unittest-error { background: #a11;} |
+ </style> |
+ <script src="/packages/web_components/platform.js"></script> |
+ <script src="/packages/web_components/dart_support.js"></script> |
+ <script src="/packages/web_components/created_watcher.js"></script> |
+</head> |
+<body> |
+ <h1> Running created_watcher_test </h1> |
+ <script> |
+ var counter = 0; |
+ var A = function() {}; |
+ A.prototype = Object.create(HTMLElement.prototype); |
Siggi Cherem (dart-lang)
2014/06/06 22:31:47
FYI, I also tried to write this using other patter
justinfagnani
2014/06/06 23:33:05
Ouch... we should try. I wouldn't at all be surpri
Siggi Cherem (dart-lang)
2014/06/09 17:10:28
Now that we are replacing things in place it's eas
|
+ A.prototype.createdCallback = function() { |
+ this.x = counter++; |
+ }; |
+ var B = function() {}; |
+ B.prototype = Object.create(HTMLDivElement.prototype); |
+ B.prototype.createdCallback = function() { |
+ this.x = counter++; |
+ }; |
+ B.extends = 'div'; |
+ |
+ document.registerElement('x-a', A); |
+ document.registerElement('x-b', B); |
+ |
+ function registerC() { |
+ var C = function() {}; |
+ C.prototype = Object.create(HTMLElement.prototype); |
+ C.prototype.createdCallback = function() { |
+ this.x = counter++; |
+ }; |
+ document.registerElement('x-c', C); |
+ } |
+ function addA() { |
+ document.body.appendChild(document.createElement('x-a')); |
+ } |
+ function addB() { |
+ document.body.appendChild(document.createElement('div', 'x-b')); |
+ } |
+ function addC() { |
+ document.body.appendChild(document.createElement('x-c')); |
+ } |
+ </script> |
+ <x-a id="i1"></x-a> |
+ <div is="x-b" id="i2"></div> |
+ <x-c id="i3"></x-b> |
+ <script type="text/javascript" |
+ src="/root_dart/tools/testing/dart/test_controller.js"></script> |
+ %TEST_SCRIPTS% |
+</body> |
+</html> |