| OLD | NEW |
| 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 entered_left_view_test; | 5 library entered_left_view_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:js' as js; | 9 import 'dart:js' as js; |
| 10 import 'package:unittest/html_individual_config.dart'; | 10 import 'package:unittest/html_individual_config.dart'; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 void enteredView() { | 23 void enteredView() { |
| 24 invocations.add('entered'); | 24 invocations.add('entered'); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void leftView() { | 27 void leftView() { |
| 28 invocations.add('left'); | 28 invocations.add('left'); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void attributeChanged() { | 31 void attributeChanged(String name, String oldValue, String newValue) { |
| 32 invocations.add('attribute changed'); | 32 invocations.add('attribute changed'); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 // Pump custom events polyfill events. | 36 // Pump custom events polyfill events. |
| 37 void customElementsTakeRecords() { | 37 void customElementsTakeRecords() { |
| 38 if (js.context.hasProperty('CustomElements')) { | 38 if (js.context.hasProperty('CustomElements')) { |
| 39 js.context['CustomElements'].callMethod('takeRecords'); | 39 js.context['CustomElements'].callMethod('takeRecords'); |
| 40 } | 40 } |
| 41 } | 41 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 Platform.upgradeCustomElements(div); | 238 Platform.upgradeCustomElements(div); |
| 239 invocations = []; | 239 invocations = []; |
| 240 document.body.append(div); | 240 document.body.append(div); |
| 241 customElementsTakeRecords(); | 241 customElementsTakeRecords(); |
| 242 expect(invocations, ['entered'], | 242 expect(invocations, ['entered'], |
| 243 reason: 'the entered callback should be invoked when inserted into a ' | 243 reason: 'the entered callback should be invoked when inserted into a ' |
| 244 'document with a view as part of a subtree'); | 244 'document with a view as part of a subtree'); |
| 245 }); | 245 }); |
| 246 }); | 246 }); |
| 247 } | 247 } |
| OLD | NEW |