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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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
« no previous file with comments | « no previous file | ui/app_list/views/app_list_item_view.h » ('j') | ui/gfx/render_text.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/search_engines/template_url_service_factory.h" 8 #include "chrome/browser/search_engines/template_url_service_factory.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen()); 338 EXPECT_FALSE(omnibox_view->model()->popup_model()->IsOpen());
339 } 339 }
340 340
341 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) { 341 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, BackgroundIsOpaque) {
342 // The omnibox text should be rendered on an opaque background. Otherwise, we 342 // The omnibox text should be rendered on an opaque background. Otherwise, we
343 // can't use subpixel rendering. 343 // can't use subpixel rendering.
344 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())-> 344 OmniboxViewViews* view = BrowserView::GetBrowserViewForBrowser(browser())->
345 toolbar()->location_bar()->omnibox_view(); 345 toolbar()->location_bar()->omnibox_view();
346 ASSERT_TRUE(view); 346 ASSERT_TRUE(view);
347 EXPECT_FALSE(view->GetRenderText()->background_is_transparent()); 347 EXPECT_TRUE(view->GetRenderText()->subpixel_rendering_enabled());
348 } 348 }
349 349
350 // Tests if executing a command hides touch editing handles. 350 // Tests if executing a command hides touch editing handles.
351 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, 351 IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest,
352 DeactivateTouchEditingOnExecuteCommand) { 352 DeactivateTouchEditingOnExecuteCommand) {
353 base::CommandLine::ForCurrentProcess()->AppendSwitch( 353 base::CommandLine::ForCurrentProcess()->AppendSwitch(
354 switches::kEnableTouchEditing); 354 switches::kEnableTouchEditing);
355 355
356 OmniboxView* view = NULL; 356 OmniboxView* view = NULL;
357 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); 357 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
(...skipping 25 matching lines...) Expand all
383 // TextInputFocusManager completes. 383 // TextInputFocusManager completes.
384 chrome::FocusLocationBar(browser()); 384 chrome::FocusLocationBar(browser());
385 OmniboxView* view = NULL; 385 OmniboxView* view = NULL;
386 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view)); 386 ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &view));
387 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); 387 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
388 ui::TextInputFocusManager* text_input_focus_manager = 388 ui::TextInputFocusManager* text_input_focus_manager =
389 ui::TextInputFocusManager::GetInstance(); 389 ui::TextInputFocusManager::GetInstance();
390 EXPECT_EQ(omnibox_view_views->GetTextInputClient(), 390 EXPECT_EQ(omnibox_view_views->GetTextInputClient(),
391 text_input_focus_manager->GetFocusedTextInputClient()); 391 text_input_focus_manager->GetFocusedTextInputClient());
392 } 392 }
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/app_list_item_view.h » ('j') | ui/gfx/render_text.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698