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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h

Issue 891213002: Add a test for the mouseleave event on window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/renderer_context_menu/render_view_context_menu_browsertest_util.h
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h
index c8cd6e47f69d85c1afc2d829a5da70838338c5b7..e2b578359d7bf869be25c7e4e5217a81e9f62f39 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest_util.h
@@ -32,21 +32,19 @@ class ContextMenuNotificationObserver : public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(ContextMenuNotificationObserver);
};
-class SaveLinkAsContextMenuObserver : public ContextMenuNotificationObserver {
+class ContextMenuWaiter : public content::NotificationObserver {
public:
// Register to listen for notifications of
// NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN from either
// a specific source, or from all sources if |source| is
// NotificationService::AllSources().
- explicit SaveLinkAsContextMenuObserver(
- const content::NotificationSource& source);
- ~SaveLinkAsContextMenuObserver() override;
+ explicit ContextMenuWaiter(const content::NotificationSource& source);
+ ~ContextMenuWaiter() override;
- // Suggested filename for file downloaded through "Save Link As" option.
- base::string16 GetSuggestedFilename();
+ content::ContextMenuParams& params();
- // Wait for context menu to be visible.
- void WaitForMenu();
+ // Wait until the context menu is opened and closed.
+ void WaitForMenuOpenAndClose();
private:
void Observe(int type,
@@ -57,8 +55,9 @@ class SaveLinkAsContextMenuObserver : public ContextMenuNotificationObserver {
bool menu_visible_;
content::ContextMenuParams params_;
+ content::NotificationRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(SaveLinkAsContextMenuObserver);
+ DISALLOW_COPY_AND_ASSIGN(ContextMenuWaiter);
};
#endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BROWSERTEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698