| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" | 5 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/macros.h" | 9 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/extension_service_test_base.h" | 13 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 12 #include "chrome/browser/extensions/extension_util.h" | 14 #include "chrome/browser/extensions/extension_util.h" |
| 13 #include "chrome/browser/extensions/test_extension_system.h" | 15 #include "chrome/browser/extensions/test_extension_system.h" |
| 14 #include "chrome/browser/extensions/unpacked_installer.h" | 16 #include "chrome/browser/extensions/unpacked_installer.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 void KeywordExtensionsDelegateImplTest::SetUp() { | 80 void KeywordExtensionsDelegateImplTest::SetUp() { |
| 79 ExtensionServiceTestBase::SetUp(); | 81 ExtensionServiceTestBase::SetUp(); |
| 80 InitializeExtensionService(CreateDefaultInitParams()); | 82 InitializeExtensionService(CreateDefaultInitParams()); |
| 81 } | 83 } |
| 82 | 84 |
| 83 void KeywordExtensionsDelegateImplTest::RunTest(bool incognito) { | 85 void KeywordExtensionsDelegateImplTest::RunTest(bool incognito) { |
| 84 scoped_ptr<TemplateURLService> empty_model(new TemplateURLService(NULL, 0)); | 86 scoped_ptr<TemplateURLService> empty_model(new TemplateURLService(NULL, 0)); |
| 85 MockAutocompleteProviderClient client; | 87 MockAutocompleteProviderClient client; |
| 86 client.set_template_url_service(empty_model.Pass()); | 88 client.set_template_url_service(std::move(empty_model)); |
| 87 scoped_refptr<KeywordProvider> keyword_provider = | 89 scoped_refptr<KeywordProvider> keyword_provider = |
| 88 new KeywordProvider(&client, nullptr); | 90 new KeywordProvider(&client, nullptr); |
| 89 | 91 |
| 90 // Load an extension. | 92 // Load an extension. |
| 91 { | 93 { |
| 92 base::FilePath path; | 94 base::FilePath path; |
| 93 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path)); | 95 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path)); |
| 94 path = path.AppendASCII("extensions").AppendASCII("good_unpacked"); | 96 path = path.AppendASCII("extensions").AppendASCII("good_unpacked"); |
| 95 | 97 |
| 96 base::RunLoop run_loop; | 98 base::RunLoop run_loop; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 RunTest(false); | 139 RunTest(false); |
| 138 } | 140 } |
| 139 | 141 |
| 140 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { | 142 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { |
| 141 RunTest(true); | 143 RunTest(true); |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace | 146 } // namespace |
| 145 | 147 |
| 146 } // namespace extensions | 148 } // namespace extensions |
| OLD | NEW |