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

Unified Diff: remoting/host/policy_watcher_unittest.cc

Issue 2710023003: Refactor PolicyWatcher to allow mocking (Closed)
Patch Set: Created 3 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
« remoting/host/policy_watcher.h ('K') | « remoting/host/policy_watcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/policy_watcher_unittest.cc
diff --git a/remoting/host/policy_watcher_unittest.cc b/remoting/host/policy_watcher_unittest.cc
index 7df7c7d772b94dbc1f2c5a54abdd9eef91db4439..77a2cd497fd8dcbb7d968163717e8434de3b5f22 100644
--- a/remoting/host/policy_watcher_unittest.cc
+++ b/remoting/host/policy_watcher_unittest.cc
@@ -190,8 +190,8 @@ class PolicyWatcherTest : public testing::Test {
return policy_watcher_->GetPolicySchema();
}
- const base::DictionaryValue& GetDefaultValues() {
- return *(policy_watcher_->default_values_);
+ const base::DictionaryValue* GetDefaultValues() {
+ return policy_watcher_->GetDefaultValues();
}
MOCK_METHOD0(PostPolicyWatcherShutdown, void());
@@ -264,7 +264,7 @@ class PolicyWatcherTest : public testing::Test {
dict.SetBoolean(key::kRemoteAccessHostAllowUiAccessForRemoteAssistance,
false);
- ASSERT_THAT(&dict, IsPolicies(&GetDefaultValues()))
+ ASSERT_THAT(&dict, IsPolicies(GetDefaultValues()))
<< "Sanity check that defaults expected by the test code "
<< "match what is stored in PolicyWatcher::default_values_";
}
@@ -636,7 +636,7 @@ TEST_F(PolicyWatcherTest, PolicySchemaAndPolicyWatcherShouldBeInSync) {
// are kept in-sync.
std::map<std::string, base::Value::Type> expected_schema;
- for (base::DictionaryValue::Iterator i(GetDefaultValues()); !i.IsAtEnd();
+ for (base::DictionaryValue::Iterator i(*GetDefaultValues()); !i.IsAtEnd();
i.Advance()) {
expected_schema[i.key()] = i.value().GetType();
}
« remoting/host/policy_watcher.h ('K') | « remoting/host/policy_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698