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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc

Issue 2817403002: [Omnibox] Elide omnibox text (Closed)
Patch Set: [Omnibox] Elide omnibox text Created 3 years, 8 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
Index: chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
index 91b12dd6237d52870b183983672973778281b1cf..42b61c69b517e9c1b7fd048e30e12bd4bc6caaa7 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
@@ -393,3 +393,22 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) {
EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views),
input_method->GetTextInputClient());
}
+
+IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, TextElideStatus) {
+ OmniboxView* view = NULL;
Peter Kasting 2017/04/17 19:03:54 NitL If you need to init this at all, use nullptr
simonhong 2017/04/17 19:51:01 Done.
+ ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
+ OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
+
+ ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
+ EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
+ gfx::ELIDE_TAIL);
+
+ const gfx::Rect omnibox_bounds = BrowserView::GetBrowserViewForBrowser(
Peter Kasting 2017/04/17 19:03:55 Nit: Rather than click-focusing you could probably
simonhong 2017/04/17 19:51:01 Done.
+ browser())->GetViewByID(VIEW_ID_OMNIBOX)->GetBoundsInScreen();
+ const gfx::Point click_location = omnibox_bounds.CenterPoint();
+ ASSERT_NO_FATAL_FAILURE(Click(ui_controls::LEFT,
+ click_location, click_location));
+ EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX));
+ EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
+ gfx::NO_ELIDE);
+}

Powered by Google App Engine
This is Rietveld 408576698