OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string16.h" | 5 #include "base/string16.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/search_engines/template_url.h" | 8 #include "chrome/browser/search_engines/template_url.h" |
9 #include "chrome/browser/search_engines/template_url_model.h" | 9 #include "chrome/browser/search_engines/template_url_model.h" |
10 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 10 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
11 #include "chrome/browser/ui/search_engines/template_url_table_model.h" | 11 #include "chrome/browser/ui/search_engines/template_url_table_model.h" |
12 #include "chrome/common/notification_details.h" | |
13 #include "chrome/common/notification_source.h" | |
14 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/testing_pref_service.h" | 13 #include "chrome/test/testing_pref_service.h" |
16 #include "chrome/test/testing_profile.h" | 14 #include "chrome/test/testing_profile.h" |
| 15 #include "content/common/notification_details.h" |
| 16 #include "content/common/notification_source.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "ui/base/models/table_model_observer.h" | 18 #include "ui/base/models/table_model_observer.h" |
19 | 19 |
20 static const string16 kA(ASCIIToUTF16("a")); | 20 static const string16 kA(ASCIIToUTF16("a")); |
21 static const string16 kA1(ASCIIToUTF16("a1")); | 21 static const string16 kA1(ASCIIToUTF16("a1")); |
22 static const string16 kB(ASCIIToUTF16("b")); | 22 static const string16 kB(ASCIIToUTF16("b")); |
23 static const string16 kB1(ASCIIToUTF16("b1")); | 23 static const string16 kB1(ASCIIToUTF16("b1")); |
24 | 24 |
25 // Base class for keyword editor tests. Creates a profile containing an | 25 // Base class for keyword editor tests. Creates a profile containing an |
26 // empty TemplateURLModel. | 26 // empty TemplateURLModel. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 turl->set_short_name(ASCIIToUTF16("b")); | 249 turl->set_short_name(ASCIIToUTF16("b")); |
250 model_->Add(turl); | 250 model_->Add(turl); |
251 | 251 |
252 // Table model should have updated. | 252 // Table model should have updated. |
253 VerifyChangeCount(1, 0, 0, 0); | 253 VerifyChangeCount(1, 0, 0, 0); |
254 | 254 |
255 // And should contain the newly added TemplateURL. | 255 // And should contain the newly added TemplateURL. |
256 ASSERT_EQ(1, table_model()->RowCount()); | 256 ASSERT_EQ(1, table_model()->RowCount()); |
257 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); | 257 ASSERT_EQ(0, table_model()->IndexOfTemplateURL(turl)); |
258 } | 258 } |
OLD | NEW |