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

Unified Diff: chrome/browser/ui/browser_focus_uitest.cc

Issue 1233913009: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add the comment and mouse-up event Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9421bed46b90843725760bf897757322f3477b46..0b7c6e26dbc5fd771b729bd2319bb1129ee8a6cf 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"
@@ -238,6 +239,38 @@ 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)
msw 2015/09/04 22:25:16 Remove |&& defined(USE_AURA)| from here and simila
joone 2015/09/10 23:55:38 Done.
+#define MAYBE_BrowserDialogModalTest BrowserDialogModalTest
+#else
+#define MAYBE_BrowserDialogModalTest DISABLE_BrowserDialogModalTest
msw 2015/09/04 22:25:16 "DISABLED_"
joone 2015/09/10 23:55:38 Done.
+#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);
+ ASSERT_TRUE(browser()->window()->IsActive());
+
+ browser()->OpenFile();
+
+ // Insert a delay to wait until the file-picker is opened and gets focus.
msw 2015/09/04 22:25:17 Is there a better way to do this? If the nested ru
joone 2015/09/10 23:55:38 I added a timeout(1 sec).
+ base::RunLoop run_loop;
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, run_loop.QuitClosure());
+ run_loop.Run();
+
+ gfx::Rect rect = browser()->window()->GetBounds();
msw 2015/09/04 22:25:17 Right after the run loop, do EXPECT_FALSE(browser(
joone 2015/09/10 23:55:38 Done.
+ ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point(rect.x() + 1,
msw 2015/09/04 22:25:16 nit: maybe use ClickOnView instead?
joone 2015/09/10 23:55:38 Done.
+ rect.y() + 1)));
+ ASSERT_TRUE(ui_test_utils::SendMouseEventsSync(
msw 2015/09/04 22:25:16 I wonder if (1) Perhaps the dialog will actually c
joone 2015/09/10 23:55:38 Calling ClickOnView() may be able to fix this prob
+ ui_controls::LEFT, ui_controls::DOWN));
+ ASSERT_TRUE(ui_test_utils::SendMouseEventsSync(
+ ui_controls::LEFT, ui_controls::UP));
+
+ // The window should not get focus due to modal dialog.
+ EXPECT_FALSE(browser()->window()->IsActive());
+}
+
// Tabs remember focus.
// Disabled, http://crbug.com/62542.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocus) {
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698