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

Side by Side Diff: pkg/web_components/test/created_watcher_test.html

Issue 319263002: Add "created-watcher" to the web_components package. This was adapted from (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 <meta http-equiv="X-UA-Compatible" content="IE=edge">
5 <meta name="dart.unittest" content="full-stack-traces">
6 <title> created_watcher_test.html </title>
7 <style>
8 .unittest-table { font-family:monospace; border:1px; }
9 .unittest-pass { background: #6b3;}
10 .unittest-fail { background: #d55;}
11 .unittest-error { background: #a11;}
12 </style>
13 <script src="/packages/web_components/platform.js"></script>
14 <script src="/packages/web_components/dart_support.js"></script>
15 <script src="/packages/web_components/created_watcher.js"></script>
16 </head>
17 <body>
18 <h1> Running created_watcher_test </h1>
19 <script>
20 var counter = 0;
21 var A = function() {};
22 A.prototype = Object.create(HTMLElement.prototype);
23 A.prototype.inc = function() { this.x = counter++; };
24 A.prototype.createdCallback = function() { this.inc(); };
25
26 var B = function() {};
27 B.prototype = Object.create(HTMLDivElement.prototype);
28 B.prototype.createdCallback = function() { this.x = counter++; };
29 B.extends = 'div';
30
31 document.registerElement('x-a', A);
32 document.registerElement('x-b', B);
33
34 function registerC() {
35 var proto = Object.create(HTMLElement.prototype, {
36 inc: { value: function() { this.x = counter++; } },
37 createdCallback: {
38 value: function() { this.inc(); },
39 configurable: true},
40 });
41 document.registerElement('x-c', {prototype: proto});
42 }
43 function addA() {
44 document.body.appendChild(document.createElement('x-a'));
45 }
46 function addB() {
47 document.body.appendChild(document.createElement('div', 'x-b'));
48 }
49 function addC() {
50 document.body.appendChild(document.createElement('x-c'));
51 }
52 </script>
53 <x-a id="i1"></x-a>
54 <div is="x-b" id="i2"></div>
55 <x-c id="i3"></x-b>
56 <script type="application/dart" src="created_watcher_test.dart"></script>
57 %TEST_SCRIPTS%
58 </body>
59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698