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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); | 850 function = new api::DeveloperPrivateDeleteExtensionErrorsFunction(); |
851 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); | 851 EXPECT_TRUE(RunFunction(function, *args)) << function->GetError(); |
852 // No more errors! | 852 // No more errors! |
853 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); | 853 EXPECT_TRUE(error_console->GetErrorsForExtension(extension->id()).empty()); |
854 } | 854 } |
855 | 855 |
856 // Test developerPrivate.updateProfileConfiguration: Try to turn on devMode | 856 // Test developerPrivate.updateProfileConfiguration: Try to turn on devMode |
857 // when DeveloperToolsDisabled policy is active. | 857 // when DeveloperToolsDisabled policy is active. |
858 TEST_F(DeveloperPrivateApiUnitTest, DeveloperPrivateDevModeDisabledPolicy) { | 858 TEST_F(DeveloperPrivateApiUnitTest, DeveloperPrivateDevModeDisabledPolicy) { |
859 testing_pref_service()->SetManagedPref(prefs::kExtensionsUIDeveloperMode, | 859 testing_pref_service()->SetManagedPref(prefs::kExtensionsUIDeveloperMode, |
860 new base::Value(false)); | 860 base::MakeUnique<base::Value>(false)); |
861 | 861 |
862 UpdateProfileConfigurationDevMode(true); | 862 UpdateProfileConfigurationDevMode(true); |
863 | 863 |
864 EXPECT_FALSE( | 864 EXPECT_FALSE( |
865 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); | 865 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); |
866 | 866 |
867 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; | 867 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; |
868 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); | 868 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); |
869 EXPECT_FALSE(profile_info->in_developer_mode); | 869 EXPECT_FALSE(profile_info->in_developer_mode); |
870 EXPECT_TRUE(profile_info->is_developer_mode_controlled_by_policy); | 870 EXPECT_TRUE(profile_info->is_developer_mode_controlled_by_policy); |
(...skipping 10 matching lines...) Expand all Loading... |
881 EXPECT_TRUE( | 881 EXPECT_TRUE( |
882 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); | 882 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); |
883 | 883 |
884 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; | 884 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; |
885 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); | 885 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); |
886 EXPECT_TRUE(profile_info->in_developer_mode); | 886 EXPECT_TRUE(profile_info->in_developer_mode); |
887 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); | 887 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); |
888 } | 888 } |
889 | 889 |
890 } // namespace extensions | 890 } // namespace extensions |
OLD | NEW |