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

Side by Side Diff: test/codegen/lib/html/custom/element_upgrade_test.html

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 years, 7 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta name="dart.unittest" content="full-stack-traces">
3 <title> element_upgrade_test </title>
4 <style>
5 .unittest-table { font-family:monospace; border:1px; }
6 .unittest-pass { background: #6b3;}
7 .unittest-fail { background: #d55;}
8 .unittest-error { background: #a11;}
9 </style>
10 <script src="/packages/web_components/webcomponents.js"></script>
11 <script src="/packages/web_components/dart_support.js"></script>
12
13 <body>
14 <h1> Running element_upgrade_test </h1>
15
16 <script>
17 var Foo = function() {};
18 Foo.prototype = Object.create(HTMLElement.prototype);
19 Foo.prototype.createdCallback = function() {
20 this.fooCreated = true;
21 this.textContent = 'constructed';
22
23 // Tell the Dart side that this was created.
24 // For testing purposes, for real code this would use a different mechanism.
25 window.upgradeListener(this);
26 };
27
28 Foo.prototype.doSomething = function() {
29 this.textContent = 'didSomething';
30 return 'didSomething';
31 };
32
33 Foo = document.registerElement('x-foo', Foo);
34
35 function validateIsFoo(element) {
36 if (!(element instanceof Foo)) {
37 throw Error('Element is not a Foo');
38 }
39
40 if (!element.fooCreated) {
41 throw Error('Expected fooCreated to be set');
42 }
43 }
44 </script>
45
46 <script type="text/javascript"
47 src="/root_dart/tools/testing/dart/test_controller.js"></script>
48 <script type="text/javascript"
49 src="/packages/browser/interop.js"></script>
50 %TEST_SCRIPTS%
51 </body>
OLDNEW
« no previous file with comments | « test/codegen/lib/html/custom/element_upgrade_test.dart ('k') | test/codegen/lib/html/custom/entered_left_view_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698