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

Unified Diff: chrome/test/data/pdf/viewport_test.js

Issue 931013002: OOP PDF: Fix incorrect scrolling during fit-to-page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/test/data/pdf/test_util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/pdf/viewport_test.js
diff --git a/chrome/test/data/pdf/viewport_test.js b/chrome/test/data/pdf/viewport_test.js
index ec919fb1fb3bcca1aea18ca0b61b96e1d486127d..2b279a2e76f3cbda12cdbbd15a48ca42d4a7f82d 100644
--- a/chrome/test/data/pdf/viewport_test.js
+++ b/chrome/test/data/pdf/viewport_test.js
@@ -309,6 +309,19 @@ var tests = [
chrome.test.assertEq(0.25, viewport.zoom);
chrome.test.assertEq(0, viewport.position.x);
chrome.test.assertEq(50, viewport.position.y);
+
+ // Test that when the window size changes, fit-to-page occurs but does not
+ // scroll to the top of the page (it should stay at the scaled scroll
+ // position).
+ mockWindow.scrollTo(0, 0);
+ viewport.fitToPage();
+ chrome.test.assertEq(0.5, viewport.zoom);
+ mockWindow.scrollTo(0, 10);
+ mockWindow.setSize(50, 50);
+ chrome.test.assertEq(0.25, viewport.zoom);
+ chrome.test.assertEq(0, viewport.position.x);
+ chrome.test.assertEq(5, viewport.position.y);
+
chrome.test.succeed();
},
« no previous file with comments | « chrome/test/data/pdf/test_util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698