| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } // namespace | 112 } // namespace |
| 113 | 113 |
| 114 // SearchProviderInstallDataTest ---------------------------------------------- | 114 // SearchProviderInstallDataTest ---------------------------------------------- |
| 115 | 115 |
| 116 // Provides basic test set-up/tear-down functionality needed by all tests | 116 // Provides basic test set-up/tear-down functionality needed by all tests |
| 117 // that use TemplateURLServiceTestUtil. | 117 // that use TemplateURLServiceTestUtil. |
| 118 class SearchProviderInstallDataTest : public testing::Test { | 118 class SearchProviderInstallDataTest : public testing::Test { |
| 119 public: | 119 public: |
| 120 SearchProviderInstallDataTest(); | 120 SearchProviderInstallDataTest(); |
| 121 | 121 |
| 122 virtual void SetUp() override; | 122 void SetUp() override; |
| 123 virtual void TearDown() override; | 123 void TearDown() override; |
| 124 | 124 |
| 125 TemplateURL* AddNewTemplateURL(const std::string& url, | 125 TemplateURL* AddNewTemplateURL(const std::string& url, |
| 126 const base::string16& keyword); | 126 const base::string16& keyword); |
| 127 | 127 |
| 128 // Sets the Google base URL to |base_url| and runs the IO thread for | 128 // Sets the Google base URL to |base_url| and runs the IO thread for |
| 129 // |SearchProviderInstallData| to process the update. | 129 // |SearchProviderInstallData| to process the update. |
| 130 void SetGoogleBaseURLAndProcessOnIOThread(GURL base_url); | 130 void SetGoogleBaseURLAndProcessOnIOThread(GURL base_url); |
| 131 | 131 |
| 132 TemplateURLServiceTestUtil* util() { return &util_; } | 132 TemplateURLServiceTestUtil* util() { return &util_; } |
| 133 SearchProviderInstallData* install_data() { return install_data_; } | 133 SearchProviderInstallData* install_data() { return install_data_; } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 // Verify the search providers install state (with no default set). | 270 // Verify the search providers install state (with no default set). |
| 271 test_get_install_state.RunTests(google_host, std::string()); | 271 test_get_install_state.RunTests(google_host, std::string()); |
| 272 | 272 |
| 273 // Change the Google base url. | 273 // Change the Google base url. |
| 274 google_host = "foo.com"; | 274 google_host = "foo.com"; |
| 275 SetGoogleBaseURLAndProcessOnIOThread(GURL("http://" + google_host + "/")); | 275 SetGoogleBaseURLAndProcessOnIOThread(GURL("http://" + google_host + "/")); |
| 276 | 276 |
| 277 // Verify that the change got picked up. | 277 // Verify that the change got picked up. |
| 278 test_get_install_state.RunTests(google_host, std::string()); | 278 test_get_install_state.RunTests(google_host, std::string()); |
| 279 } | 279 } |
| OLD | NEW |