| Index: third_party/polymer/v0_8/components-chromium/paper-behaviors/test/paper-button-behavior.html
|
| diff --git a/third_party/polymer/v0_8/components-chromium/paper-behaviors/test/paper-button-behavior.html b/third_party/polymer/v0_8/components-chromium/paper-behaviors/test/paper-button-behavior.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..70d521ac556bb992c1bf62814c3e7057208def65
|
| --- /dev/null
|
| +++ b/third_party/polymer/v0_8/components-chromium/paper-behaviors/test/paper-button-behavior.html
|
| @@ -0,0 +1,108 @@
|
| +<!doctype html>
|
| +<!--
|
| +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>paper-button-behavior</title>
|
| +
|
| + <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
| + <script src="../../web-component-tester/browser.js"></script>
|
| + <script src="../../test-fixture/test-fixture-mocha.js"></script>
|
| + <script src="../../iron-test-helpers/mock-interactions.js"></script>
|
| +
|
| + <link rel="import" href="../../polymer/polymer.html">
|
| + <link rel="import" href="../../test-fixture/test-fixture.html">
|
| + <link rel="import" href="test-button.html">
|
| +</head>
|
| +<body>
|
| +
|
| + <test-fixture id="basic">
|
| + <template>
|
| + <test-button></test-button>
|
| + </template>
|
| + </test-fixture>
|
| +
|
| + <test-fixture id="raised">
|
| + <template>
|
| + <test-button raised toggles></test-button>
|
| + </template>
|
| + </test-fixture>
|
| +
|
| + <script>
|
| + suite('basic', function() {
|
| + var button;
|
| +
|
| + suite('when raised is false', function() {
|
| + setup(function() {
|
| + button = fixture('basic');
|
| + });
|
| +
|
| + test('normal (no states)', function() {
|
| + assert.equal(button._elevation, 0);
|
| + });
|
| +
|
| + test('set disabled property', function() {
|
| + button.disabled = true;
|
| + assert.equal(button._elevation, 0);
|
| + });
|
| +
|
| + test('activated by tap', function(done) {
|
| + MockInteractions.downAndUp(button, function() {
|
| + try {
|
| + assert.equal(button._elevation, 0);
|
| + done();
|
| + } catch (e) {
|
| + done(e);
|
| + }
|
| + });
|
| + });
|
| +
|
| + test('receives focused', function() {
|
| + MockInteractions.focus(button);
|
| + assert.equal(button._elevation, 0);
|
| + })
|
| + });
|
| +
|
| + suite('when raised is true', function() {
|
| + setup(function() {
|
| + button = fixture('raised');
|
| + });
|
| +
|
| + test('normal (no states)', function() {
|
| + assert.equal(button._elevation, 1);
|
| + });
|
| +
|
| + test('set disabled property', function() {
|
| + button.disabled = true;
|
| + assert.equal(button._elevation, 0);
|
| + });
|
| +
|
| + test('activated by tap', function(done) {
|
| + MockInteractions.downAndUp(button, function() {
|
| + try {
|
| + assert.equal(button._elevation, 2);
|
| + done();
|
| + } catch (e) {
|
| + done(e);
|
| + }
|
| + });
|
| + });
|
| +
|
| + test('receives focused', function() {
|
| + MockInteractions.focus(button);
|
| + assert.equal(button._elevation, 3);
|
| + })
|
| + });
|
| +
|
| + });
|
| + </script>
|
| +
|
| +</body>
|
| +</html>
|
|
|