| 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 created_callback_test; | 5 library created_callback_test; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'package:unittest/html_config.dart'; | 7 import 'package:unittest/html_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:js' as js; | 9 import 'dart:js' as js; |
| 10 import '../utils.dart'; | 10 import '../utils.dart'; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 test('unresolved and created callback timing', () { | 81 test('unresolved and created callback timing', () { |
| 82 var div = new DivElement(); | 82 var div = new DivElement(); |
| 83 C.div = div; | 83 C.div = div; |
| 84 div.setInnerHtml(""" | 84 div.setInnerHtml(""" |
| 85 <x-c id="t"></x-c> | 85 <x-c id="t"></x-c> |
| 86 <x-b id="u"></x-b> | 86 <x-b id="u"></x-b> |
| 87 <x-c id="v"></x-c> | 87 <x-c id="v"></x-c> |
| 88 <x-b id="w"></x-b> | 88 <x-b id="w"></x-b> |
| 89 """, treeSanitizer: new NullTreeSanitizer()); | 89 """, treeSanitizer: new NullTreeSanitizer()); |
| 90 | 90 |
| 91 Platform.upgradeCustomElements(div); | 91 upgradeCustomElements(div); |
| 92 | 92 |
| 93 expect(C.createdInvocations, 2); | 93 expect(C.createdInvocations, 2); |
| 94 expect(div.query('#w') is B, isTrue); | 94 expect(div.query('#w') is B, isTrue); |
| 95 }); | 95 }); |
| 96 | 96 |
| 97 test('nesting of constructors', NestedElement.test); | 97 test('nesting of constructors', NestedElement.test); |
| 98 | 98 |
| 99 test('access while upgrading gets unupgraded element', | 99 test('access while upgrading gets unupgraded element', |
| 100 AccessWhileUpgradingElement.test); | 100 AccessWhileUpgradingElement.test); |
| 101 | 101 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } catch(e) { | 280 } catch(e) { |
| 281 rethrow; | 281 rethrow; |
| 282 } finally { | 282 } finally { |
| 283 js.context['testExpectsGlobalError'] = false; | 283 js.context['testExpectsGlobalError'] = false; |
| 284 } | 284 } |
| 285 var errors = js.context['testSuppressedGlobalErrors']; | 285 var errors = js.context['testSuppressedGlobalErrors']; |
| 286 expect(errors['length'], 1); | 286 expect(errors['length'], 1); |
| 287 // Clear out the errors; | 287 // Clear out the errors; |
| 288 js.context['testSuppressedGlobalErrors']['length'] = 0; | 288 js.context['testSuppressedGlobalErrors']['length'] = 0; |
| 289 } | 289 } |
| OLD | NEW |