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 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3018 | 3018 |
3019 // Verifies inline autocompletion of navigational results. | 3019 // Verifies inline autocompletion of navigational results. |
3020 TEST_F(SearchProviderTest, NavigationInline) { | 3020 TEST_F(SearchProviderTest, NavigationInline) { |
3021 struct { | 3021 struct { |
3022 const std::string input; | 3022 const std::string input; |
3023 const std::string url; | 3023 const std::string url; |
3024 // Test the expected fill_into_edit, which may drop "http://". | 3024 // Test the expected fill_into_edit, which may drop "http://". |
3025 // Some cases do not trim "http://" to match from the start of the scheme. | 3025 // Some cases do not trim "http://" to match from the start of the scheme. |
3026 const std::string fill_into_edit; | 3026 const std::string fill_into_edit; |
3027 const std::string inline_autocompletion; | 3027 const std::string inline_autocompletion; |
3028 const bool allowed_to_be_default_match; | 3028 const bool allowed_to_be_default_match_in_regular_mode; |
3029 const bool allowed_to_be_default_match_in_prevent_inline_mode; | |
3029 } cases[] = { | 3030 } cases[] = { |
3030 // Do not inline matches that do not contain the input; trim http as needed. | 3031 // Do not inline matches that do not contain the input; trim http as needed. |
3031 { "x", "http://www.abc.com", | 3032 { "x", "http://www.abc.com", |
3032 "www.abc.com", std::string(), false }, | 3033 "www.abc.com", std::string(), false, false }, |
3033 { "https:", "http://www.abc.com", | 3034 { "https:", "http://www.abc.com", |
3034 "www.abc.com", std::string(), false }, | 3035 "www.abc.com", std::string(), false, false }, |
3035 { "abc.com/", "http://www.abc.com", | |
Mark P
2014/02/19 00:26:19
This seems okay to inline; removing this test case
| |
3036 "www.abc.com", std::string(), false }, | |
3037 { "http://www.abc.com/a", "http://www.abc.com", | 3036 { "http://www.abc.com/a", "http://www.abc.com", |
3038 "http://www.abc.com", std::string(), false }, | 3037 "http://www.abc.com", std::string(), false, |
3038 false }, | |
3039 { "http://www.abc.com", "https://www.abc.com", | 3039 { "http://www.abc.com", "https://www.abc.com", |
3040 "https://www.abc.com", std::string(), false }, | 3040 "https://www.abc.com", std::string(), false, |
3041 false }, | |
3041 { "http://abc.com", "ftp://abc.com", | 3042 { "http://abc.com", "ftp://abc.com", |
3042 "ftp://abc.com", std::string(), false }, | 3043 "ftp://abc.com", std::string(), false, |
3044 false }, | |
3043 { "https://www.abc.com", "http://www.abc.com", | 3045 { "https://www.abc.com", "http://www.abc.com", |
3044 "www.abc.com", std::string(), false }, | 3046 "www.abc.com", std::string(), false, |
3047 false }, | |
3045 { "ftp://abc.com", "http://abc.com", | 3048 { "ftp://abc.com", "http://abc.com", |
3046 "abc.com", std::string(), false }, | 3049 "abc.com", std::string(), false, |
3050 false }, | |
3047 | 3051 |
3048 // Do not inline matches with invalid input prefixes; trim http as needed. | 3052 // Do not inline matches with invalid input prefixes; trim http as needed. |
3049 { "ttp", "http://www.abc.com", | 3053 { "ttp", "http://www.abc.com", |
3050 "www.abc.com", std::string(), false }, | 3054 "www.abc.com", std::string(), false, false }, |
3051 { "://w", "http://www.abc.com", | 3055 { "://w", "http://www.abc.com", |
3052 "www.abc.com", std::string(), false }, | 3056 "www.abc.com", std::string(), false, false }, |
3053 { "ww.", "http://www.abc.com", | 3057 { "ww.", "http://www.abc.com", |
3054 "www.abc.com", std::string(), false }, | 3058 "www.abc.com", std::string(), false, false }, |
3055 { ".ab", "http://www.abc.com", | 3059 { ".ab", "http://www.abc.com", |
3056 "www.abc.com", std::string(), false }, | 3060 "www.abc.com", std::string(), false, false }, |
3057 { "bc", "http://www.abc.com", | 3061 { "bc", "http://www.abc.com", |
3058 "www.abc.com", std::string(), false }, | 3062 "www.abc.com", std::string(), false, false }, |
3059 { ".com", "http://www.abc.com", | 3063 { ".com", "http://www.abc.com", |
3060 "www.abc.com", std::string(), false }, | 3064 "www.abc.com", std::string(), false, false }, |
3061 | 3065 |
3062 // Do not inline matches that omit input domain labels; trim http as needed. | 3066 // Do not inline matches that omit input domain labels; trim http as needed. |
3063 { "www.a", "http://a.com", | 3067 { "www.a", "http://a.com", |
3064 "a.com", std::string(), false }, | 3068 "a.com", std::string(), false, false }, |
3065 { "http://www.a", "http://a.com", | 3069 { "http://www.a", "http://a.com", |
3066 "http://a.com", std::string(), false }, | 3070 "http://a.com", std::string(), false, false }, |
3067 { "www.a", "ftp://a.com", | 3071 { "www.a", "ftp://a.com", |
3068 "ftp://a.com", std::string(), false }, | 3072 "ftp://a.com", std::string(), false, false }, |
3069 { "ftp://www.a", "ftp://a.com", | 3073 { "ftp://www.a", "ftp://a.com", |
3070 "ftp://a.com", std::string(), false }, | 3074 "ftp://a.com", std::string(), false, false }, |
3071 | 3075 |
3072 // Input matching but with nothing to inline will not yield an offset, but | 3076 // Input matching but with nothing to inline will not yield an offset, but |
3073 // will be allowed to be default. | 3077 // will be allowed to be default. |
3074 { "abc.com", "http://www.abc.com", | 3078 { "abc.com", "http://www.abc.com", |
3075 "www.abc.com", std::string(), true }, | 3079 "www.abc.com", std::string(), true, true }, |
3076 { "http://www.abc.com", "http://www.abc.com", | 3080 { "abc.com/", "http://www.abc.com", |
3077 "http://www.abc.com", std::string(), true }, | 3081 "www.abc.com", std::string(), true, true }, |
3082 { "http://www.abc.com", "http://www.abc.com", | |
3083 "http://www.abc.com", std::string(), true, true }, | |
3084 { "http://www.abc.com/", "http://www.abc.com", | |
3085 "http://www.abc.com", std::string(), true, true }, | |
3078 | 3086 |
3079 // Inline matches when the input is a leading substring of the scheme. | 3087 // Inline matches when the input is a leading substring of the scheme. |
3080 { "h", "http://www.abc.com", | 3088 { "h", "http://www.abc.com", |
3081 "http://www.abc.com", "ttp://www.abc.com", true }, | 3089 "http://www.abc.com", "ttp://www.abc.com", true, false }, |
3082 { "http", "http://www.abc.com", | 3090 { "http", "http://www.abc.com", |
3083 "http://www.abc.com", "://www.abc.com", true }, | 3091 "http://www.abc.com", "://www.abc.com", true, false }, |
3084 | 3092 |
3085 // Inline matches when the input is a leading substring of the full URL. | 3093 // Inline matches when the input is a leading substring of the full URL. |
3086 { "http:", "http://www.abc.com", | 3094 { "http:", "http://www.abc.com", |
3087 "http://www.abc.com", "//www.abc.com", true }, | 3095 "http://www.abc.com", "//www.abc.com", true, false }, |
3088 { "http://w", "http://www.abc.com", | 3096 { "http://w", "http://www.abc.com", |
3089 "http://www.abc.com", "ww.abc.com", true }, | 3097 "http://www.abc.com", "ww.abc.com", true, false }, |
3090 { "http://www.", "http://www.abc.com", | 3098 { "http://www.", "http://www.abc.com", |
3091 "http://www.abc.com", "abc.com", true }, | 3099 "http://www.abc.com", "abc.com", true, false }, |
3092 { "http://www.ab", "http://www.abc.com", | 3100 { "http://www.ab", "http://www.abc.com", |
3093 "http://www.abc.com", "c.com", true }, | 3101 "http://www.abc.com", "c.com", true, false }, |
3094 { "http://www.abc.com/p", "http://www.abc.com/path/file.htm?q=x#foo", | 3102 { "http://www.abc.com/p", "http://www.abc.com/path/file.htm?q=x#foo", |
3095 "http://www.abc.com/path/file.htm?q=x#foo", | 3103 "http://www.abc.com/path/file.htm?q=x#foo", |
3096 "ath/file.htm?q=x#foo", | 3104 "ath/file.htm?q=x#foo", |
3097 true }, | 3105 true, false }, |
3098 { "http://abc.com/p", "http://abc.com/path/file.htm?q=x#foo", | 3106 { "http://abc.com/p", "http://abc.com/path/file.htm?q=x#foo", |
3099 "http://abc.com/path/file.htm?q=x#foo", | 3107 "http://abc.com/path/file.htm?q=x#foo", |
3100 "ath/file.htm?q=x#foo", true}, | 3108 "ath/file.htm?q=x#foo", |
3109 true, false}, | |
3101 | 3110 |
3102 // Inline matches with valid URLPrefixes; only trim "http://". | 3111 // Inline matches with valid URLPrefixes; only trim "http://". |
3103 { "w", "http://www.abc.com", | 3112 { "w", "http://www.abc.com", |
3104 "www.abc.com", "ww.abc.com", true }, | 3113 "www.abc.com", "ww.abc.com", true, false }, |
3105 { "www.a", "http://www.abc.com", | 3114 { "www.a", "http://www.abc.com", |
3106 "www.abc.com", "bc.com", true }, | 3115 "www.abc.com", "bc.com", true, false }, |
3107 { "abc", "http://www.abc.com", | 3116 { "abc", "http://www.abc.com", |
3108 "www.abc.com", ".com", true }, | 3117 "www.abc.com", ".com", true, false }, |
3109 { "abc.c", "http://www.abc.com", | 3118 { "abc.c", "http://www.abc.com", |
3110 "www.abc.com", "om", true }, | 3119 "www.abc.com", "om", true, false }, |
3111 { "abc.com/p", "http://www.abc.com/path/file.htm?q=x#foo", | 3120 { "abc.com/p", "http://www.abc.com/path/file.htm?q=x#foo", |
3112 "www.abc.com/path/file.htm?q=x#foo", | 3121 "www.abc.com/path/file.htm?q=x#foo", |
3113 "ath/file.htm?q=x#foo", true }, | 3122 "ath/file.htm?q=x#foo", |
3123 true, false }, | |
3114 { "abc.com/p", "http://abc.com/path/file.htm?q=x#foo", | 3124 { "abc.com/p", "http://abc.com/path/file.htm?q=x#foo", |
3115 "abc.com/path/file.htm?q=x#foo", | 3125 "abc.com/path/file.htm?q=x#foo", |
3116 "ath/file.htm?q=x#foo", true }, | 3126 "ath/file.htm?q=x#foo", |
3127 true, false }, | |
3117 | 3128 |
3118 // Inline matches using the maximal URLPrefix components. | 3129 // Inline matches using the maximal URLPrefix components. |
3119 { "h", "http://help.com", | 3130 { "h", "http://help.com", |
3120 "help.com", "elp.com", true }, | 3131 "help.com", "elp.com", true, false }, |
3121 { "http", "http://http.com", | 3132 { "http", "http://http.com", |
3122 "http.com", ".com", true }, | 3133 "http.com", ".com", true, false }, |
3123 { "h", "http://www.help.com", | 3134 { "h", "http://www.help.com", |
3124 "www.help.com", "elp.com", true }, | 3135 "www.help.com", "elp.com", true, false }, |
3125 { "http", "http://www.http.com", | 3136 { "http", "http://www.http.com", |
3126 "www.http.com", ".com", true }, | 3137 "www.http.com", ".com", true, false }, |
3127 { "w", "http://www.www.com", | 3138 { "w", "http://www.www.com", |
3128 "www.www.com", "ww.com", true }, | 3139 "www.www.com", "ww.com", true, false }, |
3129 | 3140 |
3130 // Test similar behavior for the ftp and https schemes. | 3141 // Test similar behavior for the ftp and https schemes. |
3131 { "ftp://www.ab", "ftp://www.abc.com/path/file.htm?q=x#foo", | 3142 { "ftp://www.ab", "ftp://www.abc.com/path/file.htm?q=x#foo", |
Mark P
2014/02/19 00:26:19
I didn't actually change this block, only the spac
| |
3132 "ftp://www.abc.com/path/file.htm?q=x#foo", | 3143 "ftp://www.abc.com/path/file.htm?q=x#foo", |
3133 "c.com/path/file.htm?q=x#foo", true }, | 3144 "c.com/path/file.htm?q=x#foo", true, false }, |
3134 { "www.ab", "ftp://www.abc.com/path/file.htm?q=x#foo", | 3145 { "www.ab", "ftp://www.abc.com/path/file.htm?q=x#foo", |
3135 "ftp://www.abc.com/path/file.htm?q=x#foo", | 3146 "ftp://www.abc.com/path/file.htm?q=x#foo", |
3136 "c.com/path/file.htm?q=x#foo", true }, | 3147 "c.com/path/file.htm?q=x#foo", true, false }, |
3137 { "ab", "ftp://www.abc.com/path/file.htm?q=x#foo", | 3148 { "ab", "ftp://www.abc.com/path/file.htm?q=x#foo", |
3138 "ftp://www.abc.com/path/file.htm?q=x#foo", | 3149 "ftp://www.abc.com/path/file.htm?q=x#foo", |
3139 "c.com/path/file.htm?q=x#foo", true }, | 3150 "c.com/path/file.htm?q=x#foo", true, false }, |
3140 { "ab", "ftp://abc.com/path/file.htm?q=x#foo", | 3151 { "ab", "ftp://abc.com/path/file.htm?q=x#foo", |
3141 "ftp://abc.com/path/file.htm?q=x#foo", | 3152 "ftp://abc.com/path/file.htm?q=x#foo", |
3142 "c.com/path/file.htm?q=x#foo", true }, | 3153 "c.com/path/file.htm?q=x#foo", true, false }, |
3143 { "https://www.ab", "https://www.abc.com/path/file.htm?q=x#foo", | 3154 { "https://www.ab", "https://www.abc.com/path/file.htm?q=x#foo", |
3144 "https://www.abc.com/path/file.htm?q=x#foo", | 3155 "https://www.abc.com/path/file.htm?q=x#foo", |
3145 "c.com/path/file.htm?q=x#foo", true }, | 3156 "c.com/path/file.htm?q=x#foo", |
3146 { "www.ab", "https://www.abc.com/path/file.htm?q=x#foo", | 3157 true, false }, |
3147 "https://www.abc.com/path/file.htm?q=x#foo", | 3158 { "www.ab", "https://www.abc.com/path/file.htm?q=x#foo", |
3148 "c.com/path/file.htm?q=x#foo", true }, | 3159 "https://www.abc.com/path/file.htm?q=x#foo", |
3149 { "ab", "https://www.abc.com/path/file.htm?q=x#foo", | 3160 "c.com/path/file.htm?q=x#foo", true, false }, |
3150 "https://www.abc.com/path/file.htm?q=x#foo", | 3161 { "ab", "https://www.abc.com/path/file.htm?q=x#foo", |
3151 "c.com/path/file.htm?q=x#foo", true }, | 3162 "https://www.abc.com/path/file.htm?q=x#foo", |
3152 { "ab", "https://abc.com/path/file.htm?q=x#foo", | 3163 "c.com/path/file.htm?q=x#foo", true, false }, |
3153 "https://abc.com/path/file.htm?q=x#foo", | 3164 { "ab", "https://abc.com/path/file.htm?q=x#foo", |
3154 "c.com/path/file.htm?q=x#foo", true }, | 3165 "https://abc.com/path/file.htm?q=x#foo", |
3166 "c.com/path/file.htm?q=x#foo", true, false }, | |
3155 | 3167 |
3156 // Forced query input should inline and retain the "?" prefix. | 3168 // Forced query input should inline and retain the "?" prefix. |
3157 { "?http://www.ab", "http://www.abc.com", | 3169 { "?http://www.ab", "http://www.abc.com", |
3158 "?http://www.abc.com", "c.com", true }, | 3170 "?http://www.abc.com", "c.com", true, false }, |
3159 { "?www.ab", "http://www.abc.com", | 3171 { "?www.ab", "http://www.abc.com", |
3160 "?www.abc.com", "c.com", true }, | 3172 "?www.abc.com", "c.com", true, false }, |
3161 { "?ab", "http://www.abc.com", | 3173 { "?ab", "http://www.abc.com", |
3162 "?www.abc.com", "c.com", true }, | 3174 "?www.abc.com", "c.com", true, false }, |
3163 { "?abc.com", "http://www.abc.com", | 3175 { "?abc.com", "http://www.abc.com", |
3164 "?www.abc.com", "", true }, | 3176 "?www.abc.com", "", true, true }, |
3165 }; | 3177 }; |
3166 | 3178 |
3167 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) { | 3179 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) { |
3180 // First test regular mode. | |
3168 QueryForInput(ASCIIToUTF16(cases[i].input), false, false); | 3181 QueryForInput(ASCIIToUTF16(cases[i].input), false, false); |
3169 AutocompleteMatch match( | 3182 AutocompleteMatch match( |
3170 provider_->NavigationToMatch(SearchProvider::NavigationResult( | 3183 provider_->NavigationToMatch(SearchProvider::NavigationResult( |
3171 *provider_.get(), GURL(cases[i].url), base::string16(), false, 0, | 3184 *provider_.get(), GURL(cases[i].url), base::string16(), false, 0, |
3172 false, ASCIIToUTF16(cases[i].input), std::string()))); | 3185 false, ASCIIToUTF16(cases[i].input), std::string()))); |
3173 EXPECT_EQ(ASCIIToUTF16(cases[i].inline_autocompletion), | 3186 EXPECT_EQ(ASCIIToUTF16(cases[i].inline_autocompletion), |
3174 match.inline_autocompletion); | 3187 match.inline_autocompletion); |
3175 EXPECT_EQ(ASCIIToUTF16(cases[i].fill_into_edit), match.fill_into_edit); | 3188 EXPECT_EQ(ASCIIToUTF16(cases[i].fill_into_edit), match.fill_into_edit); |
3176 EXPECT_EQ(cases[i].allowed_to_be_default_match, | 3189 EXPECT_EQ(cases[i].allowed_to_be_default_match_in_regular_mode, |
3177 match.allowed_to_be_default_match); | 3190 match.allowed_to_be_default_match); |
3191 | |
3192 // Then test prevent-inline-autocomplete mode. | |
3193 QueryForInput(ASCIIToUTF16(cases[i].input), true, false); | |
3194 AutocompleteMatch match_prevent_inline( | |
3195 provider_->NavigationToMatch(SearchProvider::NavigationResult( | |
3196 *provider_.get(), GURL(cases[i].url), base::string16(), false, 0, | |
3197 false, ASCIIToUTF16(cases[i].input), std::string()))); | |
3198 EXPECT_EQ(ASCIIToUTF16(cases[i].inline_autocompletion), | |
3199 match_prevent_inline.inline_autocompletion); | |
3200 EXPECT_EQ(ASCIIToUTF16(cases[i].fill_into_edit), | |
3201 match_prevent_inline.fill_into_edit); | |
3202 EXPECT_EQ(cases[i].allowed_to_be_default_match_in_prevent_inline_mode, | |
3203 match_prevent_inline.allowed_to_be_default_match); | |
3178 } | 3204 } |
3179 } | 3205 } |
3180 | 3206 |
3181 // Verifies that "http://" is not trimmed for input that is a leading substring. | 3207 // Verifies that "http://" is not trimmed for input that is a leading substring. |
3182 TEST_F(SearchProviderTest, NavigationInlineSchemeSubstring) { | 3208 TEST_F(SearchProviderTest, NavigationInlineSchemeSubstring) { |
3183 const base::string16 input(ASCIIToUTF16("ht")); | 3209 const base::string16 input(ASCIIToUTF16("ht")); |
3184 const base::string16 url(ASCIIToUTF16("http://a.com")); | 3210 const base::string16 url(ASCIIToUTF16("http://a.com")); |
3185 const SearchProvider::NavigationResult result( | 3211 const SearchProvider::NavigationResult result( |
3186 *provider_.get(), GURL(url), base::string16(), false, 0, false, | 3212 *provider_.get(), GURL(url), base::string16(), false, 0, false, |
3187 input, std::string()); | 3213 input, std::string()); |
3188 | 3214 |
3189 // Check the offset and strings when inline autocompletion is allowed. | 3215 // Check the offset and strings when inline autocompletion is allowed. |
3190 QueryForInput(input, false, false); | 3216 QueryForInput(input, false, false); |
3191 AutocompleteMatch match_inline(provider_->NavigationToMatch(result)); | 3217 AutocompleteMatch match_inline(provider_->NavigationToMatch(result)); |
3192 EXPECT_EQ(url, match_inline.fill_into_edit); | 3218 EXPECT_EQ(url, match_inline.fill_into_edit); |
3193 EXPECT_EQ(url.substr(2), match_inline.inline_autocompletion); | 3219 EXPECT_EQ(url.substr(2), match_inline.inline_autocompletion); |
3194 EXPECT_TRUE(match_inline.allowed_to_be_default_match); | 3220 EXPECT_TRUE(match_inline.allowed_to_be_default_match); |
3195 EXPECT_EQ(url, match_inline.contents); | 3221 EXPECT_EQ(url, match_inline.contents); |
3196 | 3222 |
3197 // Check the same offset and strings when inline autocompletion is prevented. | 3223 // Check the same strings when inline autocompletion is prevented. |
3198 QueryForInput(input, true, false); | 3224 QueryForInput(input, true, false); |
3199 AutocompleteMatch match_prevent(provider_->NavigationToMatch(result)); | 3225 AutocompleteMatch match_prevent(provider_->NavigationToMatch(result)); |
3200 EXPECT_EQ(url, match_prevent.fill_into_edit); | 3226 EXPECT_EQ(url, match_prevent.fill_into_edit); |
3201 EXPECT_TRUE(match_prevent.inline_autocompletion.empty()); | |
3202 EXPECT_FALSE(match_prevent.allowed_to_be_default_match); | 3227 EXPECT_FALSE(match_prevent.allowed_to_be_default_match); |
3203 EXPECT_EQ(url, match_prevent.contents); | 3228 EXPECT_EQ(url, match_prevent.contents); |
3204 } | 3229 } |
3205 | 3230 |
3206 // Verifies that input "w" marks a more significant domain label than "www.". | 3231 // Verifies that input "w" marks a more significant domain label than "www.". |
3207 TEST_F(SearchProviderTest, NavigationInlineDomainClassify) { | 3232 TEST_F(SearchProviderTest, NavigationInlineDomainClassify) { |
3208 QueryForInput(ASCIIToUTF16("w"), false, false); | 3233 QueryForInput(ASCIIToUTF16("w"), false, false); |
3209 AutocompleteMatch match( | 3234 AutocompleteMatch match( |
3210 provider_->NavigationToMatch(SearchProvider::NavigationResult( | 3235 provider_->NavigationToMatch(SearchProvider::NavigationResult( |
3211 *provider_.get(), GURL("http://www.wow.com"), base::string16(), false, | 3236 *provider_.get(), GURL("http://www.wow.com"), base::string16(), false, |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4026 EXPECT_FALSE(provider_->deletion_handlers_.empty()); | 4051 EXPECT_FALSE(provider_->deletion_handlers_.empty()); |
4027 // Set up a default fetcher with provided results. | 4052 // Set up a default fetcher with provided results. |
4028 fetcher = test_factory_.GetFetcherByID( | 4053 fetcher = test_factory_.GetFetcherByID( |
4029 SearchProvider::kDeletionURLFetcherID); | 4054 SearchProvider::kDeletionURLFetcherID); |
4030 ASSERT_TRUE(fetcher); | 4055 ASSERT_TRUE(fetcher); |
4031 fetcher->set_response_code(500); | 4056 fetcher->set_response_code(500); |
4032 fetcher->delegate()->OnURLFetchComplete(fetcher); | 4057 fetcher->delegate()->OnURLFetchComplete(fetcher); |
4033 EXPECT_TRUE(provider_->deletion_handlers_.empty()); | 4058 EXPECT_TRUE(provider_->deletion_handlers_.empty()); |
4034 EXPECT_FALSE(provider_->is_success()); | 4059 EXPECT_FALSE(provider_->is_success()); |
4035 } | 4060 } |
OLD | NEW |