| 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.h" |
| 9 #include "chrome/browser/search_engines/template_url_service_test_util.h" | 10 #include "chrome/browser/search_engines/template_url_service_test_util.h" |
| 10 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 11 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
| 11 #include "chrome/browser/ui/search_engines/template_url_table_model.h" | 12 #include "chrome/browser/ui/search_engines/template_url_table_model.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 13 #include "components/search_engines/template_url.h" | 14 #include "components/search_engines/template_url.h" |
| 14 #include "components/search_engines/template_url_service.h" | |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/base/models/table_model_observer.h" | 16 #include "ui/base/models/table_model_observer.h" |
| 17 | 17 |
| 18 using base::ASCIIToUTF16; | 18 using base::ASCIIToUTF16; |
| 19 | 19 |
| 20 static const base::string16 kA(ASCIIToUTF16("a")); | 20 static const base::string16 kA(ASCIIToUTF16("a")); |
| 21 static const base::string16 kA1(ASCIIToUTF16("a1")); | 21 static const base::string16 kA1(ASCIIToUTF16("a1")); |
| 22 static const base::string16 kB(ASCIIToUTF16("b")); | 22 static const base::string16 kB(ASCIIToUTF16("b")); |
| 23 static const base::string16 kB1(ASCIIToUTF16("b1")); | 23 static const base::string16 kB1(ASCIIToUTF16("b1")); |
| 24 | 24 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 TemplateURL* turl = new TemplateURL(data); | 252 TemplateURL* turl = new TemplateURL(data); |
| 253 util()->model()->Add(turl); | 253 util()->model()->Add(turl); |
| 254 | 254 |
| 255 // Table model should have updated. | 255 // Table model should have updated. |
| 256 VerifyChangeCount(1, 0, 0, 0); | 256 VerifyChangeCount(1, 0, 0, 0); |
| 257 | 257 |
| 258 // And should contain the newly added TemplateURL. | 258 // And should contain the newly added TemplateURL. |
| 259 ASSERT_EQ(original_row_count + 1, table_model()->RowCount()); | 259 ASSERT_EQ(original_row_count + 1, table_model()->RowCount()); |
| 260 ASSERT_GE(table_model()->IndexOfTemplateURL(turl), 0); | 260 ASSERT_GE(table_model()->IndexOfTemplateURL(turl), 0); |
| 261 } | 261 } |
| OLD | NEW |