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

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

Issue 290803007: Re-enable PDFExtensionTest.BasicPlugin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/pdf/pdf_extension_test.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * These tests require that the PDF plugin be available to run correctly. 6 * These tests require that the PDF plugin be available to run correctly.
7 */ 7 */
8 var tests = [ 8 var tests = [
9 /** 9 /**
10 * Test that the page is sized to the size of the document. 10 * Test that the page is sized to the size of the document.
11 */ 11 */
12 function testPageSize() { 12 function testPageSize() {
13 // Verify that the initial zoom is 100%. 13 // Verify that the initial zoom is less than or equal to 100%.
14 chrome.test.assertEq(1, viewer.viewport.zoom); 14 chrome.test.assertTrue(viewer.viewport.zoom <= 1);
15 15
16 viewer.viewport.zoom = 1;
16 var sizer = document.getElementById('sizer'); 17 var sizer = document.getElementById('sizer');
17 chrome.test.assertEq(826, sizer.offsetWidth); 18 chrome.test.assertEq(826, sizer.offsetWidth);
18 chrome.test.assertEq(1066, sizer.offsetHeight); 19 chrome.test.assertEq(1066, sizer.offsetHeight);
19 chrome.test.succeed(); 20 chrome.test.succeed();
20 }, 21 },
21 22
22 function testAccessibility() { 23 function testAccessibility() {
23 var client = new PDFScriptingAPI(window, window.location.origin); 24 var client = new PDFScriptingAPI(window, window.location.origin);
24 client.setDestinationWindow(window); 25 client.setDestinationWindow(window);
25 client.getAccessibilityJSON(chrome.test.callbackPass(function(json) { 26 client.getAccessibilityJSON(chrome.test.callbackPass(function(json) {
26 chrome.test.assertEq('{"copyable":true,"loaded":true,"numberOfPages":1}', 27 var dict = JSON.parse(json);
27 json); 28 chrome.test.assertEq(true, dict.copyable);
29 chrome.test.assertEq(true, dict.loaded);
30 chrome.test.assertEq(1, dict.numberOfPages);
28 })); 31 }));
29 }, 32 },
30 33
31 function testAccessibilityWithPage() { 34 function testAccessibilityWithPage() {
32 var client = new PDFScriptingAPI(window, window.location.origin); 35 var client = new PDFScriptingAPI(window, window.location.origin);
33 client.setDestinationWindow(window); 36 client.setDestinationWindow(window);
34 client.getAccessibilityJSON(chrome.test.callbackPass(function(json) { 37 client.getAccessibilityJSON(chrome.test.callbackPass(function(json) {
35 var dict = JSON.parse(json); 38 var dict = JSON.parse(json);
36 chrome.test.assertEq(612, dict.width); 39 chrome.test.assertEq(612, dict.width);
37 chrome.test.assertEq(792, dict.height); 40 chrome.test.assertEq(792, dict.height);
38 chrome.test.assertEq(1.0, dict.textBox[0].fontSize); 41 chrome.test.assertEq(1.0, dict.textBox[0].fontSize);
39 chrome.test.assertEq('text', dict.textBox[0].textNodes[0].type); 42 chrome.test.assertEq('text', dict.textBox[0].textNodes[0].type);
40 chrome.test.assertEq('this is some text', 43 chrome.test.assertEq('this is some text',
41 dict.textBox[0].textNodes[0].text); 44 dict.textBox[0].textNodes[0].text);
42 chrome.test.assertEq(1.0, dict.textBox[1].fontSize); 45 chrome.test.assertEq(1.0, dict.textBox[1].fontSize);
43 chrome.test.assertEq('text', dict.textBox[1].textNodes[0].type); 46 chrome.test.assertEq('text', dict.textBox[1].textNodes[0].type);
44 chrome.test.assertEq('some more text', 47 chrome.test.assertEq('some more text',
45 dict.textBox[1].textNodes[0].text); 48 dict.textBox[1].textNodes[0].text);
46 }), 0); 49 }), 0);
47 } 50 }
48 ]; 51 ];
49 52
50 window.addEventListener('pdfload', function() { 53 if (viewer.loaded) {
51 chrome.test.runTests(tests); 54 chrome.test.runTests(tests);
52 }); 55 } else {
56 window.addEventListener('pdfload', function() {
57 chrome.test.runTests(tests);
58 });
59 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/pdf/pdf_extension_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698