Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_provider_unittest.cc |
| =================================================================== |
| --- chrome/browser/autocomplete/autocomplete_provider_unittest.cc (revision 181776) |
| +++ chrome/browser/autocomplete/autocomplete_provider_unittest.cc (working copy) |
| @@ -254,9 +254,10 @@ |
| providers.push_back(provider2); |
| // Reset the controller to contain our new providers. |
| - controller_.reset( |
| - new AutocompleteController(&profile_, NULL, |
| - AutocompleteProvider::TYPE_SEARCH)); |
| + controller_.reset(new AutocompleteController(&profile_, NULL, 0)); |
| + // We're going to swap the providers vector, but the old vector should be |
| + // empty so no elements need to be freed at this point. |
| + EXPECT_TRUE(controller_->providers_.empty()); |
|
Peter Kasting
2013/02/12 01:34:49
Why don't we just use one of the STL util function
H Fung
2013/02/12 02:19:45
I tried to use STLDeleteElements(&controller_->pro
|
| controller_->providers_.swap(providers); |
| provider1->set_listener(controller_.get()); |
| provider2->set_listener(controller_.get()); |
| @@ -559,7 +560,7 @@ |
| } |
| TEST_F(AutocompleteProviderTest, GetDestinationURL) { |
| - ResetControllerWithTestProviders(false, NULL, NULL); |
| + ResetControllerWithKeywordAndSearchProviders(); |
| // For the destination URL to have aqs parameters for query formulation time |
| // and the field trial triggered bit, many conditions need to be satisfied. |
| @@ -597,6 +598,8 @@ |
| // Test field trial triggered bit set. |
| controller_->search_provider_->field_trial_triggered_in_session_ = true; |
| + EXPECT_TRUE(controller_->search_provider_-> |
|
Peter Kasting
2013/02/12 01:34:49
Nit: I'd break after ( instead of ->
H Fung
2013/02/12 02:19:45
Done.
|
| + field_trial_triggered_in_session()); |
| url = controller_->GetDestinationURL(match, |
| base::TimeDelta::FromMilliseconds(2456)); |
| EXPECT_EQ("//aqs=chrome.0.57j58j5l2j0l3j59.2456j1&", url.path()); |