OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 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 | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 test('small max-width value', function() { | 54 test('small max-width value', function() { |
55 mq.query = '(max-width: 1px)'; | 55 mq.query = '(max-width: 1px)'; |
56 assert.equal(mq.queryMatches, false); | 56 assert.equal(mq.queryMatches, false); |
57 }); | 57 }); |
58 | 58 |
59 test('large max-width value', function() { | 59 test('large max-width value', function() { |
60 mq.query = '(max-width: 10000px)'; | 60 mq.query = '(max-width: 10000px)'; |
61 assert.equal(mq.queryMatches, true); | 61 assert.equal(mq.queryMatches, true); |
62 }); | 62 }); |
63 | 63 |
| 64 test('automatically wrap with parens', function() { |
| 65 mq.query = 'min-width: 1px'; |
| 66 assert.equal(mq.queryMatches, true); |
| 67 }); |
| 68 |
| 69 suite('query does not activate on empty string or null', function() { |
| 70 |
| 71 test('empty string', function() { |
| 72 mq.query = ''; |
| 73 assert.notOk(mq._mq); |
| 74 }); |
| 75 |
| 76 test('null', function() { |
| 77 mq.query = null; |
| 78 assert.notOk(mq._mq); |
| 79 }); |
| 80 |
| 81 }); |
| 82 |
| 83 test('media query destroys on detach', function() { |
| 84 mq.query = '(max-width: 800px)'; |
| 85 mq.parentNode.removeChild(mq); |
| 86 Polymer.dom.flush(); |
| 87 assert.notOk(mq._mq); |
| 88 }); |
| 89 |
| 90 test('media query re-enables on attach', function() { |
| 91 mq.query = '(max-width: 800px)'; |
| 92 var parent = mq.parentNode; |
| 93 parent.removeChild(mq); |
| 94 Polymer.dom.flush(); |
| 95 parent.appendChild(mq); |
| 96 Polymer.dom.flush(); |
| 97 assert.ok(mq._mq); |
| 98 }); |
| 99 |
64 }); | 100 }); |
65 | 101 |
66 }); | 102 }); |
67 | 103 |
68 </script> | 104 </script> |
69 | 105 |
70 </body> | 106 </body> |
71 </html> | 107 </html> |
OLD | NEW |