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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_browsertest.cc

Issue 2942013002: [omnibox] Constrain 'IsSelectAll()' to be more accurate (Closed)
Patch Set: Missed a fix Created 3 years, 6 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 | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 omnibox_view->model()->SetInputInProgress(true); 144 omnibox_view->model()->SetInputInProgress(true);
145 autocomplete_controller->Start(AutocompleteInput( 145 autocomplete_controller->Start(AutocompleteInput(
146 base::ASCIIToUTF16("chrome"), base::string16::npos, std::string(), 146 base::ASCIIToUTF16("chrome"), base::string16::npos, std::string(),
147 GURL(), base::string16(), metrics::OmniboxEventProto::NTP, true, false, 147 GURL(), base::string16(), metrics::OmniboxEventProto::NTP, true, false,
148 true, false, false, 148 true, false, false,
149 ChromeAutocompleteSchemeClassifier(browser()->profile()))); 149 ChromeAutocompleteSchemeClassifier(browser()->profile())));
150 150
151 EXPECT_TRUE(autocomplete_controller->done()); 151 EXPECT_TRUE(autocomplete_controller->done());
152 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); 152 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
153 EXPECT_TRUE(omnibox_view->GetText().empty()); 153 EXPECT_TRUE(omnibox_view->GetText().empty());
154 EXPECT_TRUE(omnibox_view->IsSelectAll()); 154 EXPECT_FALSE(omnibox_view->IsSelectAll());
155 const AutocompleteResult& result = autocomplete_controller->result(); 155 const AutocompleteResult& result = autocomplete_controller->result();
156 ASSERT_GE(result.size(), 1U) << AutocompleteResultAsString(result); 156 ASSERT_GE(result.size(), 1U) << AutocompleteResultAsString(result);
157 AutocompleteMatch match = result.match_at(0); 157 AutocompleteMatch match = result.match_at(0);
158 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, match.type); 158 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, match.type);
159 EXPECT_FALSE(match.deletable); 159 EXPECT_FALSE(match.deletable);
160 } 160 }
161 161
162 { 162 {
163 location_bar->Revert(); 163 location_bar->Revert();
164 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); 164 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 location_bar->FocusSearch(); 342 location_bar->FocusSearch();
343 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid()); 343 EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
344 EXPECT_EQ(base::string16(), omnibox_view->GetText()); 344 EXPECT_EQ(base::string16(), omnibox_view->GetText());
345 EXPECT_EQ(default_search_keyword, omnibox_model->keyword()); 345 EXPECT_EQ(default_search_keyword, omnibox_model->keyword());
346 EXPECT_FALSE(omnibox_model->is_keyword_hint()); 346 EXPECT_FALSE(omnibox_model->is_keyword_hint());
347 EXPECT_TRUE(omnibox_model->is_keyword_selected()); 347 EXPECT_TRUE(omnibox_model->is_keyword_selected());
348 348
349 omnibox_view->RevertAll(); 349 omnibox_view->RevertAll();
350 } 350 }
351 } 351 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698