Commit ec7f257a authored by raymes@chromium.org's avatar raymes@chromium.org

Re-enable PDFExtensionTest.BasicPlugin

This test was disabled because it was failing. A few changes have been made:
-The page zoom cannot be assumed to be 100% on load as it will depend on the screen size being tested on. So testPageSize now doesn't make that assumption.
-testAccessibilityWithPage was flaking because accessibility information was not always returned for the two text boxes. I spent a bit of time investigating, but couldn't work it out so I've left it partially disabled for now and filed crbug.com/378091.
-The files have all been moved to a more appropriate location (in particular the test was moved out of the data directory).

BUG=303491

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273819

Review URL: https://codereview.chromium.org/290803007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274186 0039d316-1c4b-4281-b951-d872f2087c98
parent 1f9532b4
......@@ -37,7 +37,6 @@ class PDFExtensionTest : public ExtensionApiTest {
}
void RunTestsInFile(std::string filename, bool requiresPlugin) {
#if !defined(GOOGLE_CHROME_BUILD)
base::FilePath pdf_plugin_src;
PathService::Get(base::DIR_SOURCE_ROOT, &pdf_plugin_src);
pdf_plugin_src = pdf_plugin_src.AppendASCII("pdf");
......@@ -46,7 +45,6 @@ class PDFExtensionTest : public ExtensionApiTest {
" because it requires the PDF plugin which is not available.";
return;
}
#endif
ExtensionService* service = extensions::ExtensionSystem::Get(
profile())->extension_service();
service->component_loader()->Add(IDR_PDF_MANIFEST,
......@@ -87,9 +85,7 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Basic) {
RunTestsInFile("basic_test.js", false);
}
// TODO(raymes): investigate why this started failing after PDF plugin became
// open source.
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, DISABLED_BasicPlugin) {
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, BasicPlugin) {
RunTestsInFile("basic_plugin_test.js", true);
}
......
......@@ -1330,6 +1330,7 @@
'browser/renderer_host/web_cache_manager_browsertest.cc',
'browser/repost_form_warning_browsertest.cc',
'browser/resources/chromeos/chromevox/common/aria_util_test.js',
'browser/resources/pdf/pdf_extension_test.cc',
'browser/safe_browsing/local_safebrowsing_test_server.cc',
'browser/safe_browsing/safe_browsing_blocking_page_test.cc',
'browser/safe_browsing/safe_browsing_service_browsertest.cc',
......@@ -1545,7 +1546,6 @@
'test/base/test_chrome_web_ui_controller_factory.h',
'test/base/test_chrome_web_ui_controller_factory_browsertest.cc',
'test/data/chromeos/oobe_webui_browsertest.js',
'test/data/pdf/pdf_extension_test.cc',
'test/data/webui/about_invalidations_browsertest.js',
'test/data/webui/accessibility_audit_browsertest.js',
'test/data/webui/assertions.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);
......
......@@ -359,26 +359,26 @@ var tests = [
viewport.setZoom_(1);
mockCallback.reset();
viewport.goToPage(0)
viewport.goToPage(0);
chrome.test.assertTrue(mockCallback.wasCalled);
chrome.test.assertEq(0, viewport.position.x);
chrome.test.assertEq(0, viewport.position.y);
mockCallback.reset();
viewport.goToPage(1)
viewport.goToPage(1);
chrome.test.assertTrue(mockCallback.wasCalled);
chrome.test.assertEq(0, viewport.position.x);
chrome.test.assertEq(100, viewport.position.y);
mockCallback.reset();
viewport.goToPage(2)
viewport.goToPage(2);
chrome.test.assertTrue(mockCallback.wasCalled);
chrome.test.assertEq(0, viewport.position.x);
chrome.test.assertEq(300, viewport.position.y);
viewport.setZoom_(0.5);
mockCallback.reset();
viewport.goToPage(2)
viewport.goToPage(2);
chrome.test.assertTrue(mockCallback.wasCalled);
chrome.test.assertEq(0, viewport.position.x);
chrome.test.assertEq(150, viewport.position.y);
......
......@@ -407,7 +407,7 @@ void OutOfProcessInstance::HandleMessage(const pp::Var& message) {
pp::VarDictionary reply;
reply.Set(pp::Var(kType), pp::Var(kJSGetAccessibilityJSONReplyType));
if (dict.Get(pp::Var(kJSAccessibilityPageNumber)).is_int()) {
int page = pp::Var(kJSAccessibilityPageNumber).AsInt();
int page = dict.Get(pp::Var(kJSAccessibilityPageNumber)).AsInt();
reply.Set(pp::Var(kJSAccessibilityJSON),
pp::Var(engine_->GetPageAsJSON(page)));
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment