Commit 1dc62042 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Fix and re-enable disabled tests in c/b/ui/views/omnibox/.

These pass on Windows.

Bug: 824418, 905508
Change-Id: Ib6420284643a430cc43a76de3afbb5c2e3de6099
Reviewed-on: https://chromium-review.googlesource.com/c/1333119
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611421}
parent 28fa329c
......@@ -143,18 +143,10 @@ IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, PopupAlignment) {
EXPECT_EQ(popup_rect.right(), alignment_rect.right());
}
#if defined(OS_MACOSX)
// This test doesn't work on Mac because Mac doesn't theme the omnibox the way
// it expects.
#define MAYBE_ThemeIntegration DISABLED_ThemeIntegration
#else
#define MAYBE_ThemeIntegration ThemeIntegration
#endif
// Integration test for omnibox popup theming. This is a browser test since it
// relies on initialization done in chrome_browser_main_extra_parts_views_linux
// propagating through correctly to OmniboxPopupContentsView::GetTint().
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, MAYBE_ThemeIntegration) {
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, ThemeIntegration) {
// Sanity check the bot: ensure the profile is configured to use the system
// theme. On Linux, the default depends on a whitelist using the result of
// base::nix::GetDesktopEnvironment(). E.g. KDE never uses the system theme.
......@@ -197,20 +189,18 @@ IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, MAYBE_ThemeIntegration) {
EXPECT_EQ(selection_color_light, get_selection_color());
#if defined(OS_MACOSX) || defined(USE_X11)
// Mac and system-themed Desktop Linux continue to use light theming in
// incognito windows.
const bool dark_used_in_system_incognito_theme = false;
#if defined(USE_X11)
// System-themed Desktop Linux continues to use light theming in incognito
// windows.
const SkColor incognito_selection_color = selection_color_light;
#else
const bool dark_used_in_system_incognito_theme = true;
const SkColor incognito_selection_color = selection_color_dark;
#endif
// Check unthemed incognito windows.
Browser* incognito_browser = CreateIncognitoBrowser();
browser_under_test = incognito_browser;
EXPECT_EQ(dark_used_in_system_incognito_theme ? selection_color_dark
: selection_color_light,
get_selection_color());
EXPECT_EQ(incognito_selection_color, get_selection_color());
// Install a theme (in both browsers, since it's the same profile).
extensions::ChromeTestExtensionLoader loader(browser()->profile());
......@@ -242,13 +232,11 @@ IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, MAYBE_ThemeIntegration) {
EXPECT_EQ(selection_color_dark, get_selection_color());
}
// This is only enabled on ChromeOS for now, since it's hard to align an
// EventGenerator when multiple native windows are involved (the sanity check
// will fail). TODO(tapted): Enable everywhere.
#if defined(OS_CHROMEOS)
#define MAYBE_ClickOmnibox ClickOmnibox
#else
// TODO(tapted): https://crbug.com/905508 Fix and enable on Mac.
#if defined(OS_MACOSX) && !defined(USE_AURA)
#define MAYBE_ClickOmnibox DISABLED_ClickOmnibox
#else
#define MAYBE_ClickOmnibox ClickOmnibox
#endif
// Test that clicks over the omnibox do not hit the popup.
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, MAYBE_ClickOmnibox) {
......
......@@ -373,14 +373,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, SelectAllOnTabToFocus) {
EXPECT_TRUE(omnibox_view->IsSelectAll());
}
#if defined(OS_MACOSX)
// Focusing or input is not completely working on Mac: http://crbug.com/824418
#define MAYBE_CloseOmniboxPopupOnTextDrag DISABLED_CloseOmniboxPopupOnTextDrag
#else
#define MAYBE_CloseOmniboxPopupOnTextDrag CloseOmniboxPopupOnTextDrag
#endif
IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest,
MAYBE_CloseOmniboxPopupOnTextDrag) {
IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, CloseOmniboxPopupOnTextDrag) {
OmniboxView* omnibox_view = nullptr;
ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &omnibox_view));
OmniboxViewViews* omnibox_view_views =
......@@ -414,7 +407,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest,
EXPECT_TRUE(omnibox_view->IsSelectAll());
// Simulate a mouse click before dragging the mouse.
gfx::Point point(omnibox_view_views->origin());
gfx::Point point(omnibox_view_views->origin() + gfx::Vector2d(10, 10));
ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, point, point,
ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
ui::EF_LEFT_MOUSE_BUTTON);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment