Chromium Code Reviews| Index: components/test/data/dom_distiller/pinch_tester.js |
| diff --git a/components/test/data/dom_distiller/pinch_tester.js b/components/test/data/dom_distiller/pinch_tester.js |
| index e2c1df505166790970b0a1003c4bfa1bbb11d8ed..537312b98567ccfbf38141d66e63c54d73410b64 100644 |
| --- a/components/test/data/dom_distiller/pinch_tester.js |
| +++ b/components/test/data/dom_distiller/pinch_tester.js |
| @@ -369,6 +369,43 @@ var pinchtest = (function() { |
| pincher.handleTouchCancel(); |
| } |
| + function testFontScaling() { |
| + pincher.reset(); |
| + useFontScaling(1.5); |
| + assertClose(pincher.status().clampedScale, 1.5); |
| + |
| + var t = new touch(); |
| + |
| + var oldState = pincher.status(); |
|
nyquist
2015/08/11 06:27:57
Would it be possible to add a one line comment abo
wychen
2015/08/31 21:47:39
Done.
|
| + t.addTouchPoint(100, 100); |
| + pincher.handleTouchStart(t.events()); |
| + t.addTouchPoint(300, 300); |
| + pincher.handleTouchStart(t.events()); |
| + |
| + t.updateTouchPoint(0, 150, 150); |
| + t.updateTouchPoint(1, 250, 250); |
| + pincher.handleTouchMove(t.events()); |
| + assertTrue(pincher.status().clampedScale < 0.9 * oldState.clampedScale); |
| + |
| + pincher.handleTouchCancel(); |
| + |
| + useFontScaling(0.8); |
| + assertClose(pincher.status().clampedScale, 0.8); |
| + |
| + t = new touch(); |
| + oldState = pincher.status(); |
| + t.addTouchPoint(150, 150); |
| + pincher.handleTouchStart(t.events()); |
| + t.addTouchPoint(250, 250); |
| + pincher.handleTouchStart(t.events()); |
| + |
| + t.updateTouchPoint(0, 100, 100); |
| + t.updateTouchPoint(1, 300, 300); |
| + pincher.handleTouchMove(t.events()); |
| + assertTrue(pincher.status().clampedScale > 1.1 * oldState.clampedScale); |
| + pincher.handleTouchCancel(); |
| + } |
| + |
| return { |
| run: function(){ |
| testZoomOut(); |
| @@ -380,6 +417,7 @@ var pinchtest = (function() { |
| testCancel(); |
| testSingularity(); |
| testMinSpan(); |
| + testFontScaling(); |
| pincher.reset(); |
| return {success: true}; |