summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authorlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 20:44:08 +0000
committerlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 20:44:08 +0000
commit92c6d20388d078771d35a56cfa4b54e080df40d0 (patch)
tree9c01a5ab19f369ff8c5b7b92c780728b0ba36036 /chrome/browser/search_engines
parent3698a31f6aa68b355b10c8532ce0895f83fe9627 (diff)
downloadchromium_src-92c6d20388d078771d35a56cfa4b54e080df40d0.zip
chromium_src-92c6d20388d078771d35a56cfa4b54e080df40d0.tar.gz
chromium_src-92c6d20388d078771d35a56cfa4b54e080df40d0.tar.bz2
Make the test code that changes the GoogleBaseURL do a notification (instead of
directly calling a method) to more closely mimic the way this usually happens. This is being done to avoid making special "update GoogleBaseURL" method calls both here and in future tests, and helps ensure that the notification observer code is set-up correctly. BUG=38475 TEST=unit_tests --gtest_filter=Temp* Review URL: http://codereview.chromium.org/3420007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url_model_test_util.cc5
-rw-r--r--chrome/browser/search_engines/template_url_model_unittest.cc1
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/search_engines/template_url_model_test_util.cc b/chrome/browser/search_engines/template_url_model_test_util.cc
index 3f2984b..35e87e8 100644
--- a/chrome/browser/search_engines/template_url_model_test_util.cc
+++ b/chrome/browser/search_engines/template_url_model_test_util.cc
@@ -9,6 +9,8 @@
#include "base/scoped_temp_dir.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_type.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -187,6 +189,9 @@ std::wstring TemplateURLModelTestUtil::GetAndClearSearchTerm() {
void TemplateURLModelTestUtil::SetGoogleBaseURL(
const std::string& base_url) const {
TemplateURLRef::SetGoogleBaseURL(new std::string(base_url));
+ NotificationService::current()->Notify(NotificationType::GOOGLE_URL_UPDATED,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
}
WebDataService* TemplateURLModelTestUtil::GetWebDataService() {
diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc
index cf01642..6831c20 100644
--- a/chrome/browser/search_engines/template_url_model_unittest.cc
+++ b/chrome/browser/search_engines/template_url_model_unittest.cc
@@ -733,7 +733,6 @@ TEST_F(TemplateURLModelTest, ChangeGoogleBaseValue) {
// Change the Google base url.
test_util_.ResetObserverCount();
SetGoogleBaseURL("http://foo.com/");
- model()->GoogleBaseURLChanged();
VerifyObserverCount(1);
// Make sure the host->TemplateURL map was updated appropriately.