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 <meta charset="UTF-8"> | |
13 <title>core-input a11y tests</title> | |
14 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-
scale=1.0"> | |
15 | |
16 <script src="../../webcomponentsjs/webcomponents.js"></script> | |
17 <script src="../../web-component-tester/browser.js"></script> | |
18 | |
19 <link href="../core-input.html" rel="import"> | |
20 | |
21 </head> | |
22 <body> | |
23 | |
24 <input id="input1" is="core-input" placeholder="label"> | |
25 <input id="input2" is="core-input" disabled> | |
26 | |
27 <script> | |
28 | |
29 var i1 = document.getElementById('input1'); | |
30 var i2 = document.getElementById('input2'); | |
31 | |
32 test('aria-label set to placeholder', function(done) { | |
33 assert.strictEqual('label', i1.getAttribute('aria-label')); | |
34 // test failing on polyfill due to https://github.com/Polymer/webcomponent
sjs-dev/issues/13 | |
35 // i1.placeholder = 'new label'; | |
36 i1.setAttribute('placeholder', 'new label'); | |
37 flush(function() { | |
38 assert.strictEqual(i1.getAttribute('aria-label'), 'new label'); | |
39 done(); | |
40 }); | |
41 }); | |
42 | |
43 test('aria-disabled is set', function(done) { | |
44 assert.ok(i2.hasAttribute('aria-disabled')); | |
45 i2.removeAttribute('disabled'); | |
46 flush(function() { | |
47 assert.ok(!i2.hasAttribute('aria-disabled')); | |
48 done(); | |
49 }); | |
50 }); | |
51 | |
52 </script> | |
53 | |
54 </body> | |
55 </html> | |
OLD | NEW |