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

Side by Side Diff: polymer_1.0.4/bower_components/iron-range-behavior/test/basic.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 3 @license
4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 5 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS
7 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS
7 Code distributed by Google as part of the polymer project is also 8 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 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS
9 --> 10 -->
10 <html> 11 <html>
11 <head> 12 <head>
12 <meta charset="UTF-8"> 13 <meta charset="UTF-8">
13 <title>core-range-basic</title> 14 <title>iron-range-behavior</title>
14 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0"> 15 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0">
15 16
16 <script src="../../webcomponentsjs/webcomponents.js"></script> 17 <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
17 <script src="../../web-component-tester/browser.js"></script> 18 <script src="../../web-component-tester/browser.js"></script>
19 <script src="../../test-fixture/test-fixture-mocha.js"></script>
18 20
19 <link rel="import" href="../core-range.html"> 21 <link rel="import" href="../iron-range-behavior.html">
20 22 <link rel="import" href="../../test-fixture/test-fixture.html">
21 </head> 23 </head>
22 <body> 24 <body>
23 25
24 <core-range></core-range> 26 <script>
27 Polymer({
28 is: 'x-progressbar',
29
30 behaviors: [Polymer.IronRangeBehavior]
31 });
32 </script>
33
34 <test-fixture id="trivialRange">
35 <template>
36 <x-progressbar></x-progressbar>
37 </template>
38 </test-fixture>
25 39
26 <script> 40 <script>
41 suite('<x-progressbar>', function() {
42 var range;
27 43
28 var range = document.querySelector('core-range'); 44 setup(function() {
45 range = fixture('trivialRange');
46 });
29 47
30 suite('basic', function() {
31
32 test('check default', function() { 48 test('check default', function() {
33 assert.equal(range.min, 0); 49 assert.equal(range.min, 0);
34 assert.equal(range.max, 100); 50 assert.equal(range.max, 100);
35 assert.equal(range.value, 0); 51 assert.equal(range.value, 0);
36 }); 52 });
37 53
38 test('set value', function(done) { 54 test('set value', function(done) {
39 range.value = 50; 55 range.value = 50;
40 asyncPlatformFlush(function() { 56 asyncPlatformFlush(function() {
41 assert.equal(range.value, 50); 57 assert.equal(range.value, 50);
42 // test clamp value 58 // test clamp value
43 range.value = 60.1; 59 range.value = 60.1;
44 asyncPlatformFlush(function() { 60 asyncPlatformFlush(function() {
45 assert.equal(range.value, 60); 61 assert.equal(range.value, 60);
46 done(); 62 done();
47 }); 63 });
48 }); 64 });
49 }); 65 });
50 66
51 test('set max', function(done) { 67 test('set max', function(done) {
52 range.max = 10; 68 range.max = 10;
53 range.value = 11; 69 range.value = 11;
54 asyncPlatformFlush(function() { 70 asyncPlatformFlush(function() {
55 assert.equal(range.value, range.max); 71 assert.equal(range.value, range.max);
56 done(); 72 done();
57 }); 73 });
58 }); 74 });
59 75
60 test('test ratio', function(done) { 76 test('test ratio', function(done) {
61 range.max = 10; 77 range.max = 10;
62 range.value = 5; 78 range.value = 5;
63 asyncPlatformFlush(function() { 79 asyncPlatformFlush(function() {
64 assert.equal(range.ratio, 50); 80 assert.equal(range.ratio, 50);
65 done(); 81 done();
66 }); 82 });
67 }); 83 });
68 84
69 test('set min', function(done) { 85 test('set min', function(done) {
70 range.min = 10 86 range.min = 10
71 range.max = 50; 87 range.max = 50;
72 range.value = 30; 88 range.value = 30;
73 asyncPlatformFlush(function() { 89 asyncPlatformFlush(function() {
74 assert.equal(range.ratio, 50); 90 assert.equal(range.ratio, 50);
75 range.value = 0; 91 range.value = 0;
76 asyncPlatformFlush(function() { 92 asyncPlatformFlush(function() {
77 assert.equal(range.value, range.min); 93 assert.equal(range.value, range.min);
78 done(); 94 done();
79 }); 95 });
80 }); 96 });
81 }); 97 });
82 98
83 test('set step', function(done) { 99 test('set step', function(done) {
84 range.min = 0; 100 range.min = 0;
85 range.max = 10; 101 range.max = 10;
86 range.value = 5.1; 102 range.value = 5.1;
87 asyncPlatformFlush(function() { 103 asyncPlatformFlush(function() {
88 assert.equal(range.value, 5); 104 assert.equal(range.value, 5);
89 range.step = 0.1; 105 range.step = 0.1;
90 range.value = 5.1; 106 range.value = 5.1;
91 asyncPlatformFlush(function() { 107 asyncPlatformFlush(function() {
92 assert.equal(range.value, 5.1); 108 assert.equal(range.value, 5.1);
93 done(); 109 done();
94 }); 110 });
95 }); 111 });
96 }); 112 });
97 113
98 }); 114 });
99 115
100 </script> 116 </script>
101 117
102 </body> 118 </body>
103 </html> 119 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698