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

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: Block OOB navigation entirely 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..a7557d10100904e24c89ee4b084d7d6a6cc00e5a 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,27 +18,28 @@ 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");
changeInput("1234");
changeInput("abcd");
- changeInput("12pp");
raymes 2015/10/01 03:02:09 How come you removed this one?
tsergeant 2015/10/01 04:42:22 Oops, no need for that change anymore. I've added
changeInput("3.14");
+ changeInput("3000");
- chrome.test.assertEq(4, navigatedPages.length);
+ chrome.test.assertEq(3, navigatedPages.length);
// The event page number is 0-based.
chrome.test.assertEq(999, navigatedPages[0]);
chrome.test.assertEq(1233, navigatedPages[1]);
- chrome.test.assertEq(11, navigatedPages[2]);
- chrome.test.assertEq(2, navigatedPages[3]);
+ chrome.test.assertEq(2, navigatedPages[2]);
chrome.test.succeed();
},
« 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