Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: chrome/browser/ui/search_engines/keyword_editor_controller_unittest.cc

Issue 10021008: Reland r131019: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ClearChangeCount(); 238 ClearChangeCount();
239 239
240 // This should not result in a crash. 240 // This should not result in a crash.
241 int new_default = controller_->MakeDefaultTemplateURL(0); 241 int new_default = controller_->MakeDefaultTemplateURL(0);
242 EXPECT_EQ(0, new_default); 242 EXPECT_EQ(0, new_default);
243 } 243 }
244 244
245 // Mutates the TemplateURLService and make sure table model is updating 245 // Mutates the TemplateURLService and make sure table model is updating
246 // appropriately. 246 // appropriately.
247 TEST_F(KeywordEditorControllerTest, MutateTemplateURLService) { 247 TEST_F(KeywordEditorControllerTest, MutateTemplateURLService) {
248 TemplateURL* turl = new TemplateURL(); 248 TemplateURLData data;
249 turl->set_keyword(ASCIIToUTF16("a")); 249 data.short_name = ASCIIToUTF16("b");
250 turl->set_short_name(ASCIIToUTF16("b")); 250 data.SetKeyword(ASCIIToUTF16("a"));
251 TemplateURL* turl = new TemplateURL(data);
251 model_->Add(turl); 252 model_->Add(turl);
252 253
253 // Table model should have updated. 254 // Table model should have updated.
254 VerifyChangeCount(1, 0, 0, 0); 255 VerifyChangeCount(1, 0, 0, 0);
255 256
256 // And should contain the newly added TemplateURL. 257 // And should contain the newly added TemplateURL.
257 ASSERT_EQ(1, table_model()->RowCount()); 258 ASSERT_EQ(1, table_model()->RowCount());
258 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); 259 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl));
259 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698