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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu_browsertest.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // GTK requires a X11-level mouse event to open a context menu correctly. 94 // GTK requires a X11-level mouse event to open a context menu correctly.
95 #if defined(TOOLKIT_GTK) 95 #if defined(TOOLKIT_GTK)
96 #define MAYBE_RealMenu DISABLED_RealMenu 96 #define MAYBE_RealMenu DISABLED_RealMenu
97 #else 97 #else
98 #define MAYBE_RealMenu RealMenu 98 #define MAYBE_RealMenu RealMenu
99 #endif 99 #endif
100 // Opens a link in a new tab via a "real" context menu. 100 // Opens a link in a new tab via a "real" context menu.
101 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, 101 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
102 MAYBE_RealMenu) { 102 MAYBE_RealMenu) {
103 ContextMenuNotificationObserver menu_observer( 103 ContextMenuNotificationObserver menu_observer(
104 IDC_CONTENT_CONTEXT_OPENLINKNEWTAB, 104 IDC_CONTENT_CONTEXT_OPENLINKNEWTAB);
105 chrome::NOTIFICATION_TAB_ADDED);
106 ui_test_utils::WindowedTabAddedNotificationObserver tab_observer( 105 ui_test_utils::WindowedTabAddedNotificationObserver tab_observer(
107 content::NotificationService::AllSources()); 106 content::NotificationService::AllSources());
108 107
109 // Go to a page with a link 108 // Go to a page with a link
110 ui_test_utils::NavigateToURL( 109 ui_test_utils::NavigateToURL(
111 browser(), GURL("data:text/html,<a href='about:blank'>link</a>")); 110 browser(), GURL("data:text/html,<a href='about:blank'>link</a>"));
112 111
113 // Open a context menu. 112 // Open a context menu.
114 WebKit::WebMouseEvent mouse_event; 113 WebKit::WebMouseEvent mouse_event;
115 mouse_event.type = WebKit::WebInputEvent::MouseDown; 114 mouse_event.type = WebKit::WebInputEvent::MouseDown;
(...skipping 14 matching lines...) Expand all
130 // be added. 129 // be added.
131 tab_observer.Wait(); 130 tab_observer.Wait();
132 tab = tab_observer.GetTab(); 131 tab = tab_observer.GetTab();
133 ui_test_utils::WaitForLoadStop(tab); 132 ui_test_utils::WaitForLoadStop(tab);
134 133
135 // Verify that it's the correct tab. 134 // Verify that it's the correct tab.
136 EXPECT_EQ(GURL("about:blank"), tab->GetURL()); 135 EXPECT_EQ(GURL("about:blank"), tab->GetURL());
137 } 136 }
138 137
139 } // namespace 138 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/referrer_policy_browsertest.cc ('k') | chrome/browser/tab_contents/render_view_context_menu_browsertest_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698