| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Adapted from Blink's | 60 // Adapted from Blink's |
| 61 // fast/dom/custom/created-callback test. | 61 // fast/dom/custom/created-callback test. |
| 62 | 62 |
| 63 var registered = false; | 63 var registered = false; |
| 64 setUp(() { | 64 setUp(() { |
| 65 return customElementsReady.then((_) { | 65 return customElementsReady.then((_) { |
| 66 if (!registered) { | 66 if (!registered) { |
| 67 registered = true; | 67 registered = true; |
| 68 document.registerElement(B.tag, B); | 68 document.registerElement(B.tag, B); |
| 69 document.registerElement(C.tag, C); | 69 document.registerElement(C.tag, C); |
| 70 ErrorConstructorElement.registerElement(); | 70 ErrorConstructorElement.register(); |
| 71 } | 71 } |
| 72 }); | 72 }); |
| 73 }); | 73 }); |
| 74 | 74 |
| 75 test('transfer created callback', () { | 75 test('transfer created callback', () { |
| 76 document.registerElement(A.tag, A); | 76 document.registerElement(A.tag, A); |
| 77 var x = new A(); | 77 var x = new A(); |
| 78 expect(A.createdInvocations, 1); | 78 expect(A.createdInvocations, 1); |
| 79 }); | 79 }); |
| 80 | 80 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } catch(e) { | 292 } catch(e) { |
| 293 rethrow; | 293 rethrow; |
| 294 } finally { | 294 } finally { |
| 295 js.context['testExpectsGlobalError'] = false; | 295 js.context['testExpectsGlobalError'] = false; |
| 296 } | 296 } |
| 297 var errors = js.context['testSuppressedGlobalErrors']; | 297 var errors = js.context['testSuppressedGlobalErrors']; |
| 298 expect(errors['length'], 1); | 298 expect(errors['length'], 1); |
| 299 // Clear out the errors; | 299 // Clear out the errors; |
| 300 js.context['testSuppressedGlobalErrors']['length'] = 0; | 300 js.context['testSuppressedGlobalErrors']['length'] = 0; |
| 301 } | 301 } |
| OLD | NEW |