summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/all_android.gyp3
-rwxr-xr-xbuild/android/run_tests.py2
-rw-r--r--ipc/file_descriptor_set_posix.cc1
-rw-r--r--ipc/ipc.gyp4
-rw-r--r--ipc/ipc_channel_posix_unittest.cc14
-rw-r--r--ipc/ipc_fuzzing_tests.cc4
-rw-r--r--ipc/ipc_message_macros.h3
-rw-r--r--ipc/ipc_platform_file.cc4
8 files changed, 28 insertions, 7 deletions
diff --git a/build/all_android.gyp b/build/all_android.gyp
index e7cf811..4735612 100644
--- a/build/all_android.gyp
+++ b/build/all_android.gyp
@@ -24,7 +24,8 @@
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
- '../sql/sql.gyp:sql_unittests'
+ '../sql/sql.gyp:sql_unittests',
+ '../ipc/ipc.gyp:ipc_tests'
],
},
], # targets
diff --git a/build/android/run_tests.py b/build/android/run_tests.py
index 5b95d6d..3534291 100755
--- a/build/android/run_tests.py
+++ b/build/android/run_tests.py
@@ -61,7 +61,7 @@ from single_test_runner import SingleTestRunner
from test_package_executable import TestPackageExecutable
from test_result import BaseTestResult, TestResults
-_TEST_SUITES = ['base_unittests', 'sql_unittests']
+_TEST_SUITES = ['base_unittests', 'sql_unittests', 'ipc_tests']
def RunTests(device, test_suite, gtest_filter, test_arguments, rebaseline,
timeout, performance_test, cleanup_test_files, tool,
diff --git a/ipc/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc
index df2a8e4..b85d0a4 100644
--- a/ipc/file_descriptor_set_posix.cc
+++ b/ipc/file_descriptor_set_posix.cc
@@ -6,6 +6,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
#include "base/eintr_wrapper.h"
#include "base/logging.h"
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp
index ab57cd9..9b38f77 100644
--- a/ipc/ipc.gyp
+++ b/ipc/ipc.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -63,7 +63,7 @@
'../build/linux/system.gyp:gtk',
],
}],
- ['os_posix == 1 and OS != "mac"', {
+ ['os_posix == 1 and OS != "mac" and OS != "android"', {
'conditions': [
['linux_use_tcmalloc==1', {
'dependencies': [
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index 6f37ae6..61c21d3 100644
--- a/ipc/ipc_channel_posix_unittest.cc
+++ b/ipc/ipc_channel_posix_unittest.cc
@@ -107,8 +107,13 @@ private:
scoped_ptr<MessageLoopForIO> message_loop_;
};
+#if defined(OS_ANDROID)
+const char IPCChannelPosixTest::kConnectionSocketTestName[] =
+ "/data/local/chrome_IPCChannelPosixTest__ConnectionSocket";
+#else
const char IPCChannelPosixTest::kConnectionSocketTestName[] =
"/var/tmp/chrome_IPCChannelPosixTest__ConnectionSocket";
+#endif
void IPCChannelPosixTest::SetUp() {
MultiProcessTest::SetUp();
@@ -177,8 +182,14 @@ void IPCChannelPosixTest::SpinRunLoop(int milliseconds) {
}
TEST_F(IPCChannelPosixTest, BasicListen) {
+
+#if defined(OS_ANDROID)
+ const char* kChannelName = "/data/local/IPCChannelPosixTest_BasicListen";
+#else
+ const char* kChannelName = "/var/tmp/IPCChannelPosixTest_BasicListen";
+#endif
// Test creating a socket that is listening.
- IPC::ChannelHandle handle("/var/tmp/IPCChannelPosixTest_BasicListen");
+ IPC::ChannelHandle handle(kChannelName);
SetUpSocket(&handle, IPC::Channel::MODE_NAMED_SERVER);
unlink(handle.name.c_str());
IPC::Channel channel(handle, IPC::Channel::MODE_NAMED_SERVER, NULL);
@@ -404,4 +415,3 @@ MULTIPROCESS_TEST_MAIN(IPCChannelPosixFailConnectionProc) {
}
return 0;
}
-
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index d1a3c33..a45d725 100644
--- a/ipc/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -355,8 +355,10 @@ class ServerMacroExTest {
public:
ServerMacroExTest() : unhandled_msgs_(0) {
}
+
virtual ~ServerMacroExTest() {
}
+
virtual bool OnMessageReceived(const IPC::Message& msg) {
bool msg_is_ok = false;
IPC_BEGIN_MESSAGE_MAP_EX(ServerMacroExTest, msg, msg_is_ok)
@@ -378,6 +380,8 @@ class ServerMacroExTest {
}
int unhandled_msgs_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServerMacroExTest);
};
TEST_F(IPCFuzzingTest, MsgMapExMacro) {
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 38eedcf..9b3f732 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -818,7 +818,8 @@ LogFunctionMap g_log_function_mapping;
class LoggerRegisterHelper##msg_class { \
public: \
LoggerRegisterHelper##msg_class() { \
- g_log_function_mapping[msg_class::ID] = msg_class::Log; \
+ const uint32 msg_id = static_cast<uint32>(msg_class::ID); \
+ g_log_function_mapping[msg_id] = msg_class::Log; \
} \
}; \
LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class;
diff --git a/ipc/ipc_platform_file.cc b/ipc/ipc_platform_file.cc
index 2b15ceb..b5ec7be 100644
--- a/ipc/ipc_platform_file.cc
+++ b/ipc/ipc_platform_file.cc
@@ -4,6 +4,10 @@
#include "ipc/ipc_platform_file.h"
+#if defined(OS_ANDROID)
+#include <unistd.h>
+#endif
+
namespace IPC {
PlatformFileForTransit GetFileHandleForProcess(base::PlatformFile handle,