Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 expect(jsElem.shadowRoot.text, 'FOOBAR', reason: 'text unchanged'); | 130 expect(jsElem.shadowRoot.text, 'FOOBAR', reason: 'text unchanged'); |
| 131 | 131 |
| 132 interop.callMethod('aJsMethod', [123]); | 132 interop.callMethod('aJsMethod', [123]); |
| 133 return flush(); | 133 return flush(); |
| 134 }).then((_) { | 134 }).then((_) { |
| 135 expect(jsElem.shadowRoot.text, '900', reason: 'text set by JS method'); | 135 expect(jsElem.shadowRoot.text, '900', reason: 'text set by JS method'); |
| 136 expect(interop['baz'], 777, reason: 'unchanged'); | 136 expect(interop['baz'], 777, reason: 'unchanged'); |
| 137 }); | 137 }); |
| 138 } | 138 } |
| 139 | 139 |
| 140 /// Calls Platform.flush() to flush Polymer.js pending operations, e.g. | 140 /// Calls WebComponents.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 Polymer = context['Polymer']; |
| 144 Platform.callMethod('flush'); | 144 Polymer.callMethod('flush'); |
|
Siggi Cherem (dart-lang)
2014/11/25 17:53:41
same here as in instance.dart -- I thought this wo
jakemac
2014/12/01 18:42:50
Updated comment
| |
| 145 | 145 |
| 146 var completer = new Completer(); | 146 var completer = new Completer(); |
| 147 Platform.callMethod('endOfMicrotask', [() => completer.complete()]); | 147 Polymer.callMethod('endOfMicrotask', [() => completer.complete()]); |
| 148 return completer.future; | 148 return completer.future; |
| 149 } | 149 } |
| OLD | NEW |