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

Side by Side Diff: remoting/host/json_host_config_unittest.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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
« no previous file with comments | « remoting/host/host_key_pair_unittest.cc ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "remoting/host/json_host_config.h" 11 #include "remoting/host/json_host_config.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 15
16 namespace { 16 namespace {
17 const char* kTestConfig = 17 const char* kTestConfig =
18 "{\n" 18 "{\n"
19 " \"xmpp_login\" : \"test@gmail.com\",\n" 19 " \"xmpp_login\" : \"test@gmail.com\",\n"
20 " \"xmpp_auth_token\" : \"TEST_AUTH_TOKEN\",\n" 20 " \"xmpp_auth_token\" : \"TEST_AUTH_TOKEN\",\n"
21 " \"host_id\" : \"TEST_HOST_ID\",\n" 21 " \"host_id\" : \"TEST_HOST_ID\",\n"
22 " \"host_name\" : \"TEST_MACHINE_NAME\",\n" 22 " \"host_name\" : \"TEST_MACHINE_NAME\",\n"
23 " \"private_key\" : \"TEST_PRIVATE_KEY\"\n" 23 " \"private_key\" : \"TEST_PRIVATE_KEY\"\n"
24 "}\n"; 24 "}\n";
25 } // namespace 25 } // namespace
26 26
27 class JsonHostConfigTest : public testing::Test { 27 class JsonHostConfigTest : public testing::Test {
28 protected: 28 protected:
29 virtual void SetUp() { 29 virtual void SetUp() {
30 message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); 30 message_loop_proxy_ = base::MessageLoopProxy::current();
31 } 31 }
32 32
33 static void WriteTestFile(const FilePath& filename) { 33 static void WriteTestFile(const FilePath& filename) {
34 file_util::WriteFile(filename, kTestConfig, std::strlen(kTestConfig)); 34 file_util::WriteFile(filename, kTestConfig, std::strlen(kTestConfig));
35 } 35 }
36 36
37 // The temporary directory used to contain the test operations. 37 // The temporary directory used to contain the test operations.
38 ScopedTempDir test_dir_; 38 ScopedTempDir test_dir_;
39 // A message loop that we can use as the file thread message loop. 39 // A message loop that we can use as the file thread message loop.
40 MessageLoop message_loop_; 40 MessageLoop message_loop_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 EXPECT_EQ(new_auth_token_value, value); 101 EXPECT_EQ(new_auth_token_value, value);
102 EXPECT_TRUE(reader->GetString(kHostIdConfigPath, &value)); 102 EXPECT_TRUE(reader->GetString(kHostIdConfigPath, &value));
103 EXPECT_EQ("TEST_HOST_ID", value); 103 EXPECT_EQ("TEST_HOST_ID", value);
104 EXPECT_TRUE(reader->GetString(kHostNameConfigPath, &value)); 104 EXPECT_TRUE(reader->GetString(kHostNameConfigPath, &value));
105 EXPECT_EQ("TEST_MACHINE_NAME", value); 105 EXPECT_EQ("TEST_MACHINE_NAME", value);
106 EXPECT_TRUE(reader->GetString(kPrivateKeyConfigPath, &value)); 106 EXPECT_TRUE(reader->GetString(kPrivateKeyConfigPath, &value));
107 EXPECT_EQ("TEST_PRIVATE_KEY", value); 107 EXPECT_EQ("TEST_PRIVATE_KEY", value);
108 } 108 }
109 109
110 } 110 }
OLDNEW
« no previous file with comments | « remoting/host/host_key_pair_unittest.cc ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698