OLD | NEW |
| (Empty) |
1 <!doctype html> | |
2 <!-- | |
3 Copyright (c) 2014 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 | |
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 | |
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 | |
9 --> | |
10 <html> | |
11 <head> | |
12 | |
13 <title>core-selection</title> | |
14 | |
15 <script src="../../platform/platform.js"></script> | |
16 <link rel="import" href="../../polymer-test-tools/tools.html"> | |
17 <script src="../../polymer-test-tools/htmltest.js"></script> | |
18 | |
19 <link rel="import" href="../../core-selection/core-selection.html"> | |
20 | |
21 </head> | |
22 <body> | |
23 | |
24 <core-selection></core-selection> | |
25 | |
26 <script> | |
27 document.addEventListener('polymer-ready', function() { | |
28 var s = document.querySelector('core-selection'); | |
29 s.addEventListener("core-select", function(event) { | |
30 if (test === 1) { | |
31 // check test1 | |
32 assert.isTrue(event.detail.isSelected); | |
33 assert.equal(event.detail.item, '(item)'); | |
34 assert.isTrue(s.isSelected(event.detail.item)); | |
35 assert.isFalse(s.isSelected('(some_item_not_selected)')); | |
36 // test2 | |
37 test++; | |
38 s.select(null); | |
39 } else if (test === 2) { | |
40 // check test2 | |
41 assert.isFalse(event.detail.isSelected); | |
42 assert.equal(event.detail.item, '(item)'); | |
43 assert.isFalse(s.isSelected(event.detail.item)); | |
44 done(); | |
45 } | |
46 }); | |
47 // test1 | |
48 var test = 1; | |
49 s.select('(item)'); | |
50 }); | |
51 </script> | |
52 | |
53 </body> | |
54 </html> | |
OLD | NEW |