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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) { 386 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, FocusedTextInputClient) {
387 chrome::FocusLocationBar(browser()); 387 chrome::FocusLocationBar(browser());
388 OmniboxView* view = NULL; 388 OmniboxView* view = NULL;
389 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); 389 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
390 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); 390 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
391 ui::InputMethod* input_method = 391 ui::InputMethod* input_method =
392 omnibox_view_views->GetWidget()->GetInputMethod(); 392 omnibox_view_views->GetWidget()->GetInputMethod();
393 EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views), 393 EXPECT_EQ(static_cast<ui::TextInputClient*>(omnibox_view_views),
394 input_method->GetTextInputClient()); 394 input_method->GetTextInputClient());
395 } 395 }
396
397 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, TextElideStatus) {
398 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.
399 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
400 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
401
402 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
403 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
404 gfx::ELIDE_TAIL);
405
406 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.
407 browser())->GetViewByID(VIEW_ID_OMNIBOX)->GetBoundsInScreen();
408 const gfx::Point click_location = omnibox_bounds.CenterPoint();
409 ASSERT_NO_FATAL_FAILURE(Click(ui_controls::LEFT,
410 click_location, click_location));
411 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX));
412 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
413 gfx::NO_ELIDE);
414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698