Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 1410163002: Re-enable WaitForInitialUserActivitySatisfied. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698