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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc

Issue 12039058: content: convert zoom notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc b/chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc
index 19226fec87b0b3285a39a1ff3e67ca10ba077e8d..d339cc8445c8b1247af2e5a92001f1f4789cc342 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc
@@ -5,6 +5,7 @@
#include <gtk/gtk.h>
#include "base/string_number_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_tabstrip.h"
@@ -46,7 +47,8 @@ void ExpectAtDefaultZoom(content::WebContents* contents) {
}
-class LocationBarViewGtkZoomTest : public InProcessBrowserTest {
+class LocationBarViewGtkZoomTest : public content::HostZoomMap::Observer,
+ public InProcessBrowserTest {
public:
LocationBarViewGtkZoomTest() {}
virtual ~LocationBarViewGtkZoomTest() {}
@@ -91,6 +93,10 @@ class LocationBarViewGtkZoomTest : public InProcessBrowserTest {
WaitForZoom(content::PAGE_ZOOM_OUT);
}
+ virtual void OnZoomLevelChanged(const std::string& host) {
+ message_loop_runner_->Quit();
+ }
+
private:
GtkWidget* GetZoomWidget() {
gfx::NativeWindow window = browser()->window()->GetNativeWindow();
@@ -98,13 +104,14 @@ class LocationBarViewGtkZoomTest : public InProcessBrowserTest {
}
void WaitForZoom(content::PageZoom zoom_action) {
- content::WindowedNotificationObserver zoom_observer(
- content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
- content::NotificationService::AllSources());
+ Observe(content::HostZoomMap::GetForBrowserContext(browser()->profile()));
chrome::Zoom(browser(), zoom_action);
- zoom_observer.Wait();
+ message_loop_runner_ = new content::MessageLoopRunner;
+ message_loop_runner_->Run();
}
+ scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
+
DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtkZoomTest);
};

Powered by Google App Engine
This is Rietveld 408576698