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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); | 630 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); |
631 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); | 631 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); |
632 // No more errors! | 632 // No more errors! |
633 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); | 633 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); |
634 } | 634 } |
635 | 635 |
636 // Test developerPrivate.updateProfileConfiguration: Try to turn on devMode | 636 // Test developerPrivate.updateProfileConfiguration: Try to turn on devMode |
637 // when DeveloperToolsDisabled policy is active. | 637 // when DeveloperToolsDisabled policy is active. |
638 TEST_F(DeveloperPrivateApiUnitTest, DeveloperPrivateDevModeDisabledPolicy) { | 638 TEST_F(DeveloperPrivateApiUnitTest, DeveloperPrivateDevModeDisabledPolicy) { |
639 testing_pref_service()->SetManagedPref(prefs::kExtensionsUIDeveloperMode, | 639 testing_pref_service()->SetManagedPref(prefs::kExtensionsUIDeveloperMode, |
640 new base::FundamentalValue(false)); | 640 new base::Value(false)); |
641 | 641 |
642 UpdateProfileConfigurationDevMode(true); | 642 UpdateProfileConfigurationDevMode(true); |
643 | 643 |
644 EXPECT_FALSE( | 644 EXPECT_FALSE( |
645 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); | 645 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); |
646 | 646 |
647 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; | 647 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; |
648 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); | 648 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); |
649 EXPECT_FALSE(profile_info->in_developer_mode); | 649 EXPECT_FALSE(profile_info->in_developer_mode); |
650 EXPECT_TRUE(profile_info->is_developer_mode_controlled_by_policy); | 650 EXPECT_TRUE(profile_info->is_developer_mode_controlled_by_policy); |
(...skipping 10 matching lines...) Expand all 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 |