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

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

Issue 163433011: Clarify the process title of GPU broker process. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Build fix for unittests Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/services/broker_process_unittest.cc
diff --git a/sandbox/linux/services/broker_process_unittest.cc b/sandbox/linux/services/broker_process_unittest.cc
index f163ef997188bdcfa53b67ffc218545f4c93a0e9..bf55e2e156cd000dbfe7d184661099eec29be5f7 100644
--- a/sandbox/linux/services/broker_process_unittest.cc
+++ b/sandbox/linux/services/broker_process_unittest.cc
@@ -15,6 +15,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -60,6 +61,10 @@ class ScopedTemporaryFile {
DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile);
};
+bool NoOpCallback() {
+ return true;
+}
+
} // namespace
#if defined(OS_ANDROID)
@@ -74,7 +79,7 @@ TEST(BrokerProcess, CreateAndDestroy) {
scoped_ptr<BrokerProcess> open_broker(
new BrokerProcess(EPERM, read_whitelist, std::vector<std::string>()));
- ASSERT_TRUE(open_broker->Init(NULL));
+ ASSERT_TRUE(open_broker->Init(base::Bind(&NoOpCallback)));
pid_t broker_pid = open_broker->broker_pid();
// Destroy the broker and check it has exited properly.
@@ -88,7 +93,7 @@ TEST(BrokerProcess, CreateAndDestroy) {
TEST(BrokerProcess, TestOpenAccessNull) {
const std::vector<std::string> empty;
BrokerProcess open_broker(EPERM, empty, empty);
- ASSERT_TRUE(open_broker.Init(NULL));
+ ASSERT_TRUE(open_broker.Init(base::Bind(&NoOpCallback)));
int fd = open_broker.Open(NULL, O_RDONLY);
ASSERT_EQ(fd, -EFAULT);
@@ -119,7 +124,7 @@ void TestOpenFilePerms(bool fast_check_in_client, int denied_errno) {
read_whitelist,
write_whitelist,
fast_check_in_client);
- ASSERT_TRUE(open_broker.Init(NULL));
+ ASSERT_TRUE(open_broker.Init(base::Bind(&NoOpCallback)));
int fd = -1;
fd = open_broker.Open(kR_WhiteListed, O_RDONLY);
@@ -270,7 +275,7 @@ void TestOpenCpuinfo(bool fast_check_in_client) {
scoped_ptr<BrokerProcess> open_broker(new BrokerProcess(
EPERM, read_whitelist, std::vector<std::string>(), fast_check_in_client));
- ASSERT_TRUE(open_broker->Init(NULL));
+ ASSERT_TRUE(open_broker->Init(base::Bind(&NoOpCallback)));
pid_t broker_pid = open_broker->broker_pid();
int fd = -1;
@@ -340,7 +345,7 @@ TEST(BrokerProcess, OpenFileRW) {
whitelist.push_back(tempfile_name);
BrokerProcess open_broker(EPERM, whitelist, whitelist);
- ASSERT_TRUE(open_broker.Init(NULL));
+ ASSERT_TRUE(open_broker.Init(base::Bind(&NoOpCallback)));
// Check we can access that file with read or write.
int can_access = open_broker.Access(tempfile_name, R_OK | W_OK);
@@ -377,7 +382,7 @@ SANDBOX_TEST(BrokerProcess, BrokerDied) {
std::vector<std::string>(),
true /* fast_check_in_client */,
true /* quiet_failures_for_tests */);
- SANDBOX_ASSERT(open_broker.Init(NULL));
+ SANDBOX_ASSERT(open_broker.Init(base::Bind(&NoOpCallback)));
pid_t broker_pid = open_broker.broker_pid();
SANDBOX_ASSERT(kill(broker_pid, SIGKILL) == 0);
@@ -400,7 +405,7 @@ void TestOpenComplexFlags(bool fast_check_in_client) {
whitelist,
whitelist,
fast_check_in_client);
- ASSERT_TRUE(open_broker.Init(NULL));
+ ASSERT_TRUE(open_broker.Init(base::Bind(&NoOpCallback)));
// Test that we do the right thing for O_CLOEXEC and O_NONBLOCK.
int fd = -1;
int ret = 0;
« sandbox/linux/services/broker_process.cc ('K') | « sandbox/linux/services/broker_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698