diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 23:48:34 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 23:48:34 +0000 |
commit | dc90da2c3f8c87baa8dcea7fbf0272001d771ecf (patch) | |
tree | 99baf8465918e25521eab024315a5aa9ce78734d /chrome/common/ipc_tests.cc | |
parent | bf1b47dfbe8294738c0db628af036e2fd363ddac (diff) | |
download | chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.zip chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.tar.gz chromium_src-dc90da2c3f8c87baa8dcea7fbf0272001d771ecf.tar.bz2 |
* Add ipc_tests unittest target to xcode project.
* Stub out ipc_channel_posix.cc to allow other code that depends on it to be compiled.
* Cleanup some ipc code a bit to compile on gcc.
* Remove unused IPC::Channel::ProcessPendingMessages()
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_tests.cc')
-rw-r--r-- | chrome/common/ipc_tests.cc | 25 |
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(); } - |