diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 19:58:28 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 19:58:28 +0000 |
commit | 28b3b2e41e97a7c6bf39d598febf8bc1677a7079 (patch) | |
tree | 69df239b18a093ddc4be6d4a8abacff402d814f4 /remoting/host/json_host_config_unittest.cc | |
parent | a10af6edd3747f0120d0a085772e485902ae6029 (diff) | |
download | chromium_src-28b3b2e41e97a7c6bf39d598febf8bc1677a7079.zip chromium_src-28b3b2e41e97a7c6bf39d598febf8bc1677a7079.tar.gz chromium_src-28b3b2e41e97a7c6bf39d598febf8bc1677a7079.tar.bz2 |
HostConfig interface updates.
- Simplified mutation semantic: Update() replaced with
Save(). Set methods can be called at any time.
- JsonHostConfig now inherits from InMemoryHostConfig to
avoid code duplication.
- Added kHostEnabledConfigPath.
BUG=None
TEST=Unittests.
Review URL: http://codereview.chromium.org/5738008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/json_host_config_unittest.cc')
-rw-r--r-- | remoting/host/json_host_config_unittest.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/remoting/host/json_host_config_unittest.cc b/remoting/host/json_host_config_unittest.cc index 14ee9bd..20ea501 100644 --- a/remoting/host/json_host_config_unittest.cc +++ b/remoting/host/json_host_config_unittest.cc @@ -22,15 +22,6 @@ const char* kTestConfig = " \"host_name\" : \"TEST_MACHINE_NAME\",\n" " \"private_key\" : \"TEST_PRIVATE_KEY\"\n" "}\n"; - -// Helper for Update test. -class TestConfigUpdater : public base::RefCountedThreadSafe<TestConfigUpdater> { - public: - void DoUpdate(scoped_refptr<JsonHostConfig> target, - std::string new_auth_token_value) { - target->SetString(kXmppAuthTokenConfigPath, new_auth_token_value); - } -}; } // namespace class JsonHostConfigTest : public testing::Test { @@ -92,10 +83,8 @@ TEST_F(JsonHostConfigTest, Write) { ASSERT_TRUE(target->Read()); std::string new_auth_token_value = "NEW_AUTH_TOKEN"; - scoped_refptr<TestConfigUpdater> config_updater(new TestConfigUpdater()); - target->Update( - NewRunnableMethod(config_updater.get(), &TestConfigUpdater::DoUpdate, - target, new_auth_token_value)); + target->SetString(kXmppAuthTokenConfigPath, new_auth_token_value); + target->Save(); message_loop_.RunAllPending(); |