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

Side by Side Diff: pkg/polymer/lib/elements/polymer-selector/test/html/polymer-selector-activate-event.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>polymer-selector-activate-event</title>
5 <script src="../../../platform/platform.js"></script>
6 <script src="../../../tools/test/htmltest.js"></script>
7 <script src="../../../tools/test/chai/chai.js"></script>
8 <link rel="import" href="../../polymer-selector.html">
9 <style>
10 .polymer-selected {
11 background: #ccc;
12 }
13 </style>
14 </head>
15 <body>
16
17 <polymer-selector id="selector" selected="0">
18 <div>Item 1</div>
19 <div>Item 2</div>
20 <div>Item 3</div>
21 <div>Item 4</div>
22 <div>Item 5</div>
23 </polymer-selector>
24
25 <script>
26 var assert = chai.assert;
27 document.addEventListener('polymer-ready', function() {
28 var s = document.querySelector('#selector');
29 s.addEventListener("polymer-activate", function(event) {
30 assert.equal(event.detail.item, s.children[1]);
31 assert.equal(s.selected, 1);
32 done();
33 });
34 assert.equal(s.selected, '0');
35 requestAnimationFrame(function() {
36 s.children[1].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
37 });
38 });
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698