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

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

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Fix a nullptr problem that was crashing some UI tests. Created 3 years, 7 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 AutocompleteMatch match; 314 AutocompleteMatch match;
315 match.destination_url = GURL("http://autocomplete-result/"); 315 match.destination_url = GURL("http://autocomplete-result/");
316 match.allowed_to_be_default_match = true; 316 match.allowed_to_be_default_match = true;
317 match.type = AutocompleteMatchType::HISTORY_TITLE; 317 match.type = AutocompleteMatchType::HISTORY_TITLE;
318 match.relevance = 500; 318 match.relevance = 500;
319 matches.push_back(match); 319 matches.push_back(match);
320 match.destination_url = GURL("http://autocomplete-result2/"); 320 match.destination_url = GURL("http://autocomplete-result2/");
321 matches.push_back(match); 321 matches.push_back(match);
322 const AutocompleteInput input( 322 const AutocompleteInput input(
323 base::ASCIIToUTF16("a"), base::string16::npos, std::string(), GURL(), 323 base::ASCIIToUTF16("a"), base::string16::npos, std::string(), GURL(),
324 metrics::OmniboxEventProto::INVALID_SPEC, false, false, true, true, false, 324 base::string16(), metrics::OmniboxEventProto::INVALID_SPEC, false, false,
325 TestSchemeClassifier()); 325 true, true, false, TestSchemeClassifier());
326 results.AppendMatches(input, matches); 326 results.AppendMatches(input, matches);
327 results.SortAndCull( 327 results.SortAndCull(
328 input, TemplateURLServiceFactory::GetForProfile(browser()->profile())); 328 input, TemplateURLServiceFactory::GetForProfile(browser()->profile()));
329 329
330 // The omnibox popup should open with suggestions displayed. 330 // The omnibox popup should open with suggestions displayed.
331 omnibox_view->model()->popup_model()->OnResultChanged(); 331 omnibox_view->model()->popup_model()->OnResultChanged();
332 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen()); 332 EXPECT_TRUE(omnibox_view->model()->popup_model()->IsOpen());
333 333
334 // The omnibox text should be selected. 334 // The omnibox text should be selected.
335 EXPECT_TRUE(omnibox_view->IsSelectAll()); 335 EXPECT_TRUE(omnibox_view->IsSelectAll());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view); 400 OmniboxViewViews* omnibox_view_views = static_cast<OmniboxViewViews*>(view);
401 401
402 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); 402 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
403 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(), 403 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
404 gfx::ELIDE_TAIL); 404 gfx::ELIDE_TAIL);
405 405
406 chrome::FocusLocationBar(browser()); 406 chrome::FocusLocationBar(browser());
407 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(), 407 EXPECT_EQ(omnibox_view_views->GetRenderText()->elide_behavior(),
408 gfx::NO_ELIDE); 408 gfx::NO_ELIDE);
409 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698