| 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::CreateNamedClient( |
| 67 this, io_thread_.message_loop_proxy().get())); | 67 handle, this, io_thread_.message_loop_proxy().get()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 TestShimClient::~TestShimClient() {} | 70 TestShimClient::~TestShimClient() {} |
| 71 | 71 |
| 72 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { | 72 bool TestShimClient::OnMessageReceived(const IPC::Message& message) { |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void TestShimClient::OnChannelError() { | 76 void TestShimClient::OnChannelError() { |
| 77 // Client should not get any channel errors for the current set of tests. | 77 // 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_)); | 262 EXPECT_TRUE(base::PathExists(directory_in_tmp_)); |
| 263 EXPECT_TRUE(base::PathExists(symlink_path_)); | 263 EXPECT_TRUE(base::PathExists(symlink_path_)); |
| 264 | 264 |
| 265 // Check that the symlink has been replaced. | 265 // Check that the symlink has been replaced. |
| 266 base::FilePath socket_path; | 266 base::FilePath socket_path; |
| 267 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); | 267 ASSERT_TRUE(base::ReadSymbolicLink(symlink_path_, &socket_path)); |
| 268 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); | 268 EXPECT_EQ(app_mode::kAppShimSocketShortName, socket_path.BaseName().value()); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace | 271 } // namespace |
| OLD | NEW |