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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/search_engines/template_url.h" | 9 #include "chrome/browser/search_engines/template_url.h" |
10 #include "chrome/browser/search_engines/template_url_service.h" | 10 #include "chrome/browser/search_engines/template_url_service.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 int new_default = controller_->MakeDefaultTemplateURL(0); | 236 int new_default = controller_->MakeDefaultTemplateURL(0); |
237 EXPECT_EQ(0, new_default); | 237 EXPECT_EQ(0, new_default); |
238 } | 238 } |
239 | 239 |
240 // Mutates the TemplateURLService and make sure table model is updating | 240 // Mutates the TemplateURLService and make sure table model is updating |
241 // appropriately. | 241 // appropriately. |
242 TEST_F(KeywordEditorControllerTest, MutateTemplateURLService) { | 242 TEST_F(KeywordEditorControllerTest, MutateTemplateURLService) { |
243 TemplateURLData data; | 243 TemplateURLData data; |
244 data.short_name = ASCIIToUTF16("b"); | 244 data.short_name = ASCIIToUTF16("b"); |
245 data.SetKeyword(ASCIIToUTF16("a")); | 245 data.SetKeyword(ASCIIToUTF16("a")); |
246 TemplateURL* turl = new TemplateURL(data); | 246 TemplateURL* turl = new TemplateURL(profile_.get(), data); |
247 model_->Add(turl); | 247 model_->Add(turl); |
248 | 248 |
249 // Table model should have updated. | 249 // Table model should have updated. |
250 VerifyChangeCount(1, 0, 0, 0); | 250 VerifyChangeCount(1, 0, 0, 0); |
251 | 251 |
252 // And should contain the newly added TemplateURL. | 252 // And should contain the newly added TemplateURL. |
253 ASSERT_EQ(1, table_model()->RowCount()); | 253 ASSERT_EQ(1, table_model()->RowCount()); |
254 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); | 254 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); |
255 } | 255 } |
OLD | NEW |