| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |