Chromium Code Reviews| Index: chrome/browser/ui/browser_focus_uitest.cc |
| diff --git a/chrome/browser/ui/browser_focus_uitest.cc b/chrome/browser/ui/browser_focus_uitest.cc |
| index 6ae9e605c61faafd4d83bcb195f1b1cac0eef302..4fe86109cf1e6d429a441f6f59a5a2a5277f7057 100644 |
| --- a/chrome/browser/ui/browser_focus_uitest.cc |
| +++ b/chrome/browser/ui/browser_focus_uitest.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/format_macros.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/path_service.h" |
| +#include "base/run_loop.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| @@ -237,6 +238,34 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_BrowsersRememberFocus) { |
| ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| } |
| +// This test is only for Linux Desktop. |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| +#define MAYBE_BrowserDialogModalTest BrowserDialogModalTest |
| +#else |
| +#define MAYBE_BrowserDialogModalTest DISABLE_BrowserDialogModalTest |
| +#endif |
| +IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_BrowserDialogModalTest) { |
| + ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| + const GURL url = embedded_test_server()->GetURL(kSimplePage); |
| + ui_test_utils::NavigateToURL(browser(), url); |
| + |
| + browser()->OpenFile(); |
| + |
| + base::RunLoop run_loop; |
| + base::MessageLoop::current()->PostTask( |
| + FROM_HERE, run_loop.QuitClosure()); |
| + run_loop.Run(); |
| + |
| + ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point(100, 100))); |
|
sadrul
2015/08/27 19:56:17
How can you tell this point is not on the open-dia
|
| + ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( |
| + ui_controls::LEFT, ui_controls::DOWN)); |
| + // Create and show a test interstitial page. |
| + // This page should not get focus due to modal dialog. |
| + TestInterstitialPage* interstitial_page = new TestInterstitialPage( |
| + browser()->tab_strip_model()->GetActiveWebContents()); |
| + EXPECT_FALSE(interstitial_page->HasFocus()); |
|
sadrul
2015/08/27 19:56:17
Why is it necessary to open the interstitial page?
|
| +} |
| + |
| // Tabs remember focus. |
| // Disabled, http://crbug.com/62542. |
| IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocus) { |