| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2958 POLICY_LEVEL_MANDATORY, | 2958 POLICY_LEVEL_MANDATORY, |
| 2959 POLICY_SCOPE_USER, | 2959 POLICY_SCOPE_USER, |
| 2960 POLICY_SOURCE_CLOUD, | 2960 POLICY_SOURCE_CLOUD, |
| 2961 new base::FundamentalValue(kOneHourInMs), | 2961 new base::FundamentalValue(kOneHourInMs), |
| 2962 NULL); | 2962 NULL); |
| 2963 UpdateProviderPolicy(policies); | 2963 UpdateProviderPolicy(policies); |
| 2964 base::RunLoop().RunUntilIdle(); | 2964 base::RunLoop().RunUntilIdle(); |
| 2965 Mock::VerifyAndClearExpectations(&observer); | 2965 Mock::VerifyAndClearExpectations(&observer); |
| 2966 } | 2966 } |
| 2967 | 2967 |
| 2968 // Disabled, see http://crbug.com/315308. | |
| 2969 IN_PROC_BROWSER_TEST_F(PolicyTest, | 2968 IN_PROC_BROWSER_TEST_F(PolicyTest, |
| 2970 DISABLED_PRE_WaitForInitialUserActivitySatisfied) { | 2969 PRE_WaitForInitialUserActivitySatisfied) { |
| 2971 // Indicate that initial user activity in this session occurred 2 hours ago. | 2970 // Indicate that initial user activity in this session occurred 2 hours ago. |
| 2972 g_browser_process->local_state()->SetInt64( | 2971 g_browser_process->local_state()->SetInt64( |
| 2973 prefs::kSessionStartTime, | 2972 prefs::kSessionStartTime, |
| 2974 (base::TimeTicks::Now() - base::TimeDelta::FromHours(2)) | 2973 (base::TimeTicks::Now() - base::TimeDelta::FromHours(2)) |
| 2975 .ToInternalValue()); | 2974 .ToInternalValue()); |
| 2976 g_browser_process->local_state()->SetBoolean( | 2975 g_browser_process->local_state()->SetBoolean( |
| 2977 prefs::kSessionUserActivitySeen, | 2976 prefs::kSessionUserActivitySeen, |
| 2978 true); | 2977 true); |
| 2979 } | 2978 } |
| 2980 | 2979 |
| 2981 // Disabled, see http://crbug.com/315308. | |
| 2982 IN_PROC_BROWSER_TEST_F(PolicyTest, | 2980 IN_PROC_BROWSER_TEST_F(PolicyTest, |
| 2983 DISABLED_WaitForInitialUserActivitySatisfied) { | 2981 WaitForInitialUserActivitySatisfied) { |
| 2984 content::MockNotificationObserver observer; | 2982 content::MockNotificationObserver observer; |
| 2985 content::NotificationRegistrar registrar; | 2983 content::NotificationRegistrar registrar; |
| 2986 registrar.Add(&observer, | 2984 registrar.Add(&observer, |
| 2987 chrome::NOTIFICATION_APP_TERMINATING, | 2985 chrome::NOTIFICATION_APP_TERMINATING, |
| 2988 content::NotificationService::AllSources()); | 2986 content::NotificationService::AllSources()); |
| 2989 | 2987 |
| 2990 // Require initial user activity and set the session length limit to 3 hours. | 2988 // Require initial user activity and set the session length limit to 3 hours. |
| 2991 // Verify that the session is not terminated. | 2989 // Verify that the session is not terminated. |
| 2992 EXPECT_CALL(observer, Observe(chrome::NOTIFICATION_APP_TERMINATING, _, _)) | 2990 EXPECT_CALL(observer, Observe(chrome::NOTIFICATION_APP_TERMINATING, _, _)) |
| 2993 .Times(0); | 2991 .Times(0); |
| (...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3994 POLICY_SCOPE_USER, | 3992 POLICY_SCOPE_USER, |
| 3995 POLICY_SOURCE_CLOUD, | 3993 POLICY_SOURCE_CLOUD, |
| 3996 new base::FundamentalValue(false), | 3994 new base::FundamentalValue(false), |
| 3997 NULL); | 3995 NULL); |
| 3998 UpdateProviderPolicy(policies); | 3996 UpdateProviderPolicy(policies); |
| 3999 EXPECT_FALSE(display_manager->unified_desktop_enabled()); | 3997 EXPECT_FALSE(display_manager->unified_desktop_enabled()); |
| 4000 } | 3998 } |
| 4001 #endif // defined(OS_CHROMEOS) | 3999 #endif // defined(OS_CHROMEOS) |
| 4002 | 4000 |
| 4003 } // namespace policy | 4001 } // namespace policy |
| OLD | NEW |