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/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/strings/string16.h" | 6 #include "base/strings/string16.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/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_service_factory_test_util.h
" | 9 #include "chrome/browser/search_engines/template_url_service_factory_test_util.h
" |
10 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 10 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 KeywordEditorController* controller() { return controller_.get(); } | 97 KeywordEditorController* controller() { return controller_.get(); } |
98 const TemplateURLServiceFactoryTestUtil* util() const { return &util_; } | 98 const TemplateURLServiceFactoryTestUtil* util() const { return &util_; } |
99 | 99 |
100 int items_changed_count() const { return items_changed_count_; } | 100 int items_changed_count() const { return items_changed_count_; } |
101 int added_count() const { return added_count_; } | 101 int added_count() const { return added_count_; } |
102 int removed_count() const { return removed_count_; } | 102 int removed_count() const { return removed_count_; } |
103 | 103 |
104 private: | 104 private: |
105 content::TestBrowserThreadBundle thread_bundle_; | 105 content::TestBrowserThreadBundle thread_bundle_; |
106 TestingProfile profile_; | 106 TestingProfile profile_; |
107 scoped_ptr<KeywordEditorController> controller_; | 107 std::unique_ptr<KeywordEditorController> controller_; |
108 TemplateURLServiceFactoryTestUtil util_; | 108 TemplateURLServiceFactoryTestUtil util_; |
109 bool simulate_load_failure_; | 109 bool simulate_load_failure_; |
110 | 110 |
111 int model_changed_count_; | 111 int model_changed_count_; |
112 int items_changed_count_; | 112 int items_changed_count_; |
113 int added_count_; | 113 int added_count_; |
114 int removed_count_; | 114 int removed_count_; |
115 }; | 115 }; |
116 | 116 |
117 class KeywordEditorControllerNoWebDataTest | 117 class KeywordEditorControllerNoWebDataTest |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 TemplateURL* turl = new TemplateURL(data); | 247 TemplateURL* turl = new TemplateURL(data); |
248 util()->model()->Add(turl); | 248 util()->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(original_row_count + 1, table_model()->RowCount()); | 254 ASSERT_EQ(original_row_count + 1, table_model()->RowCount()); |
255 ASSERT_GE(table_model()->IndexOfTemplateURL(turl), 0); | 255 ASSERT_GE(table_model()->IndexOfTemplateURL(turl), 0); |
256 } | 256 } |
OLD | NEW |