| OLD | NEW |
| 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 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/pdf/pdf_extension_test_util.h" | 23 #include "chrome/browser/pdf/pdf_extension_test_util.h" |
| 24 #include "chrome/browser/pdf/pdf_extension_util.h" | 24 #include "chrome/browser/pdf/pdf_extension_util.h" |
| 25 #include "chrome/browser/plugins/plugin_prefs.h" | 25 #include "chrome/browser/plugins/plugin_prefs.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
| 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 29 #include "chrome/common/chrome_content_client.h" | 29 #include "chrome/common/chrome_content_client.h" |
| 30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/test/base/ui_test_utils.h" | 32 #include "chrome/test/base/ui_test_utils.h" |
| 33 #include "components/ui/zoom/page_zoom.h" | 33 #include "components/zoom/page_zoom.h" |
| 34 #include "components/ui/zoom/test/zoom_test_utils.h" | 34 #include "components/zoom/test/zoom_test_utils.h" |
| 35 #include "components/ui/zoom/zoom_controller.h" | 35 #include "components/zoom/zoom_controller.h" |
| 36 #include "content/public/browser/browser_plugin_guest_manager.h" | 36 #include "content/public/browser/browser_plugin_guest_manager.h" |
| 37 #include "content/public/browser/download_item.h" | 37 #include "content/public/browser/download_item.h" |
| 38 #include "content/public/browser/download_manager.h" | 38 #include "content/public/browser/download_manager.h" |
| 39 #include "content/public/browser/notification_observer.h" | 39 #include "content/public/browser/notification_observer.h" |
| 40 #include "content/public/browser/notification_registrar.h" | 40 #include "content/public/browser/notification_registrar.h" |
| 41 #include "content/public/browser/plugin_service.h" | 41 #include "content/public/browser/plugin_service.h" |
| 42 #include "content/public/browser/render_process_host.h" | 42 #include "content/public/browser/render_process_host.h" |
| 43 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
| 44 #include "content/public/browser/render_widget_host.h" | 44 #include "content/public/browser/render_widget_host.h" |
| 45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 "\"></body></html>"; | 463 "\"></body></html>"; |
| 464 ui_test_utils::NavigateToURL(browser(), GURL(data_url)); | 464 ui_test_utils::NavigateToURL(browser(), GURL(data_url)); |
| 465 content::WebContents* web_contents = | 465 content::WebContents* web_contents = |
| 466 browser()->tab_strip_model()->GetActiveWebContents(); | 466 browser()->tab_strip_model()->GetActiveWebContents(); |
| 467 ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(web_contents)); | 467 ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(web_contents)); |
| 468 EXPECT_EQ(base::ASCIIToUTF16("TabTitleWithEmbeddedPdf"), | 468 EXPECT_EQ(base::ASCIIToUTF16("TabTitleWithEmbeddedPdf"), |
| 469 web_contents->GetTitle()); | 469 web_contents->GetTitle()); |
| 470 } | 470 } |
| 471 | 471 |
| 472 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfZoomWithoutBubble) { | 472 IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfZoomWithoutBubble) { |
| 473 using namespace ui_zoom; | 473 using namespace zoom; |
| 474 | 474 |
| 475 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test.pdf")); | 475 GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test.pdf")); |
| 476 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); | 476 content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); |
| 477 ASSERT_TRUE(guest_contents); | 477 ASSERT_TRUE(guest_contents); |
| 478 content::WebContents* web_contents = | 478 content::WebContents* web_contents = |
| 479 browser()->tab_strip_model()->GetActiveWebContents(); | 479 browser()->tab_strip_model()->GetActiveWebContents(); |
| 480 | 480 |
| 481 // The PDF viewer always starts at default zoom, which for tests is 100% or | 481 // The PDF viewer always starts at default zoom, which for tests is 100% or |
| 482 // zoom level 0.0. Here we look at the presets to find the next zoom level | 482 // zoom level 0.0. Here we look at the presets to find the next zoom level |
| 483 // above 0. Ideally we should look at the zoom levels from the PDF viewer | 483 // above 0. Ideally we should look at the zoom levels from the PDF viewer |
| (...skipping 21 matching lines...) Expand all Loading... |
| 505 #endif | 505 #endif |
| 506 ASSERT_TRUE( | 506 ASSERT_TRUE( |
| 507 content::ExecuteScript(guest_contents, "viewer.viewport.zoomIn();")); | 507 content::ExecuteScript(guest_contents, "viewer.viewport.zoomIn();")); |
| 508 | 508 |
| 509 watcher.Wait(); | 509 watcher.Wait(); |
| 510 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) | 510 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
| 511 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble()); | 511 EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble()); |
| 512 #endif | 512 #endif |
| 513 } | 513 } |
| 514 | 514 |
| OLD | NEW |