OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 |
| 12 <html> |
| 13 <head> |
| 14 |
| 15 <title>iron-resizable-behavior tests</title> |
| 16 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-
scale=1.0"> |
| 17 |
| 18 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 19 <script src="../../web-component-tester/browser.js"></script> |
| 20 <script src="../../test-fixture/test-fixture-mocha.js"></script> |
| 21 |
| 22 <link rel="import" href="../../test-fixture/test-fixture.html"> |
| 23 <link rel="import" href="../iron-resizable-behavior.html"> |
| 24 <link rel="import" href="test-elements.html"> |
| 25 |
| 26 </head> |
| 27 <body> |
| 28 |
| 29 <test-fixture id="ResizableAndShadowBoundaries"> |
| 30 <template> |
| 31 <x-light-resizable></x-light-resizable> |
| 32 </template> |
| 33 </test-fixture> |
| 34 |
| 35 <script> |
| 36 |
| 37 suite('iron-resizable-behavior', function() { |
| 38 var resizable; |
| 39 |
| 40 suite('events across shadow boundaries', function() { |
| 41 setup(function() { |
| 42 resizable = fixture('ResizableAndShadowBoundaries'); |
| 43 }); |
| 44 |
| 45 suite('ancestor\'s iron-resize', function() { |
| 46 test('only fires once for a notifying shadow descendent', function() { |
| 47 resizable.$.childResizable1.notifyResize(); |
| 48 |
| 49 expect(resizable.ironResizeCount).to.be.equal(2); |
| 50 }); |
| 51 |
| 52 test('only fires once when notifying descendent observables', function()
{ |
| 53 resizable.notifyResize(); |
| 54 |
| 55 expect(resizable.ironResizeCount).to.be.equal(2); |
| 56 }); |
| 57 }); |
| 58 |
| 59 suite('descendant\'s iron-resize', function() { |
| 60 test('only fires once for a notifying shadow root', function() { |
| 61 resizable.notifyResize(); |
| 62 |
| 63 expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2); |
| 64 expect(resizable.$.childResizable2.ironResizeCount).to.be.equal(2); |
| 65 }); |
| 66 |
| 67 test('only fires once for a notifying descendent observable', function()
{ |
| 68 resizable.$.childResizable1.notifyResize(); |
| 69 |
| 70 expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2); |
| 71 }); |
| 72 }); |
| 73 |
| 74 suite('window\'s resize', function() { |
| 75 test('causes all iron-resize events to fire once', function() { |
| 76 window.dispatchEvent(new CustomEvent('resize')); |
| 77 expect(resizable.ironResizeCount).to.be.equal(2); |
| 78 expect(resizable.$.childResizable1.ironResizeCount).to.be.equal(2); |
| 79 expect(resizable.$.childResizable2.ironResizeCount).to.be.equal(2); |
| 80 }); |
| 81 }); |
| 82 }); |
| 83 |
| 84 }); |
| 85 </script> |
| 86 </body> |
| 87 </html> |
OLD | NEW |