Chromium Code Reviews| Index: chrome/browser/ui/pdf/pdf_browsertest.cc |
| =================================================================== |
| --- chrome/browser/ui/pdf/pdf_browsertest.cc (revision 152182) |
| +++ chrome/browser/ui/pdf/pdf_browsertest.cc (working copy) |
| @@ -344,6 +344,37 @@ |
| } |
| } |
| +IN_PROC_BROWSER_TEST_F(PDFBrowserTest, Action) { |
| + ASSERT_NO_FATAL_FAILURE(Load()); |
| + |
| + ASSERT_TRUE(content::ExecuteJavaScript( |
| + chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
| + std::wstring(), |
| + L"document.getElementsByName('plugin')[0].fitToHeight();")); |
| + |
| + std::string zoom1, zoom2; |
| + ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString( |
| + chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
| + std::wstring(), |
| + L"window.domAutomationController.send(" |
| + L"document.getElementsByName('plugin')[0].getZoomLevel().toString())", |
| + &zoom1)); |
| + |
| + ASSERT_TRUE(content::ExecuteJavaScript( |
| + chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
| + std::wstring(), |
| + L"document.getElementsByName('plugin')[0].fitToWidth();")); |
| + |
| + ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString( |
| + chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
| + std::wstring(), |
| + L"window.domAutomationController.send(" |
| + L"document.getElementsByName('plugin')[0].getZoomLevel().toString())", |
| + &zoom2)); |
| + ASSERT_NE(zoom1, zoom2); |
|
cevans
2012/08/18 00:51:55
Is the width/height of the browser window sufficie
jam
2012/08/18 00:57:05
Load() resizes the browser to 1000x600 and ensures
|
| +} |
| + |
| + |
| // Flaky as per http://crbug.com/74549. |
| IN_PROC_BROWSER_TEST_F(PDFBrowserTest, DISABLED_OnLoadAndReload) { |
| ASSERT_TRUE(pdf_test_server()->Start()); |