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

Side by Side Diff: pkg/polymer/test/js_interop_test.dart

Issue 507653004: update polymer to 0.3.5 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review updates Created 6 years, 3 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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 polymer.test.web.js_interop_test; 5 library polymer.test.web.js_interop_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:js'; 9 import 'dart:js';
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }); 51 });
52 52
53 test('js-element in body', () => testInterop( 53 test('js-element in body', () => testInterop(
54 querySelector('js-element'))); 54 querySelector('js-element')));
55 55
56 test('js-element in dart-element', () => testInterop( 56 test('js-element in dart-element', () => testInterop(
57 querySelector('dart-element').shadowRoot.querySelector('js-element'))); 57 querySelector('dart-element').shadowRoot.querySelector('js-element')));
58 58
59 test('elements can be passed through Node.bind to JS', () { 59 test('elements can be passed through Node.bind to JS', () {
60 var text = querySelector('dart-element2') 60 var text = querySelector('dart-element2')
61 .shadowRoot.querySelector('js-element2') 61 .shadowRoot.querySelector('js-element2')
62 .shadowRoot.text; 62 .shadowRoot.text;
63 expect(text, 'QUX:123'); 63 expect(text, 'QUX:123');
64 }); 64 });
65 65
66 test('objects with functions can be passed through Node.bind to JS', () { 66 test('objects with functions can be passed through Node.bind to JS', () {
67 var sr = querySelector('dart-element3') 67 var sr = querySelector('dart-element3')
68 .shadowRoot.querySelector('js-element3') 68 .shadowRoot.querySelector('js-element3')
69 .shadowRoot; 69 .shadowRoot;
70 70
71 return new Future(() { 71 return new Future(() {
72 expect(sr.text, 'js-element3[qux]:765'); 72 expect(sr.text, 'js-element3[qux]:765');
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 /// Calls Platform.flush() to flush Polymer.js pending operations, e.g. 140 /// Calls Platform.flush() to flush Polymer.js pending operations, e.g.
141 /// dirty checking for data-bindings. 141 /// dirty checking for data-bindings.
142 Future flush() { 142 Future flush() {
143 var Platform = context['Platform']; 143 var Platform = context['Platform'];
144 Platform.callMethod('flush'); 144 Platform.callMethod('flush');
145 145
146 var completer = new Completer(); 146 var completer = new Completer();
147 Platform.callMethod('endOfMicrotask', [() => completer.complete()]); 147 Platform.callMethod('endOfMicrotask', [() => completer.complete()]);
148 return completer.future; 148 return completer.future;
149 } 149 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/event_binding_release_handler_test.html ('k') | pkg/polymer/test/js_interop_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698