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

Side by Side Diff: test/iron_selector_activate_event_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « test/iron_range_behavior_test.dart ('k') | test/iron_selector_basic_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @TestOn('browser') 4 @TestOn('browser')
5 library polymer_elements.test.iron_selector_activate_event_test; 5 library polymer_elements.test.iron_selector_activate_event_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:polymer_interop/polymer_interop.dart'; 9 import 'package:polymer_interop/polymer_interop.dart';
10 import 'package:polymer_elements/iron_selector.dart'; 10 import 'package:polymer_elements/iron_selector.dart';
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // attach iron-activate listener 105 // attach iron-activate listener
106 s.on['iron-activate'].take(1).listen((event) { 106 s.on['iron-activate'].take(1).listen((event) {
107 event = convertToDart(event); 107 event = convertToDart(event);
108 event.preventDefault(); 108 event.preventDefault();
109 }); 109 });
110 // select Item 2 110 // select Item 2
111 s.children[2].dispatchEvent(new CustomEvent('tap', canBubble: true)); 111 s.children[2].dispatchEvent(new CustomEvent('tap', canBubble: true));
112 // shouldn't got selected since we preventDefault in iron-activate 112 // shouldn't got selected since we preventDefault in iron-activate
113 expect(s.selected, '0'); 113 expect(s.selected, '0');
114 }); 114 });
115
116 test('activates after detach and re-attach', () {
117 // Detach and re-attach
118 var parent = s.parentNode;
119 s.remove();
120 parent.append(s);
121
122 // select Item 2
123 s.children[2].dispatchEvent(new CustomEvent('tap', canBubble: true));
124 expect(s.selected, 2);
125 });
115 }); 126 });
116 } 127 }
OLDNEW
« no previous file with comments | « test/iron_range_behavior_test.dart ('k') | test/iron_selector_basic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698