aboutsummaryrefslogtreecommitdiff
path: root/catapult/third_party/polymer/components/iron-collapse/test/a11y.html
diff options
context:
space:
mode:
Diffstat (limited to 'catapult/third_party/polymer/components/iron-collapse/test/a11y.html')
-rw-r--r--catapult/third_party/polymer/components/iron-collapse/test/a11y.html74
1 files changed, 74 insertions, 0 deletions
diff --git a/catapult/third_party/polymer/components/iron-collapse/test/a11y.html b/catapult/third_party/polymer/components/iron-collapse/test/a11y.html
new file mode 100644
index 00000000..ddd3472b
--- /dev/null
+++ b/catapult/third_party/polymer/components/iron-collapse/test/a11y.html
@@ -0,0 +1,74 @@
+<!doctype html>
+<!--
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+
+<html>
+ <head>
+
+ <title>iron-collapse-a11y</title>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
+ <script src="../../web-component-tester/browser.js"></script>
+ <script src="../../test-fixture/test-fixture-mocha.js"></script>
+
+ <link rel="import" href="../../test-fixture/test-fixture.html">
+ <link rel="import" href="../iron-collapse.html">
+
+ </head>
+ <body>
+
+ <test-fixture id="trivialCollapse">
+ <template>
+ <iron-collapse id="collapse" tabindex="0">
+ <div>
+ 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
+ </div>
+ </iron-collapse>
+ </template>
+ </test-fixture>
+
+ <script>
+
+ suite('a11y', function() {
+ var collapse;
+
+ setup(function () {
+ collapse = fixture('trivialCollapse');
+ });
+
+ test('aria attributes', function() {
+ assert.equal(collapse.getAttribute('role'), 'group');
+ assert.equal(collapse.getAttribute('aria-expanded'), 'false');
+ assert.equal(collapse.getAttribute('aria-hidden'), 'true');
+ });
+
+ test('set opened to true', function() {
+ collapse.opened = true;
+ assert.equal(collapse.getAttribute('aria-expanded'), 'true');
+ assert.equal(collapse.getAttribute('aria-hidden'), 'false');
+ });
+
+ test('focus the collapse when opened', function() {
+ assert.notEqual(document.activeElement, collapse);
+ collapse.opened = true;
+ assert.equal(document.activeElement, collapse);
+ });
+
+ a11ySuite('trivialCollapse');
+
+ });
+
+ </script>
+
+ </body>
+</html>
+