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

Side by Side Diff: chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc

Issue 338993007: Track when and how a profile is signed out via UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SignOut() param in Android tests Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <string> 5 #include <string>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 run_loop.Run(); 207 run_loop.Run();
208 Mock::VerifyAndClearExpectations(&observer); 208 Mock::VerifyAndClearExpectations(&observer);
209 policy_manager->core()->client()->RemoveObserver(&observer); 209 policy_manager->core()->client()->RemoveObserver(&observer);
210 } 210 }
211 211
212 #if !defined(OS_CHROMEOS) 212 #if !defined(OS_CHROMEOS)
213 void SignOut() { 213 void SignOut() {
214 SigninManager* signin_manager = 214 SigninManager* signin_manager =
215 SigninManagerFactory::GetForProfile(browser()->profile()); 215 SigninManagerFactory::GetForProfile(browser()->profile());
216 ASSERT_TRUE(signin_manager); 216 ASSERT_TRUE(signin_manager);
217 signin_manager->SignOut(); 217 signin_manager->SignOut(signin_metrics::SIGNOUT_TEST);
218 } 218 }
219 #endif 219 #endif
220 220
221 void RefreshPolicies() { 221 void RefreshPolicies() {
222 ProfilePolicyConnector* profile_connector = 222 ProfilePolicyConnector* profile_connector =
223 ProfilePolicyConnectorFactory::GetForProfile(browser()->profile()); 223 ProfilePolicyConnectorFactory::GetForProfile(browser()->profile());
224 PolicyService* policy_service = profile_connector->policy_service(); 224 PolicyService* policy_service = profile_connector->policy_service();
225 base::RunLoop run_loop; 225 base::RunLoop run_loop;
226 policy_service->RefreshPolicies(run_loop.QuitClosure()); 226 policy_service->RefreshPolicies(run_loop.QuitClosure());
227 run_loop.Run(); 227 run_loop.Run();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); 338 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true);
339 event_listener2.Reply("get-policy-Name"); 339 event_listener2.Reply("get-policy-Name");
340 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); 340 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied());
341 341
342 // And the cache is back. 342 // And the cache is back.
343 EXPECT_TRUE(base::PathExists(cache_path)); 343 EXPECT_TRUE(base::PathExists(cache_path));
344 } 344 }
345 #endif 345 #endif
346 346
347 } // namespace policy 347 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698