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 b063b87455af01a1b0c7c5077fe187d8042036b7..b5d9aad247fc159574eb309a1d7d22019168ae6e 100644 |
--- a/chrome/browser/ui/browser_focus_uitest.cc |
+++ b/chrome/browser/ui/browser_focus_uitest.cc |
@@ -237,6 +237,29 @@ 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::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); |
sadrul
2015/08/20 06:24:20
Is this necessary here because you want to wait un
joone
2015/08/20 16:53:58
Ok, I will find another way of doing this.
|
+ ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point(100, 100))); |
+ ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( |
+ ui_controls::LEFT, ui_controls::DOWN)); |
sadrul
2015/08/20 06:24:20
You want to make sure the cursor is located within
joone
2015/08/20 16:53:58
Yes, right.
|
+ // 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()); |
sadrul
2015/08/20 06:24:20
Why do you need to open the interstitial page here
joone
2015/08/20 16:53:58
The interstitial page could only lose focus when f
|
+ EXPECT_FALSE(interstitial_page->HasFocus()); |
+} |
+ |
// Tabs remember focus. |
// Disabled, http://crbug.com/62542. |
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocus) { |