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

Unified Diff: sandbox/linux/syscall_broker/broker_process_unittest.cc

Issue 717673002: Linux sandbox: introduce BrokerChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename GetPair to CreatePair. Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/syscall_broker/broker_process.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/syscall_broker/broker_process_unittest.cc
diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc
index a6525591c6b27265f39feb75f0c5a50768605ab2..997667c36ad8a6b1b0dd78be1086054feb711e4c 100644
--- a/sandbox/linux/syscall_broker/broker_process_unittest.cc
+++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc
@@ -25,6 +25,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "base/posix/unix_domain_socket_linux.h"
+#include "sandbox/linux/syscall_broker/broker_client.h"
#include "sandbox/linux/tests/scoped_temporary_file.h"
#include "sandbox/linux/tests/test_utils.h"
#include "sandbox/linux/tests/unit_tests.h"
@@ -37,8 +38,10 @@ namespace syscall_broker {
class BrokerProcessTestHelper {
public:
static void CloseChannel(BrokerProcess* broker) { broker->CloseChannel(); }
- static int get_ipc_socketpair(const BrokerProcess* broker) {
- return broker->ipc_socketpair_;
+ // Get the client's IPC descriptor to send IPC requests directly.
+ // TODO(jln): refator tests to get rid of this.
+ static int GetIPCDescriptor(const BrokerProcess* broker) {
+ return broker->broker_client_->GetIPCDescriptor();
}
};
@@ -457,7 +460,7 @@ SANDBOX_TEST_ALLOW_NOISE(BrokerProcess, RecvMsgDescriptorLeak) {
BrokerProcess open_broker(EPERM, read_whitelist, std::vector<std::string>());
SANDBOX_ASSERT(open_broker.Init(base::Bind(&NoOpCallback)));
- const int ipc_fd = BrokerProcessTestHelper::get_ipc_socketpair(&open_broker);
+ const int ipc_fd = BrokerProcessTestHelper::GetIPCDescriptor(&open_broker);
SANDBOX_ASSERT(ipc_fd >= 0);
static const char kBogus[] = "not a pickle";
« no previous file with comments | « sandbox/linux/syscall_broker/broker_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698