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

Unified Diff: components/test/data/dom_distiller/pinch_tester.js

Issue 1225183002: Font size in DomDistiller prefs syncs with local scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge master again Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..206fba53e33e4a3bb41522a1f850681da8afbc4b 100644
--- a/components/test/data/dom_distiller/pinch_tester.js
+++ b/components/test/data/dom_distiller/pinch_tester.js
@@ -369,6 +369,50 @@ var pinchtest = (function() {
pincher.handleTouchCancel();
}
+ function testFontScaling() {
+ pincher.reset();
+ useFontScaling(1.5);
+ assertClose(pincher.status().clampedScale, 1.5);
+
+ var t = new touch();
+
+ // Start touch.
+ var oldState = pincher.status();
+ t.addTouchPoint(100, 100);
+ pincher.handleTouchStart(t.events());
+ t.addTouchPoint(300, 300);
+ pincher.handleTouchStart(t.events());
+
+ // Pinch to zoom out.
+ t.updateTouchPoint(0, 150, 150);
+ t.updateTouchPoint(1, 250, 250);
+ pincher.handleTouchMove(t.events());
+
+ // Verify scale is smaller.
+ assertTrue(pincher.status().clampedScale < 0.9 * oldState.clampedScale);
+ pincher.handleTouchCancel();
+
+ useFontScaling(0.8);
+ assertClose(pincher.status().clampedScale, 0.8);
+
+ // Start touch.
+ t = new touch();
+ oldState = pincher.status();
+ t.addTouchPoint(150, 150);
+ pincher.handleTouchStart(t.events());
+ t.addTouchPoint(250, 250);
+ pincher.handleTouchStart(t.events());
+
+ // Pinch to zoom in.
+ t.updateTouchPoint(0, 100, 100);
+ t.updateTouchPoint(1, 300, 300);
+ pincher.handleTouchMove(t.events());
+
+ // Verify scale is larger.
+ assertTrue(pincher.status().clampedScale > 1.1 * oldState.clampedScale);
+ pincher.handleTouchCancel();
+ }
+
return {
run: function(){
testZoomOut();
@@ -380,6 +424,7 @@ var pinchtest = (function() {
testCancel();
testSingularity();
testMinSpan();
+ testFontScaling();
pincher.reset();
return {success: true};
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698