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

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

Issue 143463009: Add policy that forces SAML users to log in online periodically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Speculative fix for PolicyPrefIndicatorTest.CheckPolicyIndicators/3. Created 6 years, 10 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) 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 <cstdlib> 6 #include <cstdlib>
7 #include <map> 7 #include <map>
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 EXPECT_CALL(provider_, IsInitializationComplete(_)) 453 EXPECT_CALL(provider_, IsInitializationComplete(_))
454 .WillRepeatedly(Return(true)); 454 .WillRepeatedly(Return(true));
455 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); 455 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
456 } 456 }
457 457
458 virtual void SetUpOnMainThread() OVERRIDE { 458 virtual void SetUpOnMainThread() OVERRIDE {
459 ui_test_utils::WaitForTemplateURLServiceToLoad( 459 ui_test_utils::WaitForTemplateURLServiceToLoad(
460 TemplateURLServiceFactory::GetForProfile(browser()->profile())); 460 TemplateURLServiceFactory::GetForProfile(browser()->profile()));
461 } 461 }
462 462
463 virtual void TearDownOnMainThread() OVERRIDE {
464 ClearProviderPolicy();
465 }
466
463 void ClearProviderPolicy() { 467 void ClearProviderPolicy() {
464 provider_.UpdateChromePolicy(PolicyMap()); 468 provider_.UpdateChromePolicy(PolicyMap());
465 base::RunLoop().RunUntilIdle(); 469 base::RunLoop().RunUntilIdle();
466 } 470 }
467 471
468 void SetProviderPolicy(const base::DictionaryValue& policies, 472 void SetProviderPolicy(const base::DictionaryValue& policies,
469 PolicyLevel level) { 473 PolicyLevel level) {
470 PolicyMap policy_map; 474 PolicyMap policy_map;
471 for (base::DictionaryValue::Iterator it(policies); 475 for (base::DictionaryValue::Iterator it(policies);
472 !it.IsAtEnd(); it.Advance()) { 476 !it.IsAtEnd(); it.Advance()) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 668 }
665 } 669 }
666 } 670 }
667 } 671 }
668 672
669 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, 673 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
670 PolicyPrefIndicatorTest, 674 PolicyPrefIndicatorTest,
671 testing::ValuesIn(SplitPoliciesIntoChunks(50))); 675 testing::ValuesIn(SplitPoliciesIntoChunks(50)));
672 676
673 } // namespace policy 677 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list_factory.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698