diff options
Diffstat (limited to 'security/sandbox/chromium/sandbox/win/src/ipc_ping_test.cc')
-rw-r--r-- | security/sandbox/chromium/sandbox/win/src/ipc_ping_test.cc | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/security/sandbox/chromium/sandbox/win/src/ipc_ping_test.cc b/security/sandbox/chromium/sandbox/win/src/ipc_ping_test.cc deleted file mode 100644 index 64e3de6c5..000000000 --- a/security/sandbox/chromium/sandbox/win/src/ipc_ping_test.cc +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2006-2008 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. - -#include "testing/gtest/include/gtest/gtest.h" -#include "sandbox/win/src/sandbox.h" -#include "sandbox/win/src/sandbox_factory.h" -#include "sandbox/win/src/target_services.h" -#include "sandbox/win/tests/common/controller.h" - -namespace sandbox { - -// Tests that the IPC is working by issuing a special IPC that is not exposed -// in the public API. -SBOX_TESTS_COMMAND int IPC_Ping(int argc, wchar_t **argv) { - if (argc != 1) - return SBOX_TEST_FAILED; - - TargetServices* ts = SandboxFactory::GetTargetServices(); - if (NULL == ts) - return SBOX_TEST_FAILED; - - // Downcast because we have internal knowledge of the object returned. - TargetServicesBase* ts_base = reinterpret_cast<TargetServicesBase*>(ts); - - int version = 0; - if (L'1' == argv[0][0]) - version = 1; - else - version = 2; - - if (!ts_base->TestIPCPing(version)) - return SBOX_TEST_FAILED; - - ::Sleep(1); - if (!ts_base->TestIPCPing(version)) - return SBOX_TEST_FAILED; - - return SBOX_TEST_SUCCEEDED; -} - -// The IPC ping test should work before and after the token drop. -TEST(IPCTest, IPCPingTestSimple) { - TestRunner runner; - runner.SetTimeout(2000); - runner.SetTestState(EVERY_STATE); - EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"IPC_Ping 1")); -} - -TEST(IPCTest, IPCPingTestWithOutput) { - TestRunner runner; - runner.SetTimeout(2000); - runner.SetTestState(EVERY_STATE); - EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"IPC_Ping 2")); - EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"IPC_Ping 2")); -} - -} // namespace sandbox |