| 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 Foo.created() : super.created() { |
| 18 | |
| 19 void createdCallback() { | |
| 20 invocations.add('created'); | 18 invocations.add('created'); |
| 21 } | 19 } |
| 22 | 20 |
| 23 void enteredView() { | 21 void enteredView() { |
| 24 invocations.add('entered'); | 22 invocations.add('entered'); |
| 25 } | 23 } |
| 26 | 24 |
| 27 void leftView() { | 25 void leftView() { |
| 28 invocations.add('left'); | 26 invocations.add('left'); |
| 29 } | 27 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 Platform.upgradeCustomElements(div); | 235 Platform.upgradeCustomElements(div); |
| 238 invocations = []; | 236 invocations = []; |
| 239 document.body.append(div); | 237 document.body.append(div); |
| 240 customElementsTakeRecords(); | 238 customElementsTakeRecords(); |
| 241 expect(invocations, ['entered'], | 239 expect(invocations, ['entered'], |
| 242 reason: 'the entered callback should be invoked when inserted into a ' | 240 reason: 'the entered callback should be invoked when inserted into a ' |
| 243 'document with a view as part of a subtree'); | 241 'document with a view as part of a subtree'); |
| 244 }); | 242 }); |
| 245 }); | 243 }); |
| 246 } | 244 } |
| OLD | NEW |