| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 }); | 104 }); |
| 105 | 105 |
| 106 group('viewless_document', () { | 106 group('viewless_document', () { |
| 107 var a; | 107 var a; |
| 108 setUp(() { | 108 setUp(() { |
| 109 invocations = []; | 109 invocations = []; |
| 110 }); | 110 }); |
| 111 | 111 |
| 112 test('Created, owned by a document without a view', () { | 112 test('Created, owned by a document without a view', () { |
| 113 a = docB.createElement('x-a'); | 113 a = docB.createElement('x-a'); |
| 114 expect(a.document, docB, | 114 expect(a.ownerDocument, docB, |
| 115 reason:'new instance should be owned by the document the definition ' | 115 reason:'new instance should be owned by the document the definition ' |
| 116 'was registered with'); | 116 'was registered with'); |
| 117 expect(invocations, ['created'], | 117 expect(invocations, ['created'], |
| 118 reason: 'calling the constructor should invoke the created callback'); | 118 reason: 'calling the constructor should invoke the created callback'); |
| 119 }); | 119 }); |
| 120 | 120 |
| 121 test('Entered document without a view', () { | 121 test('Entered document without a view', () { |
| 122 docB.body.append(a); | 122 docB.body.append(a); |
| 123 expect(invocations, [], | 123 expect(invocations, [], |
| 124 reason: 'entered callback should not be invoked when entering a ' | 124 reason: 'entered callback should not be invoked when entering a ' |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 Platform.upgradeCustomElements(div); | 235 Platform.upgradeCustomElements(div); |
| 236 invocations = []; | 236 invocations = []; |
| 237 document.body.append(div); | 237 document.body.append(div); |
| 238 customElementsTakeRecords(); | 238 customElementsTakeRecords(); |
| 239 expect(invocations, ['entered'], | 239 expect(invocations, ['entered'], |
| 240 reason: 'the entered callback should be invoked when inserted into a ' | 240 reason: 'the entered callback should be invoked when inserted into a ' |
| 241 'document with a view as part of a subtree'); | 241 'document with a view as part of a subtree'); |
| 242 }); | 242 }); |
| 243 }); | 243 }); |
| 244 } | 244 } |
| OLD | NEW |