Index: chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc |
diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc b/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc |
index 70ba2ac162ab66219afe143fd77a7ecf2fb6879f..e7eff7dc465d2a573866956edc9083ce66017353 100644 |
--- a/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc |
+++ b/chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/search_engines/template_url_service_factory.h" |
#include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
#include "chrome/browser/ui/search_engines/template_url_table_model.h" |
+#include "chrome/browser/webdata/web_data_service_factory.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/test/base/testing_pref_service.h" |
@@ -30,6 +31,8 @@ static const string16 kB1(ASCIIToUTF16("b1")); |
class KeywordEditorControllerTest : public testing::Test, |
public ui::TableModelObserver { |
public: |
+ KeywordEditorControllerTest() {} |
+ |
// Initializes all of the state. |
void Init(bool simulate_load_failure); |
@@ -94,6 +97,12 @@ class KeywordEditorControllerTest : public testing::Test, |
return controller_->table_model(); |
} |
+ // Build no service. |
+ static scoped_refptr<RefcountedProfileKeyedService> BuildNull( |
+ Profile* profile) { |
+ return NULL; |
+ } |
+ |
protected: |
MessageLoopForUI message_loop_; |
scoped_ptr<TestingProfile> profile_; |
@@ -115,6 +124,9 @@ void KeywordEditorControllerTest::Init(bool simulate_load_failure) { |
profile_.reset(new TestingProfile()); |
profile_->CreateTemplateURLService(); |
+ WebDataServiceFactory::GetInstance()->SetTestingFactory( |
+ profile_.get(), KeywordEditorControllerTest::BuildNull); |
+ |
model_ = TemplateURLServiceFactory::GetForProfile(profile_.get()); |
if (simulate_load_failure) |
model_->OnWebDataServiceRequestDone(0, NULL); |