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

Side by Side Diff: tests/html/custom/js_custom_test.dart

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « tests/html/custom/entered_left_view_test.html ('k') | tests/html/custom/js_custom_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library js_custom_test; 5 library js_custom_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_config.dart'; 8 import 'package:unittest/html_config.dart';
9 import 'dart:html'; 9 import 'dart:html';
10 import '../utils.dart'; 10 import '../utils.dart';
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 main() { 23 main() {
24 useHtmlConfiguration(); 24 useHtmlConfiguration();
25 25
26 // Adapted from Blink's 26 // Adapted from Blink's
27 // fast/dom/custom/constructor-calls-created-synchronously test. 27 // fast/dom/custom/constructor-calls-created-synchronously test.
28 28
29 var registered = false; 29 var registered = false;
30 setUp(() { 30 setUp(() {
31 return loadPolyfills().then((_) { 31 return customElementsReady.then((_) {
32 if (!registered) { 32 if (!registered) {
33 registered = true; 33 registered = true;
34 document.register(A.tag, A); 34 document.register(A.tag, A);
35 } 35 }
36 }); 36 });
37 }); 37 });
38 38
39 test('accessing custom Dart element from JS', () { 39 test('accessing custom Dart element from JS', () {
40 var a = new A(); 40 var a = new A();
41 a.id = 'a'; 41 a.id = 'a';
(...skipping 21 matching lines...) Expand all
63 foo.id = 'b'; 63 foo.id = 'b';
64 document.body.appendChild(foo); 64 document.body.appendChild(foo);
65 '''; 65 ''';
66 66
67 document.body.append(new ScriptElement()..text = script); 67 document.body.append(new ScriptElement()..text = script);
68 var custom = document.querySelector('#b'); 68 var custom = document.querySelector('#b');
69 expect(custom is HtmlElement, isTrue); 69 expect(custom is HtmlElement, isTrue);
70 expect(custom.attributes['fromJS'], 'true'); 70 expect(custom.attributes['fromJS'], 'true');
71 }); 71 });
72 } 72 }
OLDNEW
« no previous file with comments | « tests/html/custom/entered_left_view_test.html ('k') | tests/html/custom/js_custom_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698