Chromium Code Reviews| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1676 scoped_ptr<AssociatedExtensionInfo> extension_info( | 1676 scoped_ptr<AssociatedExtensionInfo> extension_info( |
| 1677 new AssociatedExtensionInfo); | 1677 new AssociatedExtensionInfo); |
| 1678 extension_info->wants_to_be_default_engine = true; | 1678 extension_info->wants_to_be_default_engine = true; |
| 1679 extension_info->extension_id = "ext1"; | 1679 extension_info->extension_id = "ext1"; |
| 1680 model()->AddExtensionControlledTURL(ext_dse, extension_info.Pass()); | 1680 model()->AddExtensionControlledTURL(ext_dse, extension_info.Pass()); |
| 1681 EXPECT_EQ(ext_dse, model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1"))); | 1681 EXPECT_EQ(ext_dse, model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1"))); |
| 1682 EXPECT_TRUE(model()->is_default_search_managed()); | 1682 EXPECT_TRUE(model()->is_default_search_managed()); |
| 1683 actual_managed_default = model()->GetDefaultSearchProvider(); | 1683 actual_managed_default = model()->GetDefaultSearchProvider(); |
| 1684 ExpectSimilar(expected_managed_default.get(), actual_managed_default); | 1684 ExpectSimilar(expected_managed_default.get(), actual_managed_default); |
| 1685 } | 1685 } |
| 1686 | |
| 1687 TEST_F(TemplateURLServiceTest, PrefSaving) { | |
| 1688 // Add a new TemplateURL. | |
| 1689 test_util_.VerifyLoad(); | |
| 1690 TemplateURL* t_url = AddKeywordWithDate( | |
| 1691 "name1", "key1", "http://foo1/{searchTerms}", "http://sugg1", | |
| 1692 std::string(), "http://icon1", true, "UTF-8;UTF-16", Time(), Time()); | |
| 1693 model()->SetUserSelectedDefaultSearchProvider(t_url); | |
| 1694 | |
| 1695 AssertEquals(*t_url, *model()->GetDefaultSearchProvider()); | |
| 1696 TemplateURL* read_url = NULL; | |
| 1697 model()->ReadDataFromPrefsDictionary(&read_url); | |
| 1698 AssertEquals(*read_url, *model()->GetDefaultSearchProvider()); | |
| 1699 } | |
|
erikwright (departed)
2014/04/22 15:47:24
Are there not some "is equivalent TemplateURL" met
Cait (Slow)
2014/04/22 19:54:13
ExpectSimilar is what we want here I think.
| |
| OLD | NEW |