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

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

Issue 265283005: Add accessibility function to PDFScriptingAPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/pdf_scripting_api.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/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 0413d46378f23fafb487e18e72045a09a08bdccf..8413c52e1bd1d9837825fa3214d5fd470e98b6c4 100644
--- a/chrome/test/data/pdf/basic_plugin_test.js
+++ b/chrome/test/data/pdf/basic_plugin_test.js
@@ -18,6 +18,33 @@ var tests = [
chrome.test.assertEq(1066, sizer.offsetHeight);
chrome.test.succeed();
},
+
+ function testAccessibility() {
+ 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);
+ }));
+ },
+
+ function testAccessibilityWithPage() {
+ var client = new PDFScriptingAPI(window, window.location.origin);
+ client.setDestinationWindow(window);
+ client.getAccessibilityJSON(chrome.test.callbackPass(function(json) {
+ var dict = JSON.parse(json);
+ chrome.test.assertEq(612, dict.width);
+ chrome.test.assertEq(792, dict.height);
+ chrome.test.assertEq(1.0, dict.textBox[0].fontSize);
+ chrome.test.assertEq('text', dict.textBox[0].textNodes[0].type);
+ chrome.test.assertEq('this is some text',
+ dict.textBox[0].textNodes[0].text);
+ chrome.test.assertEq(1.0, dict.textBox[1].fontSize);
+ chrome.test.assertEq('text', dict.textBox[1].textNodes[0].type);
+ chrome.test.assertEq('some more text',
+ dict.textBox[1].textNodes[0].text);
+ }), 0);
+ }
];
window.addEventListener('pdfload', function() {
« no previous file with comments | « chrome/browser/resources/pdf/pdf_scripting_api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698