| 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'; |
| 11 import 'package:unittest/unittest.dart'; | 11 import 'package:unittest/unittest.dart'; |
| 12 import '../utils.dart'; | 12 import '../utils.dart'; |
| 13 | 13 |
| 14 var invocations = []; | 14 var invocations = []; |
| 15 class Foo extends HtmlElement { | 15 class Foo extends HtmlElement { |
| 16 factory Foo() => null; | 16 factory Foo() => null; |
| 17 Foo.created() : super.created(); |
| 17 | 18 |
| 18 void created() { | 19 void createdCallback() { |
| 19 invocations.add('created'); | 20 invocations.add('created'); |
| 20 } | 21 } |
| 21 | 22 |
| 22 void enteredView() { | 23 void enteredView() { |
| 23 invocations.add('entered'); | 24 invocations.add('entered'); |
| 24 } | 25 } |
| 25 | 26 |
| 26 void leftView() { | 27 void leftView() { |
| 27 invocations.add('left'); | 28 invocations.add('left'); |
| 28 } | 29 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 Platform.upgradeCustomElements(div); | 238 Platform.upgradeCustomElements(div); |
| 238 invocations = []; | 239 invocations = []; |
| 239 document.body.append(div); | 240 document.body.append(div); |
| 240 customElementsTakeRecords(); | 241 customElementsTakeRecords(); |
| 241 expect(invocations, ['entered'], | 242 expect(invocations, ['entered'], |
| 242 reason: 'the entered callback should be invoked when inserted into a ' | 243 reason: 'the entered callback should be invoked when inserted into a ' |
| 243 'document with a view as part of a subtree'); | 244 'document with a view as part of a subtree'); |
| 244 }); | 245 }); |
| 245 }); | 246 }); |
| 246 } | 247 } |
| OLD | NEW |