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

Unified Diff: tests/html/element_test.dart

Issue 11576060: Fixing up some Element and SvgElement tests to make them more platform-independent (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | tests/html/html.status » ('j') | tests/html/svgelement_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_test.dart
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index 6825c91175a7de3e6912c735620847377f074f69..0dba7807898fc4babe4f349f6badb02ed386d1b9 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -307,9 +307,6 @@ main() {
testEventHelper(on.change, 'change',
(listener) => Testing.addEventListener(
element, 'change', listener, true));
- testEventHelper(on.click, 'click',
- (listener) => Testing.addEventListener(
- element, 'click', listener, true));
testEventHelper(on.contextMenu, 'contextmenu',
(listener) => Testing.addEventListener(
element, 'contextmenu', listener, true));
@@ -424,6 +421,19 @@ main() {
});
});
+ group('click', () {
+ test('clickEvent', () {
+ var e = new DivElement();
+ var firedEvent = false;
+ e.on.click.add((event) {
+ firedEvent = true;
+ });
+ expect(firedEvent, false);
+ e.click();
+ expect(firedEvent, true);
+ });
+ });
+
group('attributes', () {
test('coercion', () {
final element = new Element.tag('div');
@@ -439,7 +449,7 @@ main() {
</div>''');
final attributes = element.attributes;
expect(attributes['class'], 'foo');
- expect(attributes['style'], 'overflow: hidden');
+ expect(attributes['style'], startsWith('overflow: hidden'));
expect(attributes['data-foo'], 'bar');
expect(attributes['data-foo2'], 'bar2');
expect(attributes.length, 5);
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | tests/html/svgelement_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698