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" |
11 #include "chrome/browser/search_engines/template_url_service_factory.h" | 11 #include "chrome/browser/search_engines/template_url_service_factory.h" |
12 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 12 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
13 #include "chrome/browser/ui/search_engines/template_url_table_model.h" | 13 #include "chrome/browser/ui/search_engines/template_url_table_model.h" |
14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/test/base/testing_pref_service.h" | 16 #include "chrome/test/base/testing_pref_service_syncable.h" |
17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "ui/base/models/table_model_observer.h" | 20 #include "ui/base/models/table_model_observer.h" |
21 | 21 |
22 static const string16 kA(ASCIIToUTF16("a")); | 22 static const string16 kA(ASCIIToUTF16("a")); |
23 static const string16 kA1(ASCIIToUTF16("a1")); | 23 static const string16 kA1(ASCIIToUTF16("a1")); |
24 static const string16 kB(ASCIIToUTF16("b")); | 24 static const string16 kB(ASCIIToUTF16("b")); |
25 static const string16 kB1(ASCIIToUTF16("b1")); | 25 static const string16 kB1(ASCIIToUTF16("b1")); |
26 | 26 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 TemplateURL* turl = new TemplateURL(profile_.get(), data); | 247 TemplateURL* turl = new TemplateURL(profile_.get(), data); |
248 model_->Add(turl); | 248 model_->Add(turl); |
249 | 249 |
250 // Table model should have updated. | 250 // Table model should have updated. |
251 VerifyChangeCount(1, 0, 0, 0); | 251 VerifyChangeCount(1, 0, 0, 0); |
252 | 252 |
253 // And should contain the newly added TemplateURL. | 253 // And should contain the newly added TemplateURL. |
254 ASSERT_EQ(1, table_model()->RowCount()); | 254 ASSERT_EQ(1, table_model()->RowCount()); |
255 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); | 255 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); |
256 } | 256 } |
OLD | NEW |