| 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 "chrome/browser/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 ExtensionServiceTestBase::SetUp(); | 297 ExtensionServiceTestBase::SetUp(); |
| 298 | 298 |
| 299 // By not specifying a pref_file filepath, we get a | 299 // By not specifying a pref_file filepath, we get a |
| 300 // sync_preferences::TestingPrefServiceSyncable | 300 // sync_preferences::TestingPrefServiceSyncable |
| 301 // - see BuildTestingProfile in extension_service_test_base.cc. | 301 // - see BuildTestingProfile in extension_service_test_base.cc. |
| 302 ExtensionServiceInitParams init_params = CreateDefaultInitParams(); | 302 ExtensionServiceInitParams init_params = CreateDefaultInitParams(); |
| 303 init_params.pref_file.clear(); | 303 init_params.pref_file.clear(); |
| 304 InitializeExtensionService(init_params); | 304 InitializeExtensionService(init_params); |
| 305 | 305 |
| 306 browser_window_.reset(new TestBrowserWindow()); | 306 browser_window_.reset(new TestBrowserWindow()); |
| 307 Browser::CreateParams params(profile()); | 307 Browser::CreateParams params(profile(), true); |
| 308 params.type = Browser::TYPE_TABBED; | 308 params.type = Browser::TYPE_TABBED; |
| 309 params.window = browser_window_.get(); | 309 params.window = browser_window_.get(); |
| 310 browser_.reset(new Browser(params)); | 310 browser_.reset(new Browser(params)); |
| 311 | 311 |
| 312 // Allow the API to be created. | 312 // Allow the API to be created. |
| 313 EventRouterFactory::GetInstance()->SetTestingFactory(profile(), | 313 EventRouterFactory::GetInstance()->SetTestingFactory(profile(), |
| 314 &BuildEventRouter); | 314 &BuildEventRouter); |
| 315 | 315 |
| 316 DeveloperPrivateAPI::GetFactoryInstance()->SetTestingFactory( | 316 DeveloperPrivateAPI::GetFactoryInstance()->SetTestingFactory( |
| 317 profile(), &BuildAPI); | 317 profile(), &BuildAPI); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 EXPECT_TRUE( | 661 EXPECT_TRUE( |
| 662 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); | 662 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); |
| 663 | 663 |
| 664 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; | 664 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; |
| 665 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); | 665 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); |
| 666 EXPECT_TRUE(profile_info->in_developer_mode); | 666 EXPECT_TRUE(profile_info->in_developer_mode); |
| 667 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); | 667 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); |
| 668 } | 668 } |
| 669 | 669 |
| 670 } // namespace extensions | 670 } // namespace extensions |
| OLD | NEW |