| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "sync/util/get_session_name.h" | 10 #include "sync/util/get_session_name.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const std::string& session_name = GetSessionNameSynchronouslyForTesting(); | 57 const std::string& session_name = GetSessionNameSynchronouslyForTesting(); |
| 58 EXPECT_EQ("Chromebox", session_name); | 58 EXPECT_EQ("Chromebox", session_name); |
| 59 } | 59 } |
| 60 | 60 |
| 61 #endif // OS_CHROMEOS | 61 #endif // OS_CHROMEOS |
| 62 | 62 |
| 63 // Calls GetSessionName and runs the message loop until it comes back | 63 // Calls GetSessionName and runs the message loop until it comes back |
| 64 // with a session name. Makes sure the returned session name is equal | 64 // with a session name. Makes sure the returned session name is equal |
| 65 // to the return value of GetSessionNameSynchronouslyForTesting(). | 65 // to the return value of GetSessionNameSynchronouslyForTesting(). |
| 66 TEST_F(GetSessionNameTest, GetSessionName) { | 66 TEST_F(GetSessionNameTest, GetSessionName) { |
| 67 GetSessionName(message_loop_.message_loop_proxy(), | 67 GetSessionName(message_loop_.task_runner(), |
| 68 base::Bind(&GetSessionNameTest::SetSessionNameAndQuit, | 68 base::Bind(&GetSessionNameTest::SetSessionNameAndQuit, |
| 69 base::Unretained(this))); | 69 base::Unretained(this))); |
| 70 message_loop_.Run(); | 70 message_loop_.Run(); |
| 71 EXPECT_EQ(session_name_, GetSessionNameSynchronouslyForTesting()); | 71 EXPECT_EQ(session_name_, GetSessionNameSynchronouslyForTesting()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace | 74 } // namespace |
| 75 | 75 |
| 76 } // namespace syncer | 76 } // namespace syncer |
| OLD | NEW |