summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_tests.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/ipc_tests.cc')
-rw-r--r--chrome/common/ipc_tests.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc
index 251e970..e0c14c8 100644
--- a/chrome/common/ipc_tests.cc
+++ b/chrome/common/ipc_tests.cc
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#if defined(OS_WIN)
#include <windows.h>
+#endif
#include <stdio.h>
#include <iostream>
#include <string>
@@ -15,6 +17,7 @@
#include "base/debug_on_start.h"
#include "base/perftimer.h"
#include "base/process_util.h"
+#include "base/scoped_nsautorelease_pool.h"
#include "base/thread.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/ipc_channel.h"
@@ -89,7 +92,7 @@ class MyChannelListener : public IPC::Channel::Listener {
virtual void OnMessageReceived(const IPC::Message& message) {
IPC::MessageIterator iter(message);
- int index = iter.NextInt();
+ iter.NextInt();
const std::string data = iter.NextString();
if (--messages_left_ == 0) {
@@ -116,6 +119,8 @@ class MyChannelListener : public IPC::Channel::Listener {
};
static MyChannelListener channel_listener;
+// TODO(playmobil): Implement
+#if defined(OS_WIN)
TEST(IPCChannelTest, ChannelTest) {
// setup IPC channel
IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_SERVER,
@@ -164,6 +169,7 @@ TEST(IPCChannelTest, ChannelProxyTest) {
}
thread.Stop();
}
+#endif // defined(OS_WIN)
static bool RunTestClient() {
// setup IPC channel
@@ -176,7 +182,6 @@ static bool RunTestClient() {
MessageLoop::current()->Run();
return true;
}
-
#endif // !PERFORMANCE_TEST
#ifdef PERFORMANCE_TEST
@@ -340,6 +345,8 @@ static bool RunReflector() {
#endif // PERFORMANCE_TEST
+// TODO(playmobil): Implement
+#if defined(OS_WIN)
// All fatal log messages (e.g. DCHECK failures) imply unit test failures
static void IPCTestAssertHandler(const std::string& str) {
FAIL() << str;
@@ -382,9 +389,21 @@ HANDLE SpawnChild(ChildType child_type) {
return process;
}
+#endif // defined(OS_WIN)
+
+// TODO(playmobil): Implement
+#if defined(OS_POSIX)
+base::ProcessHandle SpawnChild(ChildType child_type) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+#endif
+
int main(int argc, char** argv) {
+ base::ScopedNSAutoreleasePool scoped_pool;
base::EnableTerminationOnHeapCorruption();
+#if defined(OS_WIN)
// Some tests may use base::Singleton<>, thus we need to instanciate
// the AtExitManager or else we will leak objects.
base::AtExitManager at_exit_manager;
@@ -396,6 +415,7 @@ int main(int argc, char** argv) {
SuppressErrorDialogs();
logging::SetLogAssertHandler(IPCTestAssertHandler);
}
+#endif // defined(OS_WIN)
#ifndef PERFORMANCE_TEST
if (CommandLine().HasSwitch(kChild))
@@ -413,4 +433,3 @@ int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
-