OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/app_shim/app_shim_host_manager_mac.h" | 5 #include "apps/app_shim/app_shim_host_manager_mac.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include "apps/app_shim/app_shim_messages.h" | 9 #include "apps/app_shim/app_shim_messages.h" |
10 #include "apps/app_shim/test/app_shim_host_manager_test_api_mac.h" | 10 #include "apps/app_shim/test/app_shim_host_manager_test_api_mac.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 base::FilePath user_data_dir; | 56 base::FilePath user_data_dir; |
57 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); | 57 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); |
58 base::FilePath symlink_path = | 58 base::FilePath symlink_path = |
59 user_data_dir.Append(app_mode::kAppShimSocketSymlinkName); | 59 user_data_dir.Append(app_mode::kAppShimSocketSymlinkName); |
60 | 60 |
61 base::FilePath socket_path; | 61 base::FilePath socket_path; |
62 CHECK(base::ReadSymbolicLink(symlink_path, &socket_path)); | 62 CHECK(base::ReadSymbolicLink(symlink_path, &socket_path)); |
63 app_mode::VerifySocketPermissions(socket_path); | 63 app_mode::VerifySocketPermissions(socket_path); |
64 | 64 |
65 IPC::ChannelHandle handle(socket_path.value()); | 65 IPC::ChannelHandle handle(socket_path.value()); |
66 channel_.reset(new IPC::ChannelProxy(handle, IPC::Channel::MODE_NAMED_CLIENT, | 66 channel_ = IPC::ChannelProxy::Create(handle, |
67 this, io_thread_.message_loop_proxy().get())); | 67 IPC::Channel::MODE_NAMED_CLIENT, |
| 68 this, |
| 69 io_thread_.message_loop_proxy().get()); |
68 } | 70 } |
69 | 71 |
70 TestShimClient::~TestShimClient() {} | 72 TestShimClient::~TestShimClient() {} |
71 | 73 |
72 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { | 74 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { |
73 return true; | 75 return true; |
74 } | 76 } |
75 | 77 |
76 void TestShimClient::OnChannelError() { | 78 void TestShimClient::OnChannelError() { |
77 // Client should not get any channel errors for the current set of tests. | 79 // Client should not get any channel errors for the current set of tests. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 EXPECT_TRUE(base::PathExists(directory_in_tmp_)); | 264 EXPECT_TRUE(base::PathExists(directory_in_tmp_)); |
263 EXPECT_TRUE(base::PathExists(symlink_path_)); | 265 EXPECT_TRUE(base::PathExists(symlink_path_)); |
264 | 266 |
265 // Check that the symlink has been replaced. | 267 // Check that the symlink has been replaced. |
266 base::FilePath socket_path; | 268 base::FilePath socket_path; |
267 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); | 269 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); |
268 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); | 270 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); |
269 } | 271 } |
270 | 272 |
271 } // namespace | 273 } // namespace |
OLD | NEW |