OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "chrome/browser/extensions/extension_function_test_utils.h" | 7 #include "chrome/browser/extensions/extension_function_test_utils.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_service_test_base.h" | 9 #include "chrome/browser/extensions/extension_service_test_base.h" |
10 #include "chrome/browser/extensions/test_extension_system.h" | 10 #include "chrome/browser/extensions/test_extension_system.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void ManagementApiUnitTest::SetUp() { | 81 void ManagementApiUnitTest::SetUp() { |
82 ExtensionServiceTestBase::SetUp(); | 82 ExtensionServiceTestBase::SetUp(); |
83 InitializeEmptyExtensionService(); | 83 InitializeEmptyExtensionService(); |
84 ManagementAPI::GetFactoryInstance()->SetTestingFactory(profile(), | 84 ManagementAPI::GetFactoryInstance()->SetTestingFactory(profile(), |
85 &BuildManagementApi); | 85 &BuildManagementApi); |
86 | 86 |
87 EventRouterFactory::GetInstance()->SetTestingFactory(profile(), | 87 EventRouterFactory::GetInstance()->SetTestingFactory(profile(), |
88 &BuildEventRouter); | 88 &BuildEventRouter); |
89 | 89 |
90 browser_window_.reset(new TestBrowserWindow()); | 90 browser_window_.reset(new TestBrowserWindow()); |
91 Browser::CreateParams params(profile(), chrome::HOST_DESKTOP_TYPE_NATIVE); | 91 Browser::CreateParams params(profile()); |
92 params.type = Browser::TYPE_TABBED; | 92 params.type = Browser::TYPE_TABBED; |
93 params.window = browser_window_.get(); | 93 params.window = browser_window_.get(); |
94 browser_.reset(new Browser(params)); | 94 browser_.reset(new Browser(params)); |
95 } | 95 } |
96 | 96 |
97 void ManagementApiUnitTest::TearDown() { | 97 void ManagementApiUnitTest::TearDown() { |
98 browser_.reset(); | 98 browser_.reset(); |
99 browser_window_.reset(); | 99 browser_window_.reset(); |
100 ExtensionServiceTestBase::TearDown(); | 100 ExtensionServiceTestBase::TearDown(); |
101 } | 101 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 function = new ManagementUninstallSelfFunction(); | 219 function = new ManagementUninstallSelfFunction(); |
220 function->set_extension(extension); | 220 function->set_extension(extension); |
221 EXPECT_TRUE(registry()->enabled_extensions().Contains(extension_id)); | 221 EXPECT_TRUE(registry()->enabled_extensions().Contains(extension_id)); |
222 EXPECT_TRUE(RunFunction(function, uninstall_args)) << function->GetError(); | 222 EXPECT_TRUE(RunFunction(function, uninstall_args)) << function->GetError(); |
223 EXPECT_FALSE(registry()->GetExtensionById(extension_id, | 223 EXPECT_FALSE(registry()->GetExtensionById(extension_id, |
224 ExtensionRegistry::EVERYTHING)); | 224 ExtensionRegistry::EVERYTHING)); |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 } // namespace extensions | 228 } // namespace extensions |
OLD | NEW |