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

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

Issue 1371913002: Material PDF: Adjust behaviour of page selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pdf_material_rtl
Patch Set: Rebase 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 | « chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.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/material_elements_test.js
diff --git a/chrome/test/data/pdf/material_elements_test.js b/chrome/test/data/pdf/material_elements_test.js
index 4db7c5619b6df23b5f2a2234415778ed28f5a4f1..8ec88b2acfd38758951cdf8016dc833ea89accef 100644
--- a/chrome/test/data/pdf/material_elements_test.js
+++ b/chrome/test/data/pdf/material_elements_test.js
@@ -8,8 +8,8 @@
var tests = [
/**
* Test that viewer-page-selector reacts correctly to text entry. The page
- * selector validates that input is an integer, but does not check for
- * document bounds.
+ * selector validates that input is an integer, and does not allow navigation
+ * past document bounds.
*/
function testPageSelectorChange() {
var selector =
@@ -18,13 +18,15 @@ var tests = [
var input = selector.$.input;
// Simulate entering text into `input` and pressing enter.
function changeInput(newValue) {
- input.bindValue = newValue;
+ input.value = newValue;
input.dispatchEvent(new CustomEvent('change'));
}
var navigatedPages = [];
selector.addEventListener('change-page', function(e) {
navigatedPages.push(e.detail.page);
+ // A change-page handler is expected to set the pageNo to the new value.
+ selector.pageNo = e.detail.page + 1;
});
changeInput("1000");
@@ -32,6 +34,7 @@ var tests = [
changeInput("abcd");
changeInput("12pp");
changeInput("3.14");
+ changeInput("3000");
chrome.test.assertEq(4, navigatedPages.length);
// The event page number is 0-based.
« no previous file with comments | « chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698