| 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 "components/omnibox/autocomplete_provider.h" | 5 #include "components/omnibox/autocomplete_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 void AutocompleteProviderTest::RunKeywordTest(const base::string16& input, | 376 void AutocompleteProviderTest::RunKeywordTest(const base::string16& input, |
| 377 const KeywordTestData* match_data, | 377 const KeywordTestData* match_data, |
| 378 size_t size) { | 378 size_t size) { |
| 379 ACMatches matches; | 379 ACMatches matches; |
| 380 for (size_t i = 0; i < size; ++i) { | 380 for (size_t i = 0; i < size; ++i) { |
| 381 AutocompleteMatch match; | 381 AutocompleteMatch match; |
| 382 match.relevance = 1000; // Arbitrary non-zero value. | 382 match.relevance = 1000; // Arbitrary non-zero value. |
| 383 match.allowed_to_be_default_match = true; | 383 match.allowed_to_be_default_match = true; |
| 384 match.fill_into_edit = match_data[i].fill_into_edit; | 384 match.fill_into_edit = match_data[i].fill_into_edit; |
| 385 match.transition = content::PAGE_TRANSITION_KEYWORD; | 385 match.transition = ui::PAGE_TRANSITION_KEYWORD; |
| 386 match.keyword = match_data[i].keyword; | 386 match.keyword = match_data[i].keyword; |
| 387 matches.push_back(match); | 387 matches.push_back(match); |
| 388 } | 388 } |
| 389 | 389 |
| 390 AutocompleteResult result; | 390 AutocompleteResult result; |
| 391 result.AppendMatches(matches); | 391 result.AppendMatches(matches); |
| 392 controller_->input_ = AutocompleteInput( | 392 controller_->input_ = AutocompleteInput( |
| 393 input, base::string16::npos, base::string16(), GURL(), | 393 input, base::string16::npos, base::string16(), GURL(), |
| 394 metrics::OmniboxEventProto::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS, | 394 metrics::OmniboxEventProto::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS, |
| 395 false, true, true, true, ChromeAutocompleteSchemeClassifier(&profile_)); | 395 false, true, true, true, ChromeAutocompleteSchemeClassifier(&profile_)); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 728 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 729 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); | 729 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j0j4&", url.path()); |
| 730 | 730 |
| 731 // Test page classification and field trial triggered set. | 731 // Test page classification and field trial triggered set. |
| 732 controller_->search_provider_->field_trial_triggered_in_session_ = true; | 732 controller_->search_provider_->field_trial_triggered_in_session_ = true; |
| 733 EXPECT_TRUE( | 733 EXPECT_TRUE( |
| 734 controller_->search_provider_->field_trial_triggered_in_session()); | 734 controller_->search_provider_->field_trial_triggered_in_session()); |
| 735 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); | 735 url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); |
| 736 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); | 736 EXPECT_EQ("//aqs=chrome.0.69i57j69i58j5l2j0l3j69i59.2456j1j4&", url.path()); |
| 737 } | 737 } |
| OLD | NEW |