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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/pdf/pdf_extension_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/pdf/basic_plugin_test.js
diff --git a/chrome/test/data/pdf/basic_plugin_test.js b/chrome/test/data/pdf/basic_plugin_test.js
index 8413c52e1bd1d9837825fa3214d5fd470e98b6c4..864c1ae1934054d78b50672f960af54f8977767e 100644
--- a/chrome/test/data/pdf/basic_plugin_test.js
+++ b/chrome/test/data/pdf/basic_plugin_test.js
@@ -10,9 +10,10 @@ var tests = [
* Test that the page is sized to the size of the document.
*/
function testPageSize() {
- // Verify that the initial zoom is 100%.
- chrome.test.assertEq(1, viewer.viewport.zoom);
+ // Verify that the initial zoom is less than or equal to 100%.
+ chrome.test.assertTrue(viewer.viewport.zoom <= 1);
+ viewer.viewport.zoom = 1;
var sizer = document.getElementById('sizer');
chrome.test.assertEq(826, sizer.offsetWidth);
chrome.test.assertEq(1066, sizer.offsetHeight);
@@ -23,8 +24,10 @@ var tests = [
var client = new PDFScriptingAPI(window, window.location.origin);
client.setDestinationWindow(window);
client.getAccessibilityJSON(chrome.test.callbackPass(function(json) {
- chrome.test.assertEq('{"copyable":true,"loaded":true,"numberOfPages":1}',
- json);
+ var dict = JSON.parse(json);
+ chrome.test.assertEq(true, dict.copyable);
+ chrome.test.assertEq(true, dict.loaded);
+ chrome.test.assertEq(1, dict.numberOfPages);
}));
},
@@ -47,6 +50,10 @@ var tests = [
}
];
-window.addEventListener('pdfload', function() {
+if (viewer.loaded) {
chrome.test.runTests(tests);
-});
+} else {
+ window.addEventListener('pdfload', function() {
+ chrome.test.runTests(tests);
+ });
+}
« 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