| 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" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
| 15 #include "base/test/mock_time_provider.h" | 15 #include "base/test/mock_time_provider.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/history/history_service.h" | 18 #include "chrome/browser/history/history_service.h" |
| 19 #include "chrome/browser/history/history_service_factory.h" | 19 #include "chrome/browser/history/history_service_factory.h" |
| 20 #include "chrome/browser/search_engines/search_host_to_urls_map.h" |
| 21 #include "chrome/browser/search_engines/template_url_service.h" |
| 20 #include "chrome/browser/search_engines/template_url_service_test_util.h" | 22 #include "chrome/browser/search_engines/template_url_service_test_util.h" |
| 23 #include "chrome/browser/webdata/keyword_web_data_service.h" |
| 21 #include "chrome/browser/webdata/web_data_service_factory.h" | 24 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 22 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 23 #include "components/search_engines/keyword_web_data_service.h" | |
| 24 #include "components/search_engines/search_host_to_urls_map.h" | |
| 25 #include "components/search_engines/search_terms_data.h" | 26 #include "components/search_engines/search_terms_data.h" |
| 26 #include "components/search_engines/template_url.h" | 27 #include "components/search_engines/template_url.h" |
| 27 #include "components/search_engines/template_url_prepopulate_data.h" | 28 #include "components/search_engines/template_url_prepopulate_data.h" |
| 28 #include "components/search_engines/template_url_service.h" | |
| 29 #include "components/webdata/common/web_database.h" | 29 #include "components/webdata/common/web_database.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 | 31 |
| 32 using base::ASCIIToUTF16; | 32 using base::ASCIIToUTF16; |
| 33 using base::Time; | 33 using base::Time; |
| 34 using base::TimeDelta; | 34 using base::TimeDelta; |
| 35 using ::testing::Return; | 35 using ::testing::Return; |
| 36 using ::testing::StrictMock; | 36 using ::testing::StrictMock; |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 scoped_ptr<TemplateURL::AssociatedExtensionInfo> extension_info( | 1492 scoped_ptr<TemplateURL::AssociatedExtensionInfo> extension_info( |
| 1493 new TemplateURL::AssociatedExtensionInfo( | 1493 new TemplateURL::AssociatedExtensionInfo( |
| 1494 TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, "ext1")); | 1494 TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, "ext1")); |
| 1495 extension_info->wants_to_be_default_engine = true; | 1495 extension_info->wants_to_be_default_engine = true; |
| 1496 model()->AddExtensionControlledTURL(ext_dse, extension_info.Pass()); | 1496 model()->AddExtensionControlledTURL(ext_dse, extension_info.Pass()); |
| 1497 EXPECT_EQ(ext_dse, model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1"))); | 1497 EXPECT_EQ(ext_dse, model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1"))); |
| 1498 EXPECT_TRUE(model()->is_default_search_managed()); | 1498 EXPECT_TRUE(model()->is_default_search_managed()); |
| 1499 actual_managed_default = model()->GetDefaultSearchProvider(); | 1499 actual_managed_default = model()->GetDefaultSearchProvider(); |
| 1500 ExpectSimilar(expected_managed_default.get(), actual_managed_default); | 1500 ExpectSimilar(expected_managed_default.get(), actual_managed_default); |
| 1501 } | 1501 } |
| OLD | NEW |