| 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 "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class ScopedExtensionLoadObserver : public ExtensionRegistryObserver { | 26 class ScopedExtensionLoadObserver : public ExtensionRegistryObserver { |
| 27 public: | 27 public: |
| 28 ScopedExtensionLoadObserver(ExtensionRegistry* registry, | 28 ScopedExtensionLoadObserver(ExtensionRegistry* registry, |
| 29 const base::Closure& quit_closure); | 29 const base::Closure& quit_closure); |
| 30 virtual ~ScopedExtensionLoadObserver(); | 30 virtual ~ScopedExtensionLoadObserver(); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, | 33 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, |
| 34 const Extension* extension, | 34 const Extension* extension, |
| 35 bool is_update) OVERRIDE; | 35 bool is_update) override; |
| 36 | 36 |
| 37 ExtensionRegistry* registry_; | 37 ExtensionRegistry* registry_; |
| 38 base::Closure quit_closure_; | 38 base::Closure quit_closure_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(ScopedExtensionLoadObserver); | 40 DISALLOW_COPY_AND_ASSIGN(ScopedExtensionLoadObserver); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 ScopedExtensionLoadObserver::ScopedExtensionLoadObserver( | 43 ScopedExtensionLoadObserver::ScopedExtensionLoadObserver( |
| 44 ExtensionRegistry* registry, | 44 ExtensionRegistry* registry, |
| 45 const base::Closure& quit_closure) | 45 const base::Closure& quit_closure) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 58 bool is_update) { | 58 bool is_update) { |
| 59 quit_closure_.Run(); | 59 quit_closure_.Run(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 class KeywordExtensionsDelegateImplTest : public ExtensionServiceTestBase { | 62 class KeywordExtensionsDelegateImplTest : public ExtensionServiceTestBase { |
| 63 public: | 63 public: |
| 64 KeywordExtensionsDelegateImplTest() {} | 64 KeywordExtensionsDelegateImplTest() {} |
| 65 virtual ~KeywordExtensionsDelegateImplTest() {} | 65 virtual ~KeywordExtensionsDelegateImplTest() {} |
| 66 | 66 |
| 67 protected: | 67 protected: |
| 68 virtual void SetUp() OVERRIDE; | 68 virtual void SetUp() override; |
| 69 | 69 |
| 70 void RunTest(bool incognito); | 70 void RunTest(bool incognito); |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegateImplTest); | 73 DISALLOW_COPY_AND_ASSIGN(KeywordExtensionsDelegateImplTest); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 void KeywordExtensionsDelegateImplTest::SetUp() { | 76 void KeywordExtensionsDelegateImplTest::SetUp() { |
| 77 ExtensionServiceTestBase::SetUp(); | 77 ExtensionServiceTestBase::SetUp(); |
| 78 InitializeExtensionService(CreateDefaultInitParams()); | 78 InitializeExtensionService(CreateDefaultInitParams()); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 RunTest(false); | 134 RunTest(false); |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { | 137 TEST_F(KeywordExtensionsDelegateImplTest, IsEnabledExtensionIncognito) { |
| 138 RunTest(true); | 138 RunTest(true); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace | 141 } // namespace |
| 142 | 142 |
| 143 } // namespace extensions | 143 } // namespace extensions |
| OLD | NEW |