| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return loadPolyfills().then((_) { | 55 return loadPolyfills().then((_) { |
| 56 if (registeredTypes) { | 56 if (registeredTypes) { |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 registeredTypes = true; | 59 registeredTypes = true; |
| 60 document.register('x-a', Foo); | 60 document.register('x-a', Foo); |
| 61 }); | 61 }); |
| 62 }); | 62 }); |
| 63 | 63 |
| 64 group('standard_events', () { | 64 group('standard_events', () { |
| 65 var a = new Element.tag('x-a'); | 65 var a; |
| 66 setUp(() { | 66 setUp(() { |
| 67 invocations = []; | 67 invocations = []; |
| 68 }); | 68 }); |
| 69 | 69 |
| 70 test('Created', () { | 70 test('Created', () { |
| 71 a = new Element.tag('x-a'); | 71 a = new Element.tag('x-a'); |
| 72 expect(invocations, ['created']); | 72 expect(invocations, ['created']); |
| 73 }); | 73 }); |
| 74 | 74 |
| 75 test('entered', () { | 75 test('entered', () { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 98 }); | 98 }); |
| 99 | 99 |
| 100 test('nested leaving triggers left', () { | 100 test('nested leaving triggers left', () { |
| 101 div.remove(); | 101 div.remove(); |
| 102 customElementsTakeRecords(); | 102 customElementsTakeRecords(); |
| 103 expect(invocations, ['left']); | 103 expect(invocations, ['left']); |
| 104 }); | 104 }); |
| 105 }); | 105 }); |
| 106 | 106 |
| 107 group('viewless_document', () { | 107 group('viewless_document', () { |
| 108 var a = docB.createElement('x-a'); | 108 var a; |
| 109 setUp(() { | 109 setUp(() { |
| 110 invocations = []; | 110 invocations = []; |
| 111 }); | 111 }); |
| 112 | 112 |
| 113 test('Created, owned by a document without a view', () { | 113 test('Created, owned by a document without a view', () { |
| 114 a = docB.createElement('x-a'); | 114 a = docB.createElement('x-a'); |
| 115 expect(a.document, docB, | 115 expect(a.document, docB, |
| 116 reason:'new instance should be owned by the document the definition ' | 116 reason:'new instance should be owned by the document the definition ' |
| 117 'was registered with'); | 117 'was registered with'); |
| 118 expect(invocations, ['created'], | 118 expect(invocations, ['created'], |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 Platform.upgradeCustomElements(div); | 237 Platform.upgradeCustomElements(div); |
| 238 invocations = []; | 238 invocations = []; |
| 239 document.body.append(div); | 239 document.body.append(div); |
| 240 customElementsTakeRecords(); | 240 customElementsTakeRecords(); |
| 241 expect(invocations, ['entered'], | 241 expect(invocations, ['entered'], |
| 242 reason: 'the entered callback should be invoked when inserted into a ' | 242 reason: 'the entered callback should be invoked when inserted into a ' |
| 243 'document with a view as part of a subtree'); | 243 'document with a view as part of a subtree'); |
| 244 }); | 244 }); |
| 245 }); | 245 }); |
| 246 } | 246 } |
| OLD | NEW |