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

Side by Side Diff: components/policy/core/common/policy_loader_win_unittest.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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
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 "components/policy/core/common/policy_loader_win.h" 5 #include "components/policy/core/common/policy_loader_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <userenv.h> 8 #include <userenv.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 GROUP_POLICY_OBJECT* next, 731 GROUP_POLICY_OBJECT* next,
732 GROUP_POLICY_OBJECT* prev) { 732 GROUP_POLICY_OBJECT* prev) {
733 memset(gpo, 0, sizeof(GROUP_POLICY_OBJECT)); 733 memset(gpo, 0, sizeof(GROUP_POLICY_OBJECT));
734 gpo->dwOptions = options; 734 gpo->dwOptions = options;
735 gpo->lpFileSysPath = const_cast<wchar_t*>(path.value().c_str()); 735 gpo->lpFileSysPath = const_cast<wchar_t*>(path.value().c_str());
736 gpo->pNext = next; 736 gpo->pNext = next;
737 gpo->pPrev = prev; 737 gpo->pPrev = prev;
738 } 738 }
739 739
740 bool Matches(const PolicyBundle& expected) { 740 bool Matches(const PolicyBundle& expected) {
741 PolicyLoaderWin loader(loop_.message_loop_proxy(), kTestPolicyKey, 741 PolicyLoaderWin loader(loop_.task_runner(), kTestPolicyKey,
742 gpo_list_provider_); 742 gpo_list_provider_);
743 scoped_ptr<PolicyBundle> loaded( 743 scoped_ptr<PolicyBundle> loaded(
744 loader.InitialLoad(schema_registry_.schema_map())); 744 loader.InitialLoad(schema_registry_.schema_map()));
745 return loaded->Equals(expected); 745 return loaded->Equals(expected);
746 } 746 }
747 747
748 void InstallRegistrySentinel() { 748 void InstallRegistrySentinel() {
749 RegKey hklm_key(HKEY_CURRENT_USER, kTestPolicyKey, KEY_ALL_ACCESS); 749 RegKey hklm_key(HKEY_CURRENT_USER, kTestPolicyKey, KEY_ALL_ACCESS);
750 ASSERT_TRUE(hklm_key.Valid()); 750 ASSERT_TRUE(hklm_key.Valid());
751 hklm_key.WriteValue( 751 hklm_key.WriteValue(
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 PolicyMap& expected_policy = expected.Get(ns); 1219 PolicyMap& expected_policy = expected.Get(ns);
1220 expected_policy.Set("alternative_browser_path", 1220 expected_policy.Set("alternative_browser_path",
1221 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, 1221 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
1222 new base::StringValue("c:\\legacy\\browser.exe"), NULL); 1222 new base::StringValue("c:\\legacy\\browser.exe"), NULL);
1223 expected_policy.Set("url_list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, 1223 expected_policy.Set("url_list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
1224 list.DeepCopy(), NULL); 1224 list.DeepCopy(), NULL);
1225 EXPECT_TRUE(Matches(expected)); 1225 EXPECT_TRUE(Matches(expected));
1226 } 1226 }
1227 1227
1228 } // namespace policy 1228 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_loader_mac_unittest.cc ('k') | components/policy/core/common/policy_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698