~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/iron-collapse/test/a11y.html

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html>
 
2
<!--
 
3
@license
 
4
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
 
5
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
 
6
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
 
7
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
 
8
Code distributed by Google as part of the polymer project is also
 
9
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
 
10
-->
 
11
 
 
12
<html>
 
13
  <head>
 
14
 
 
15
    <title>iron-collapse-a11y</title>
 
16
    <meta charset="utf-8">
 
17
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
18
 
 
19
    <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
 
20
    <script src="../../web-component-tester/browser.js"></script>
 
21
    <script src="../../test-fixture/test-fixture-mocha.js"></script>
 
22
 
 
23
    <link rel="import" href="../../test-fixture/test-fixture.html">
 
24
    <link rel="import" href="../iron-collapse.html">
 
25
 
 
26
  </head>
 
27
  <body>
 
28
 
 
29
    <test-fixture id="trivialCollapse">
 
30
      <template>
 
31
        <iron-collapse id="collapse" tabindex="0">
 
32
          <div>
 
33
            Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem
 
34
          </div>
 
35
        </iron-collapse>
 
36
      </template>
 
37
    </test-fixture>
 
38
 
 
39
    <script>
 
40
 
 
41
      suite('a11y', function() {
 
42
        var collapse;
 
43
 
 
44
        setup(function () {
 
45
          collapse = fixture('trivialCollapse');
 
46
        });
 
47
 
 
48
        test('aria attributes', function() {
 
49
          assert.equal(collapse.getAttribute('role'), 'group');
 
50
          assert.equal(collapse.getAttribute('aria-expanded'), 'false');
 
51
          assert.equal(collapse.getAttribute('aria-hidden'), 'true');
 
52
        });
 
53
 
 
54
        test('set opened to true', function() {
 
55
          collapse.opened = true;
 
56
          assert.equal(collapse.getAttribute('aria-expanded'), 'true');
 
57
          assert.equal(collapse.getAttribute('aria-hidden'), 'false');
 
58
        });
 
59
 
 
60
        test('focus the collapse when opened', function() {
 
61
          assert.notEqual(document.activeElement, collapse);
 
62
          collapse.opened = true;
 
63
          assert.equal(document.activeElement, collapse);
 
64
        });
 
65
 
 
66
        a11ySuite('trivialCollapse');
 
67
 
 
68
      });
 
69
 
 
70
    </script>
 
71
 
 
72
  </body>
 
73
</html>
 
74