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

Side by Side Diff: chrome/test/data/pdf/navigator_test.js

Issue 1255403002: Add a scroll offset to PDF documents to account for the top material design toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/pdf/basic_plugin_test.js ('k') | chrome/test/data/pdf/viewport_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function NavigateInCurrentTabCallback() { 5 function NavigateInCurrentTabCallback() {
6 this.navigateInCurrentTabCalled = false; 6 this.navigateInCurrentTabCalled = false;
7 this.callback = function() { 7 this.callback = function() {
8 this.navigateInCurrentTabCalled = true; 8 this.navigateInCurrentTabCalled = true;
9 }.bind(this); 9 }.bind(this);
10 this.reset = function() { 10 this.reset = function() {
(...skipping 14 matching lines...) Expand all
25 var tests = [ 25 var tests = [
26 /** 26 /**
27 * Test navigation within the page, opening a url in the same tab and 27 * Test navigation within the page, opening a url in the same tab and
28 * opening a url in the new tab. 28 * opening a url in the new tab.
29 */ 29 */
30 function testNavigate() { 30 function testNavigate() {
31 var mockWindow = new MockWindow(100, 100); 31 var mockWindow = new MockWindow(100, 100);
32 var mockSizer = new MockSizer(); 32 var mockSizer = new MockSizer();
33 var mockCallback = new MockViewportChangedCallback(); 33 var mockCallback = new MockViewportChangedCallback();
34 var viewport = new Viewport(mockWindow, mockSizer, mockCallback.callback, 34 var viewport = new Viewport(mockWindow, mockSizer, mockCallback.callback,
35 function() {}, function() {}, 0, 1); 35 function() {}, function() {}, 0, 1, 0);
36 36
37 var paramsParser = new OpenPDFParamsParser(function(name) { 37 var paramsParser = new OpenPDFParamsParser(function(name) {
38 if (name == 'US') 38 if (name == 'US')
39 paramsParser.onNamedDestinationReceived(0); 39 paramsParser.onNamedDestinationReceived(0);
40 else if (name == 'UY') 40 else if (name == 'UY')
41 paramsParser.onNamedDestinationReceived(2); 41 paramsParser.onNamedDestinationReceived(2);
42 else 42 else
43 paramsParser.onNamedDestinationReceived(-1); 43 paramsParser.onNamedDestinationReceived(-1);
44 }); 44 });
45 var url = "http://xyz.pdf"; 45 var url = "http://xyz.pdf";
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 chrome.test.assertEq(300, viewport.position.y); 94 chrome.test.assertEq(300, viewport.position.y);
95 95
96 chrome.test.succeed(); 96 chrome.test.succeed();
97 } 97 }
98 ]; 98 ];
99 99
100 var scriptingAPI = new PDFScriptingAPI(window, window); 100 var scriptingAPI = new PDFScriptingAPI(window, window);
101 scriptingAPI.setLoadCallback(function() { 101 scriptingAPI.setLoadCallback(function() {
102 chrome.test.runTests(tests); 102 chrome.test.runTests(tests);
103 }); 103 });
OLDNEW
« no previous file with comments | « chrome/test/data/pdf/basic_plugin_test.js ('k') | chrome/test/data/pdf/viewport_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698