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 27 matching lines...) Expand all Loading... |
38 #include "chrome/common/metrics/variations/variations_util.h" | 38 #include "chrome/common/metrics/variations/variations_util.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/test/base/testing_browser_process.h" | 40 #include "chrome/test/base/testing_browser_process.h" |
41 #include "chrome/test/base/testing_profile.h" | 41 #include "chrome/test/base/testing_profile.h" |
42 #include "components/variations/entropy_provider.h" | 42 #include "components/variations/entropy_provider.h" |
43 #include "content/public/test/test_browser_thread_bundle.h" | 43 #include "content/public/test/test_browser_thread_bundle.h" |
44 #include "net/url_request/test_url_fetcher_factory.h" | 44 #include "net/url_request/test_url_fetcher_factory.h" |
45 #include "net/url_request/url_request_status.h" | 45 #include "net/url_request/url_request_status.h" |
46 #include "testing/gtest/include/gtest/gtest.h" | 46 #include "testing/gtest/include/gtest/gtest.h" |
47 | 47 |
| 48 using base::ASCIIToUTF16; |
| 49 |
48 namespace { | 50 namespace { |
49 | 51 |
50 // Returns the first match in |matches| with |allowed_to_be_default_match| | 52 // Returns the first match in |matches| with |allowed_to_be_default_match| |
51 // set to true. | 53 // set to true. |
52 ACMatches::const_iterator FindDefaultMatch(const ACMatches& matches) { | 54 ACMatches::const_iterator FindDefaultMatch(const ACMatches& matches) { |
53 ACMatches::const_iterator it = matches.begin(); | 55 ACMatches::const_iterator it = matches.begin(); |
54 while ((it != matches.end()) && !it->allowed_to_be_default_match) | 56 while ((it != matches.end()) && !it->allowed_to_be_default_match) |
55 ++it; | 57 ++it; |
56 return it; | 58 return it; |
57 } | 59 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 286 |
285 // Shutdown the provider before the profile. | 287 // Shutdown the provider before the profile. |
286 provider_ = NULL; | 288 provider_ = NULL; |
287 } | 289 } |
288 | 290 |
289 void SearchProviderTest::RunTest(TestData* cases, | 291 void SearchProviderTest::RunTest(TestData* cases, |
290 int num_cases, | 292 int num_cases, |
291 bool prefer_keyword) { | 293 bool prefer_keyword) { |
292 ACMatches matches; | 294 ACMatches matches; |
293 for (int i = 0; i < num_cases; ++i) { | 295 for (int i = 0; i < num_cases; ++i) { |
294 AutocompleteInput input(cases[i].input, base::string16::npos, base::string16
(), GURL(), | 296 AutocompleteInput input(cases[i].input, base::string16::npos, |
| 297 base::string16(), GURL(), |
295 AutocompleteInput::INVALID_SPEC, false, | 298 AutocompleteInput::INVALID_SPEC, false, |
296 prefer_keyword, true, | 299 prefer_keyword, true, |
297 AutocompleteInput::ALL_MATCHES); | 300 AutocompleteInput::ALL_MATCHES); |
298 provider_->Start(input, false); | 301 provider_->Start(input, false); |
299 matches = provider_->matches(); | 302 matches = provider_->matches(); |
300 base::string16 diagnostic_details = ASCIIToUTF16("Input was: ") + cases[i].i
nput + | 303 base::string16 diagnostic_details = |
| 304 ASCIIToUTF16("Input was: ") + |
| 305 cases[i].input + |
301 ASCIIToUTF16("; prefer_keyword was: ") + | 306 ASCIIToUTF16("; prefer_keyword was: ") + |
302 (prefer_keyword ? ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 307 (prefer_keyword ? ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
303 EXPECT_EQ(cases[i].num_results, matches.size()) << diagnostic_details; | 308 EXPECT_EQ(cases[i].num_results, matches.size()) << diagnostic_details; |
304 if (matches.size() == cases[i].num_results) { | 309 if (matches.size() == cases[i].num_results) { |
305 for (size_t j = 0; j < cases[i].num_results; ++j) { | 310 for (size_t j = 0; j < cases[i].num_results; ++j) { |
306 EXPECT_EQ(cases[i].output[j].gurl, matches[j].destination_url) << | 311 EXPECT_EQ(cases[i].output[j].gurl, matches[j].destination_url) << |
307 diagnostic_details; | 312 diagnostic_details; |
308 EXPECT_EQ(cases[i].output[j].result_type, matches[j].type) << | 313 EXPECT_EQ(cases[i].output[j].result_type, matches[j].type) << |
309 diagnostic_details; | 314 diagnostic_details; |
310 EXPECT_EQ(cases[i].output[j].fill_into_edit, | 315 EXPECT_EQ(cases[i].output[j].fill_into_edit, |
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 EXPECT_TRUE(match_prevent.inline_autocompletion.empty()); | 3214 EXPECT_TRUE(match_prevent.inline_autocompletion.empty()); |
3210 EXPECT_FALSE(match_prevent.allowed_to_be_default_match); | 3215 EXPECT_FALSE(match_prevent.allowed_to_be_default_match); |
3211 EXPECT_EQ(url, match_prevent.contents); | 3216 EXPECT_EQ(url, match_prevent.contents); |
3212 } | 3217 } |
3213 | 3218 |
3214 // Verifies that input "w" marks a more significant domain label than "www.". | 3219 // Verifies that input "w" marks a more significant domain label than "www.". |
3215 TEST_F(SearchProviderTest, NavigationInlineDomainClassify) { | 3220 TEST_F(SearchProviderTest, NavigationInlineDomainClassify) { |
3216 QueryForInput(ASCIIToUTF16("w"), false, false); | 3221 QueryForInput(ASCIIToUTF16("w"), false, false); |
3217 AutocompleteMatch match( | 3222 AutocompleteMatch match( |
3218 provider_->NavigationToMatch(SearchProvider::NavigationResult( | 3223 provider_->NavigationToMatch(SearchProvider::NavigationResult( |
3219 *provider_.get(), GURL("http://www.wow.com"), base::string16(), false,
0, | 3224 *provider_.get(), GURL("http://www.wow.com"), base::string16(), false, |
3220 false))); | 3225 0, false))); |
3221 EXPECT_EQ(ASCIIToUTF16("ow.com"), match.inline_autocompletion); | 3226 EXPECT_EQ(ASCIIToUTF16("ow.com"), match.inline_autocompletion); |
3222 EXPECT_TRUE(match.allowed_to_be_default_match); | 3227 EXPECT_TRUE(match.allowed_to_be_default_match); |
3223 EXPECT_EQ(ASCIIToUTF16("www.wow.com"), match.fill_into_edit); | 3228 EXPECT_EQ(ASCIIToUTF16("www.wow.com"), match.fill_into_edit); |
3224 EXPECT_EQ(ASCIIToUTF16("www.wow.com"), match.contents); | 3229 EXPECT_EQ(ASCIIToUTF16("www.wow.com"), match.contents); |
3225 | 3230 |
3226 // Ensure that the match for input "w" is marked on "wow" and not "www". | 3231 // Ensure that the match for input "w" is marked on "wow" and not "www". |
3227 ASSERT_EQ(3U, match.contents_class.size()); | 3232 ASSERT_EQ(3U, match.contents_class.size()); |
3228 EXPECT_EQ(0U, match.contents_class[0].offset); | 3233 EXPECT_EQ(0U, match.contents_class[0].offset); |
3229 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, | 3234 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, |
3230 match.contents_class[0].style); | 3235 match.contents_class[0].style); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3385 provider_->default_results_.suggest_results.push_back( | 3390 provider_->default_results_.suggest_results.push_back( |
3386 SearchProvider::SuggestResult( | 3391 SearchProvider::SuggestResult( |
3387 ASCIIToUTF16(suggestion), AutocompleteMatchType::SEARCH_SUGGEST, | 3392 ASCIIToUTF16(suggestion), AutocompleteMatchType::SEARCH_SUGGEST, |
3388 base::string16(), base::string16(), std::string(), | 3393 base::string16(), base::string16(), std::string(), |
3389 std::string(), false, cases[i].results[j].relevance, false, | 3394 std::string(), false, cases[i].results[j].relevance, false, |
3390 false)); | 3395 false)); |
3391 } | 3396 } |
3392 } | 3397 } |
3393 | 3398 |
3394 provider_->input_ = AutocompleteInput( | 3399 provider_->input_ = AutocompleteInput( |
3395 ASCIIToUTF16(cases[i].omnibox_input), base::string16::npos, base::string
16(), | 3400 ASCIIToUTF16(cases[i].omnibox_input), base::string16::npos, |
3396 GURL(), AutocompleteInput::INVALID_SPEC, false, false, true, | 3401 base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, |
3397 AutocompleteInput::ALL_MATCHES); | 3402 true, AutocompleteInput::ALL_MATCHES); |
3398 provider_->RemoveAllStaleResults(); | 3403 provider_->RemoveAllStaleResults(); |
3399 | 3404 |
3400 // Check cached results. | 3405 // Check cached results. |
3401 SearchProvider::SuggestResults::const_iterator sug_it = | 3406 SearchProvider::SuggestResults::const_iterator sug_it = |
3402 provider_->default_results_.suggest_results.begin(); | 3407 provider_->default_results_.suggest_results.begin(); |
3403 const SearchProvider::SuggestResults::const_iterator sug_end = | 3408 const SearchProvider::SuggestResults::const_iterator sug_end = |
3404 provider_->default_results_.suggest_results.end(); | 3409 provider_->default_results_.suggest_results.end(); |
3405 SearchProvider::NavigationResults::const_iterator nav_it = | 3410 SearchProvider::NavigationResults::const_iterator nav_it = |
3406 provider_->default_results_.navigation_results.begin(); | 3411 provider_->default_results_.navigation_results.begin(); |
3407 const SearchProvider::NavigationResults::const_iterator nav_end = | 3412 const SearchProvider::NavigationResults::const_iterator nav_end = |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3494 | 3499 |
3495 SCOPED_TRACE("for input with json = " + cases[i].response_json); | 3500 SCOPED_TRACE("for input with json = " + cases[i].response_json); |
3496 | 3501 |
3497 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); | 3502 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); |
3498 size_t j = 0; | 3503 size_t j = 0; |
3499 // Ensure that the returned matches equal the expectations. | 3504 // Ensure that the returned matches equal the expectations. |
3500 for (; j < matches.size(); ++j) { | 3505 for (; j < matches.size(); ++j) { |
3501 const Match& match = cases[i].matches[j]; | 3506 const Match& match = cases[i].matches[j]; |
3502 SCOPED_TRACE(" and match index: " + base::IntToString(j)); | 3507 SCOPED_TRACE(" and match index: " + base::IntToString(j)); |
3503 EXPECT_EQ(match.contents, | 3508 EXPECT_EQ(match.contents, |
3504 UTF16ToUTF8(matches[j].contents)); | 3509 base::UTF16ToUTF8(matches[j].contents)); |
3505 EXPECT_EQ(match.description, | 3510 EXPECT_EQ(match.description, |
3506 UTF16ToUTF8(matches[j].description)); | 3511 base::UTF16ToUTF8(matches[j].description)); |
3507 EXPECT_EQ(match.query_params, | 3512 EXPECT_EQ(match.query_params, |
3508 matches[j].search_terms_args->suggest_query_params); | 3513 matches[j].search_terms_args->suggest_query_params); |
3509 EXPECT_EQ(match.fill_into_edit, | 3514 EXPECT_EQ(match.fill_into_edit, |
3510 UTF16ToUTF8(matches[j].fill_into_edit)); | 3515 base::UTF16ToUTF8(matches[j].fill_into_edit)); |
3511 EXPECT_EQ(match.type, matches[j].type); | 3516 EXPECT_EQ(match.type, matches[j].type); |
3512 } | 3517 } |
3513 // Ensure that no expected matches are missing. | 3518 // Ensure that no expected matches are missing. |
3514 for (; j < ARRAYSIZE_UNSAFE(cases[i].matches); ++j) { | 3519 for (; j < ARRAYSIZE_UNSAFE(cases[i].matches); ++j) { |
3515 SCOPED_TRACE(" and match index: " + base::IntToString(j)); | 3520 SCOPED_TRACE(" and match index: " + base::IntToString(j)); |
3516 EXPECT_EQ(cases[i].matches[j].contents, kNotApplicable); | 3521 EXPECT_EQ(cases[i].matches[j].contents, kNotApplicable); |
3517 EXPECT_EQ(cases[i].matches[j].description, kNotApplicable); | 3522 EXPECT_EQ(cases[i].matches[j].description, kNotApplicable); |
3518 EXPECT_EQ(cases[i].matches[j].query_params, kNotApplicable); | 3523 EXPECT_EQ(cases[i].matches[j].query_params, kNotApplicable); |
3519 EXPECT_EQ(cases[i].matches[j].fill_into_edit, kNotApplicable); | 3524 EXPECT_EQ(cases[i].matches[j].fill_into_edit, kNotApplicable); |
3520 EXPECT_EQ(cases[i].matches[j].type, AutocompleteMatchType::NUM_TYPES); | 3525 EXPECT_EQ(cases[i].matches[j].type, AutocompleteMatchType::NUM_TYPES); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3642 "for input with json =" + cases[i].default_provider_response_json; | 3647 "for input with json =" + cases[i].default_provider_response_json; |
3643 const ACMatches& matches = provider_->matches(); | 3648 const ACMatches& matches = provider_->matches(); |
3644 // The top match must inline and score as highly as calculated verbatim. | 3649 // The top match must inline and score as highly as calculated verbatim. |
3645 ASSERT_FALSE(matches.empty()); | 3650 ASSERT_FALSE(matches.empty()); |
3646 EXPECT_GE(matches[0].relevance, 1300); | 3651 EXPECT_GE(matches[0].relevance, 1300); |
3647 | 3652 |
3648 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); | 3653 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); |
3649 // Ensure that the returned matches equal the expectations. | 3654 // Ensure that the returned matches equal the expectations. |
3650 for (size_t j = 0; j < matches.size(); ++j) { | 3655 for (size_t j = 0; j < matches.size(); ++j) { |
3651 SCOPED_TRACE(description); | 3656 SCOPED_TRACE(description); |
3652 EXPECT_EQ(cases[i].matches[j].contents, UTF16ToUTF8(matches[j].contents)); | 3657 EXPECT_EQ(cases[i].matches[j].contents, |
| 3658 base::UTF16ToUTF8(matches[j].contents)); |
3653 EXPECT_EQ(cases[i].matches[j].allowed_to_be_prefetched, | 3659 EXPECT_EQ(cases[i].matches[j].allowed_to_be_prefetched, |
3654 SearchProvider::ShouldPrefetch(matches[j])); | 3660 SearchProvider::ShouldPrefetch(matches[j])); |
3655 EXPECT_EQ(cases[i].matches[j].type, matches[j].type); | 3661 EXPECT_EQ(cases[i].matches[j].type, matches[j].type); |
3656 EXPECT_EQ(cases[i].matches[j].from_keyword, | 3662 EXPECT_EQ(cases[i].matches[j].from_keyword, |
3657 matches[j].keyword == ASCIIToUTF16("k")); | 3663 matches[j].keyword == ASCIIToUTF16("k")); |
3658 } | 3664 } |
3659 } | 3665 } |
3660 } | 3666 } |
3661 | 3667 |
3662 TEST_F(SearchProviderTest, XSSIGuardedJSONParsing_InvalidResponse) { | 3668 TEST_F(SearchProviderTest, XSSIGuardedJSONParsing_InvalidResponse) { |
(...skipping 10 matching lines...) Expand all Loading... |
3673 fetcher->set_response_code(200); | 3679 fetcher->set_response_code(200); |
3674 fetcher->SetResponseString("this is a bad non-json response"); | 3680 fetcher->SetResponseString("this is a bad non-json response"); |
3675 fetcher->delegate()->OnURLFetchComplete(fetcher); | 3681 fetcher->delegate()->OnURLFetchComplete(fetcher); |
3676 | 3682 |
3677 RunTillProviderDone(); | 3683 RunTillProviderDone(); |
3678 | 3684 |
3679 const ACMatches& matches = provider_->matches(); | 3685 const ACMatches& matches = provider_->matches(); |
3680 | 3686 |
3681 // Should have exactly one "search what you typed" match | 3687 // Should have exactly one "search what you typed" match |
3682 ASSERT_TRUE(matches.size() == 1); | 3688 ASSERT_TRUE(matches.size() == 1); |
3683 EXPECT_EQ(input_str, UTF16ToUTF8(matches[0].contents)); | 3689 EXPECT_EQ(input_str, base::UTF16ToUTF8(matches[0].contents)); |
3684 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, | 3690 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, |
3685 matches[0].type); | 3691 matches[0].type); |
3686 } | 3692 } |
3687 | 3693 |
3688 // A basic test that verifies that the XSSI guarded JSON response is parsed | 3694 // A basic test that verifies that the XSSI guarded JSON response is parsed |
3689 // correctly. | 3695 // correctly. |
3690 TEST_F(SearchProviderTest, XSSIGuardedJSONParsing_ValidResponses) { | 3696 TEST_F(SearchProviderTest, XSSIGuardedJSONParsing_ValidResponses) { |
3691 struct Match { | 3697 struct Match { |
3692 std::string contents; | 3698 std::string contents; |
3693 AutocompleteMatchType::Type type; | 3699 AutocompleteMatchType::Type type; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3755 // The top match must inline and score as highly as calculated verbatim. | 3761 // The top match must inline and score as highly as calculated verbatim. |
3756 ASSERT_FALSE(matches.empty()); | 3762 ASSERT_FALSE(matches.empty()); |
3757 EXPECT_GE(matches[0].relevance, 1300); | 3763 EXPECT_GE(matches[0].relevance, 1300); |
3758 | 3764 |
3759 SCOPED_TRACE("for case: " + base::IntToString(i)); | 3765 SCOPED_TRACE("for case: " + base::IntToString(i)); |
3760 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); | 3766 ASSERT_LE(matches.size(), ARRAYSIZE_UNSAFE(cases[i].matches)); |
3761 size_t j = 0; | 3767 size_t j = 0; |
3762 // Ensure that the returned matches equal the expectations. | 3768 // Ensure that the returned matches equal the expectations. |
3763 for (; j < matches.size(); ++j) { | 3769 for (; j < matches.size(); ++j) { |
3764 SCOPED_TRACE("and match: " + base::IntToString(j)); | 3770 SCOPED_TRACE("and match: " + base::IntToString(j)); |
3765 EXPECT_EQ(cases[i].matches[j].contents, UTF16ToUTF8(matches[j].contents)); | 3771 EXPECT_EQ(cases[i].matches[j].contents, |
| 3772 base::UTF16ToUTF8(matches[j].contents)); |
3766 EXPECT_EQ(cases[i].matches[j].type, matches[j].type); | 3773 EXPECT_EQ(cases[i].matches[j].type, matches[j].type); |
3767 } | 3774 } |
3768 for (; j < ARRAYSIZE_UNSAFE(cases[i].matches); ++j) { | 3775 for (; j < ARRAYSIZE_UNSAFE(cases[i].matches); ++j) { |
3769 SCOPED_TRACE("and match: " + base::IntToString(j)); | 3776 SCOPED_TRACE("and match: " + base::IntToString(j)); |
3770 EXPECT_EQ(cases[i].matches[j].contents, kNotApplicable); | 3777 EXPECT_EQ(cases[i].matches[j].contents, kNotApplicable); |
3771 EXPECT_EQ(cases[i].matches[j].type, AutocompleteMatchType::NUM_TYPES); | 3778 EXPECT_EQ(cases[i].matches[j].type, AutocompleteMatchType::NUM_TYPES); |
3772 } | 3779 } |
3773 } | 3780 } |
3774 } | 3781 } |
3775 | 3782 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3836 RunTillProviderDone(); | 3843 RunTillProviderDone(); |
3837 | 3844 |
3838 const ACMatches& matches = provider_->matches(); | 3845 const ACMatches& matches = provider_->matches(); |
3839 ASSERT_FALSE(matches.empty()); | 3846 ASSERT_FALSE(matches.empty()); |
3840 | 3847 |
3841 SCOPED_TRACE("for input with json = " + cases[i].response_json); | 3848 SCOPED_TRACE("for input with json = " + cases[i].response_json); |
3842 | 3849 |
3843 for (size_t j = 0; j < matches.size(); ++j) { | 3850 for (size_t j = 0; j < matches.size(); ++j) { |
3844 const Match& match = cases[i].matches[j]; | 3851 const Match& match = cases[i].matches[j]; |
3845 SCOPED_TRACE(" and match index: " + base::IntToString(j)); | 3852 SCOPED_TRACE(" and match index: " + base::IntToString(j)); |
3846 EXPECT_EQ(match.contents, UTF16ToUTF8(matches[j].contents)); | 3853 EXPECT_EQ(match.contents, base::UTF16ToUTF8(matches[j].contents)); |
3847 EXPECT_EQ(match.deletion_url, matches[j].GetAdditionalInfo( | 3854 EXPECT_EQ(match.deletion_url, matches[j].GetAdditionalInfo( |
3848 "deletion_url")); | 3855 "deletion_url")); |
3849 } | 3856 } |
3850 } | 3857 } |
3851 } | 3858 } |
3852 | 3859 |
3853 TEST_F(SearchProviderTest, ReflectsBookmarkBarState) { | 3860 TEST_F(SearchProviderTest, ReflectsBookmarkBarState) { |
3854 profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); | 3861 profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); |
3855 base::string16 term = term1_.substr(0, term1_.length() - 1); | 3862 base::string16 term = term1_.substr(0, term1_.length() - 1); |
3856 QueryForInput(term, true, false); | 3863 QueryForInput(term, true, false); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4023 EXPECT_FALSE(provider_->deletion_handlers_.empty()); | 4030 EXPECT_FALSE(provider_->deletion_handlers_.empty()); |
4024 // Set up a default fetcher with provided results. | 4031 // Set up a default fetcher with provided results. |
4025 fetcher = test_factory_.GetFetcherByID( | 4032 fetcher = test_factory_.GetFetcherByID( |
4026 SearchProvider::kDeletionURLFetcherID); | 4033 SearchProvider::kDeletionURLFetcherID); |
4027 ASSERT_TRUE(fetcher); | 4034 ASSERT_TRUE(fetcher); |
4028 fetcher->set_response_code(500); | 4035 fetcher->set_response_code(500); |
4029 fetcher->delegate()->OnURLFetchComplete(fetcher); | 4036 fetcher->delegate()->OnURLFetchComplete(fetcher); |
4030 EXPECT_TRUE(provider_->deletion_handlers_.empty()); | 4037 EXPECT_TRUE(provider_->deletion_handlers_.empty()); |
4031 EXPECT_FALSE(provider_->is_success()); | 4038 EXPECT_FALSE(provider_->is_success()); |
4032 } | 4039 } |
OLD | NEW |