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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 main() { | 57 main() { |
58 useHtmlConfiguration(); | 58 useHtmlConfiguration(); |
59 | 59 |
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 loadPolyfills().then((_) { | 65 return customElementsReady.then((_) { |
66 if (!registered) { | 66 if (!registered) { |
67 registered = true; | 67 registered = true; |
68 document.register(B.tag, B); | 68 document.register(B.tag, B); |
69 document.register(C.tag, C); | 69 document.register(C.tag, C); |
70 ErrorConstructorElement.register(); | 70 ErrorConstructorElement.register(); |
71 } | 71 } |
72 }); | 72 }); |
73 }); | 73 }); |
74 | 74 |
75 test('transfer created callback', () { | 75 test('transfer created callback', () { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } catch(e) { | 290 } catch(e) { |
291 rethrow; | 291 rethrow; |
292 } finally { | 292 } finally { |
293 js.context['testExpectsGlobalError'] = false; | 293 js.context['testExpectsGlobalError'] = false; |
294 } | 294 } |
295 var errors = js.context['testSuppressedGlobalErrors']; | 295 var errors = js.context['testSuppressedGlobalErrors']; |
296 expect(errors['length'], 1); | 296 expect(errors['length'], 1); |
297 // Clear out the errors; | 297 // Clear out the errors; |
298 js.context['testSuppressedGlobalErrors']['length'] = 0; | 298 js.context['testSuppressedGlobalErrors']['length'] = 0; |
299 } | 299 } |
OLD | NEW |