OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 EventCustomEventTest; | 5 library EventCustomEventTest; |
6 | 6 |
7 import '../../pkg/unittest/lib/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import '../../pkg/unittest/lib/html_config.dart'; | 8 import 'package:unittest/html_config.dart'; |
9 import 'dart:html'; | 9 import 'dart:html'; |
10 import 'dart:js' as js; | 10 import 'dart:js' as js; |
11 | 11 |
12 class DartPayloadData { | 12 class DartPayloadData { |
13 final dartValue; | 13 final dartValue; |
14 | 14 |
15 DartPayloadData(this.dartValue); | 15 DartPayloadData(this.dartValue); |
16 } | 16 } |
17 | 17 |
18 main() { | 18 main() { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 var event = new CustomEvent('dart_custom_data_event', detail: data); | 77 var event = new CustomEvent('dart_custom_data_event', detail: data); |
78 | 78 |
79 var future = window.on['dart_custom_data_event'].first.then((_) { | 79 var future = window.on['dart_custom_data_event'].first.then((_) { |
80 expect(event.detail.dartValue, 666); | 80 expect(event.detail.dartValue, 666); |
81 }); | 81 }); |
82 | 82 |
83 document.body.dispatchEvent(event); | 83 document.body.dispatchEvent(event); |
84 return future; | 84 return future; |
85 }); | 85 }); |
86 } | 86 } |
OLD | NEW |