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

Side by Side Diff: polymer_1.2.3/bower_components/iron-selector/test/activate-event.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt 4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
7 Code distributed by Google as part of the polymer project is also 7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
9 --> 9 -->
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // attach iron-activate listener 123 // attach iron-activate listener
124 s.addEventListener("iron-activate", function(event) { 124 s.addEventListener("iron-activate", function(event) {
125 event.preventDefault(); 125 event.preventDefault();
126 }); 126 });
127 // select Item 2 127 // select Item 2
128 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true})); 128 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
129 // shouldn't got selected since we preventDefault in iron-activate 129 // shouldn't got selected since we preventDefault in iron-activate
130 assert.equal(s.selected, '0'); 130 assert.equal(s.selected, '0');
131 }); 131 });
132 132
133 test('activates after detach and re-attach', function() {
134 // Detach and re-attach
135 var parent = s.parentNode;
136 parent.removeChild(s);
137 parent.appendChild(s);
138
139 // select Item 2
140 s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
141 assert.equal(s.selected, '2');
142 });
143
133 }); 144 });
134 145
135 </script> 146 </script>
136 147
137 </body> 148 </body>
138 </html> 149 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698