OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/autocomplete/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3385 provider_->default_results_.navigation_results.push_back( | 3385 provider_->default_results_.navigation_results.push_back( |
3386 SearchProvider::NavigationResult( | 3386 SearchProvider::NavigationResult( |
3387 *provider_.get(), GURL(suggestion), base::string16(), false, | 3387 *provider_.get(), GURL(suggestion), base::string16(), false, |
3388 cases[i].results[j].relevance, false)); | 3388 cases[i].results[j].relevance, false)); |
3389 } else { | 3389 } else { |
3390 provider_->default_results_.suggest_results.push_back( | 3390 provider_->default_results_.suggest_results.push_back( |
3391 SearchProvider::SuggestResult( | 3391 SearchProvider::SuggestResult( |
3392 ASCIIToUTF16(suggestion), AutocompleteMatchType::SEARCH_SUGGEST, | 3392 ASCIIToUTF16(suggestion), AutocompleteMatchType::SEARCH_SUGGEST, |
3393 base::string16(), base::string16(), std::string(), | 3393 base::string16(), base::string16(), std::string(), |
3394 std::string(), false, cases[i].results[j].relevance, false, | 3394 std::string(), false, cases[i].results[j].relevance, false, |
3395 false)); | 3395 false, ASCIIToUTF16(cases[i].omnibox_input))); |
3396 } | 3396 } |
3397 } | 3397 } |
3398 | 3398 |
3399 provider_->input_ = AutocompleteInput( | 3399 provider_->input_ = AutocompleteInput( |
3400 ASCIIToUTF16(cases[i].omnibox_input), base::string16::npos, | 3400 ASCIIToUTF16(cases[i].omnibox_input), base::string16::npos, |
3401 base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, | 3401 base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, |
3402 true, AutocompleteInput::ALL_MATCHES); | 3402 true, AutocompleteInput::ALL_MATCHES); |
3403 provider_->RemoveAllStaleResults(); | 3403 provider_->RemoveAllStaleResults(); |
3404 | 3404 |
3405 // Check cached results. | 3405 // Check cached results. |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4030 EXPECT_FALSE(provider_->deletion_handlers_.empty()); | 4030 EXPECT_FALSE(provider_->deletion_handlers_.empty()); |
4031 // Set up a default fetcher with provided results. | 4031 // Set up a default fetcher with provided results. |
4032 fetcher = test_factory_.GetFetcherByID( | 4032 fetcher = test_factory_.GetFetcherByID( |
4033 SearchProvider::kDeletionURLFetcherID); | 4033 SearchProvider::kDeletionURLFetcherID); |
4034 ASSERT_TRUE(fetcher); | 4034 ASSERT_TRUE(fetcher); |
4035 fetcher->set_response_code(500); | 4035 fetcher->set_response_code(500); |
4036 fetcher->delegate()->OnURLFetchComplete(fetcher); | 4036 fetcher->delegate()->OnURLFetchComplete(fetcher); |
4037 EXPECT_TRUE(provider_->deletion_handlers_.empty()); | 4037 EXPECT_TRUE(provider_->deletion_handlers_.empty()); |
4038 EXPECT_FALSE(provider_->is_success()); | 4038 EXPECT_FALSE(provider_->is_success()); |
4039 } | 4039 } |
OLD | NEW |