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

Unified Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 1414643005: Disable zoom bubble for PDF extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git add deps file Created 5 years, 2 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/pdf/DEPS ('k') | chrome/browser/ui/views/location_bar/zoom_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pdf/pdf_extension_test.cc
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index f40e21289b55f0a02519a4e4398b8a3ed1c09df2..6b22cdf9b3c010abbe8a4d27a6ab758627b3151d 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -22,14 +22,13 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/ui/zoom/page_zoom.h"
+#include "components/ui/zoom/test/zoom_test_utils.h"
#include "components/ui/zoom/zoom_controller.h"
-#include "components/ui/zoom/zoom_test_utils.h"
#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
@@ -48,6 +47,10 @@
#include "ui/base/resource/resource_bundle.h"
#include "url/gurl.h"
+#if defined(TOOLKIT_VIEWS)
Lei Zhang 2015/10/29 16:40:33 I'd do this for now: #if defined(TOOLKIT_VIEWS) &&
+#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
+#endif
+
const int kNumberLoadTestParts = 10;
bool GetGuestCallback(content::WebContents** guest_out,
@@ -418,7 +421,6 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkPermissions) {
EXPECT_EQ(GURL("about:blank"), invalid_link_url);
}
-#if !defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfZoomWithoutBubble) {
using namespace ui_zoom;
@@ -435,27 +437,32 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfZoomWithoutBubble) {
// are easier to access.
std::vector<double> preset_zoom_levels = PageZoom::PresetZoomLevels(0.0);
std::vector<double>::iterator it =
- find(preset_zoom_levels.begin(), preset_zoom_levels.end(), 0.0);
+ std::find(preset_zoom_levels.begin(), preset_zoom_levels.end(), 0.0);
ASSERT_TRUE(it != preset_zoom_levels.end());
it++;
ASSERT_TRUE(it != preset_zoom_levels.end());
double new_zoom_level = *it;
auto zoom_controller = ZoomController::FromWebContents(web_contents);
+ // We expect a ZoomChangedEvent with can_show_bubble == false if the PDF
+ // extension behaviour is properly picked up. The test times out otherwise.
ZoomChangedWatcher watcher(zoom_controller,
ZoomController::ZoomChangedEventData(
web_contents, 0.f, new_zoom_level,
- ZoomController::ZOOM_MODE_MANUAL, true));
+ ZoomController::ZOOM_MODE_MANUAL, false));
// Zoom PDF via script.
+#if defined(TOOLKIT_VIEWS)
EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble());
+#endif
ASSERT_TRUE(
content::ExecuteScript(guest_contents, "viewer.viewport.zoomIn();"));
watcher.Wait();
+#if defined(TOOLKIT_VIEWS)
EXPECT_EQ(nullptr, ZoomBubbleView::GetZoomBubble());
-}
#endif
+}
class MaterialPDFExtensionTest : public PDFExtensionTest {
void SetUpCommandLine(base::CommandLine* command_line) override {
« no previous file with comments | « chrome/browser/pdf/DEPS ('k') | chrome/browser/ui/views/location_bar/zoom_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698