OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 VerifyInstallState(SearchProviderInstallData::NOT_INSTALLED, | 131 VerifyInstallState(SearchProviderInstallData::NOT_INSTALLED, |
132 "http://a" + search_provider_host_ + "/"); | 132 "http://a" + search_provider_host_ + "/"); |
133 | 133 |
134 // Installed as default. | 134 // Installed as default. |
135 if (!default_search_provider_host_.empty()) { | 135 if (!default_search_provider_host_.empty()) { |
136 VerifyInstallState(SearchProviderInstallData::INSTALLED_AS_DEFAULT, | 136 VerifyInstallState(SearchProviderInstallData::INSTALLED_AS_DEFAULT, |
137 "http://" + default_search_provider_host_ + "/"); | 137 "http://" + default_search_provider_host_ + "/"); |
138 } | 138 } |
139 | 139 |
140 // All done. | 140 // All done. |
141 main_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 141 main_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
142 } | 142 } |
143 | 143 |
144 void TestGetInstallState::VerifyInstallState( | 144 void TestGetInstallState::VerifyInstallState( |
145 SearchProviderInstallData::State expected_state, | 145 SearchProviderInstallData::State expected_state, |
146 const std::string& url) { | 146 const std::string& url) { |
147 | 147 |
148 SearchProviderInstallData::State actual_state = | 148 SearchProviderInstallData::State actual_state = |
149 install_data_->GetInstallState(GURL(url)); | 149 install_data_->GetInstallState(GURL(url)); |
150 if (expected_state == actual_state) | 150 if (expected_state == actual_state) |
151 return; | 151 return; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // Change the Google base url. | 306 // Change the Google base url. |
307 google_host = "foo.com"; | 307 google_host = "foo.com"; |
308 util_.SetGoogleBaseURL("http://" + google_host + "/"); | 308 util_.SetGoogleBaseURL("http://" + google_host + "/"); |
309 // Wait for the I/O thread to process the update notification. | 309 // Wait for the I/O thread to process the update notification. |
310 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests(); | 310 TemplateURLServiceTestUtil::BlockTillIOThreadProcessesRequests(); |
311 | 311 |
312 // Verify that the change got picked up. | 312 // Verify that the change got picked up. |
313 test_get_install_state->set_search_provider_host(google_host); | 313 test_get_install_state->set_search_provider_host(google_host); |
314 EXPECT_TRUE(test_get_install_state->RunTests()); | 314 EXPECT_TRUE(test_get_install_state->RunTests()); |
315 } | 315 } |
OLD | NEW |