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

Unified Diff: polymer_0.5.4/bower_components/paper-button/test/paper-button.html

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: polymer_0.5.4/bower_components/paper-button/test/paper-button.html
diff --git a/polymer_0.5.4/bower_components/paper-button/test/paper-button.html b/polymer_0.5.4/bower_components/paper-button/test/paper-button.html
new file mode 100644
index 0000000000000000000000000000000000000000..17288ec6ea3fb349f5a8e4af3a562dc4cbda2c74
--- /dev/null
+++ b/polymer_0.5.4/bower_components/paper-button/test/paper-button.html
@@ -0,0 +1,112 @@
+<!doctype html>
+<!--
+Copyright (c) 2014 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>
+ <meta charset="UTF-8">
+ <title>paper-button basic tests</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+
+ <script src="../../webcomponentsjs/webcomponents.js"></script>
+ <script src="../../web-component-tester/browser.js"></script>
+ <script src="../../polymer-gestures/test/js/fake.js"></script>
+
+ <link href="../paper-button.html" rel="import">
+
+</head>
+<body>
+
+ <paper-button id="button1">button</paper-button>
+
+ <paper-button id="button2">button</paper-button>
+
+ <paper-button id="disabled" disabled>disabled</paper-button>
+
+ <script>
+
+ var fake = new Fake();
+
+ var b1 = document.getElementById('button1');
+
+ test('can set raised imperatively', function(done) {
+ assert.ok(!b1.shadowRoot.querySelector('paper-shadow'));
+ b1.raised = true;
+ flush(function() {
+ setTimeout(function() {
+ var shadow = b1.shadowRoot.querySelector('paper-shadow');
+ assert.ok(shadow);
+ done();
+ }, 600);
+ });
+ });
+
+ test('can set noink dynamically', function(done) {
+ var button = document.getElementById('button2');
+ button.lastEvent = {x: 100, y: 100};
+ button.$.ripple = {
+ downAction: function() {
+ assert.ok(false);
+ },
+ upAction: function() {
+ assert.ok(false);
+ }
+ };
+ button.setAttribute('noink', '');
+ fake.downOnNode(button);
+ fake.upOnNode(button);
+ // would throw if it tries to ripple
+ setTimeout(done, 10);
+ });
+
+ suite('a11y', function() {
+
+ test('aria role is a button', function() {
+ assert.strictEqual('button', b1.getAttribute('role'));
+ });
+
+ test('aria-disabled is set', function(done) {
+ var button = document.getElementById('disabled');
+ assert.ok(button.hasAttribute('aria-disabled'));
+ button.removeAttribute('disabled');
+ flush(function() {
+ assert.ok(!button.hasAttribute('aria-disabled'));
+ done();
+ });
+ });
+
+ test('space triggers the button', function() {
+ var ev = new CustomEvent('keydown', {detail: {key: 'space'}});
+ var sawClick = false;
+ function clickListener() {
+ sawClick = true;
+ }
+ b1.addEventListener('click', clickListener);
+ b1.dispatchEvent(ev);
+ assert.ok(sawClick);
+ b1.removeEventListener(clickListener);
+ });
+
+ test('enter triggers the button', function() {
+ var ev = new CustomEvent('keydown', {detail: {key: 'enter'}});
+ var sawClick = false;
+ function clickListener() {
+ sawClick = true;
+ }
+ b1.addEventListener('click', clickListener);
+ b1.dispatchEvent(ev);
+ assert.ok(sawClick);
+ b1.removeEventListener(clickListener);
+ });
+
+ });
+
+ </script>
+
+</body>
+</html>
« no previous file with comments | « polymer_0.5.4/bower_components/paper-button/test/index.html ('k') | polymer_0.5.4/bower_components/paper-checkbox/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698