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

Unified Diff: components/policy/core/common/policy_loader_win_unittest.cc

Issue 947353002: Chromoting needs null GPO provider in PolicyLoaderWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/policy/core/common/policy_loader_win.cc ('k') | remoting/host/policy_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_loader_win_unittest.cc
diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc
index 708ef6685a4ce470ec9b5e7be2654c853e01ec23..90591282304a0482ff19b59da847aaeea427d613 100644
--- a/components/policy/core/common/policy_loader_win_unittest.cc
+++ b/components/policy/core/common/policy_loader_win_unittest.cc
@@ -712,6 +712,8 @@ class PolicyLoaderWinTest : public PolicyTestBase,
.AppendASCII("data")
.AppendASCII("policy")
.AppendASCII("gpo");
+
+ gpo_list_provider_ = this;
}
// AppliedGPOListProvider:
@@ -740,7 +742,8 @@ class PolicyLoaderWinTest : public PolicyTestBase,
}
bool Matches(const PolicyBundle& expected) {
- PolicyLoaderWin loader(loop_.message_loop_proxy(), kTestPolicyKey, this);
+ PolicyLoaderWin loader(loop_.message_loop_proxy(), kTestPolicyKey,
+ gpo_list_provider_);
scoped_ptr<PolicyBundle> loaded(
loader.InitialLoad(schema_registry_.schema_map()));
return loaded->Equals(expected);
@@ -783,6 +786,7 @@ class PolicyLoaderWinTest : public PolicyTestBase,
PGROUP_POLICY_OBJECT gpo_list_;
DWORD gpo_list_status_;
base::FilePath test_data_dir_;
+ AppliedGPOListProvider* gpo_list_provider_;
};
const base::char16 PolicyLoaderWinTest::kTestPolicyKey[] =
@@ -1047,7 +1051,19 @@ TEST_F(PolicyLoaderWinTest, AppliedPolicyInDomain) {
gpo_list_ = &gpo;
gpo_list_status_ = ERROR_SUCCESS;
- PolicyBundle empty;
+ EXPECT_TRUE(MatchesRegistrySentinel());
+}
+
+TEST_F(PolicyLoaderWinTest, GpoProviderNotSpecified) {
+ base::win::SetDomainStateForTesting(false);
+ InstallRegistrySentinel();
+ base::FilePath gpo_dir(test_data_dir_.AppendASCII("empty"));
+ GROUP_POLICY_OBJECT gpo;
+ InitGPO(&gpo, 0, gpo_dir, NULL, NULL);
+ gpo_list_ = &gpo;
+ gpo_list_status_ = ERROR_SUCCESS;
+ gpo_list_provider_ = nullptr;
+
EXPECT_TRUE(MatchesRegistrySentinel());
}
« no previous file with comments | « components/policy/core/common/policy_loader_win.cc ('k') | remoting/host/policy_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698