Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: tests/html/event_customevent_test.dart

Issue 27536010: Fixing custom event test on IE (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/event_customevent_test.dart
diff --git a/tests/html/event_customevent_test.dart b/tests/html/event_customevent_test.dart
index 42e3031d2f878e0f4a0494454a825ddb5d385fdc..f9168a9401d91cd13b98017b604055cc27d405f1 100644
--- a/tests/html/event_customevent_test.dart
+++ b/tests/html/event_customevent_test.dart
@@ -7,6 +7,7 @@ library EventCustomEventTest;
import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_config.dart';
import 'dart:html';
+import 'dart:js' as js;
class DartPayloadData {
final dartValue;
@@ -54,18 +55,21 @@ main() {
});
test('custom events to JS', () {
+ expect(js.context['gotDartEvent'], isNull);
var scriptContents = '''
window.addEventListener('dart_custom_event', function(e) {
if (e.detail == 'dart_message') {
e.preventDefault();
+ window.gotDartEvent = true;
}
+ window.console.log('here' + e.detail);
vsm 2013/10/16 23:49:01 Do we need this print?
blois 2013/10/17 00:05:32 Nope, gone.
}, false);''';
document.body.append(new ScriptElement()..text = scriptContents);
var event = new CustomEvent('dart_custom_event', detail: 'dart_message');
window.dispatchEvent(event);
- expect(event.defaultPrevented, isTrue);
+ expect(js.context['gotDartEvent'], isTrue);
});
test('custom data to Dart', () {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698