summaryrefslogtreecommitdiffstats
path: root/mojo/edk/test
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/edk/test')
-rw-r--r--mojo/edk/test/BUILD.gn119
-rw-r--r--mojo/edk/test/multiprocess_test_helper.cc84
-rw-r--r--mojo/edk/test/multiprocess_test_helper.h92
-rw-r--r--mojo/edk/test/multiprocess_test_helper_unittest.cc194
-rw-r--r--mojo/edk/test/run_all_perftests.cc14
-rw-r--r--mojo/edk/test/run_all_unittests.cc26
-rw-r--r--mojo/edk/test/test_support_impl.cc83
-rw-r--r--mojo/edk/test/test_support_impl.h34
-rw-r--r--mojo/edk/test/test_utils.h57
-rw-r--r--mojo/edk/test/test_utils_posix.cc100
-rw-r--r--mojo/edk/test/test_utils_win.cc124
11 files changed, 0 insertions, 927 deletions
diff --git a/mojo/edk/test/BUILD.gn b/mojo/edk/test/BUILD.gn
deleted file mode 100644
index d05f6d4..0000000
--- a/mojo/edk/test/BUILD.gn
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright 2014 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.
-
-import("../mojo_edk.gni")
-
-mojo_edk_source_set("test_support") {
- testonly = true
- sources = [
- "multiprocess_test_helper.cc",
- "multiprocess_test_helper.h",
- "test_utils.h",
- "test_utils_posix.cc",
- "test_utils_win.cc",
- ]
-
- deps = [
- "//base",
- "//base/test:test_support",
- "//testing/gtest",
- ]
-
- mojo_edk_deps = [ "mojo/edk/system" ]
-}
-
-mojo_edk_source_set("run_all_unittests") {
- testonly = true
- sources = [
- "run_all_unittests.cc",
- ]
-
- deps = [
- ":test_support_impl",
- "//base",
- "//base/test:test_support",
- "//testing/gtest",
- ]
-
- mojo_edk_deps = [ "mojo/edk/system" ]
-
- mojo_sdk_deps = [ "mojo/public/c/test_support" ]
-}
-
-mojo_edk_source_set("run_all_perftests") {
- testonly = true
- deps = [
- ":test_support_impl",
- "//base",
- "//base/test:test_support",
- ]
-
- mojo_edk_deps = [ "mojo/edk/system" ]
-
- mojo_sdk_deps = [ "mojo/public/c/test_support" ]
-
- sources = [
- "run_all_perftests.cc",
- ]
-}
-
-mojo_edk_source_set("test_support_impl") {
- testonly = true
- deps = [
- "//base",
- "//base/test:test_support",
- ]
-
- mojo_sdk_deps = [ "mojo/public/c/test_support" ]
-
- sources = [
- "test_support_impl.cc",
- "test_support_impl.h",
- ]
-}
-
-# Public SDK test targets follow. These targets are not defined within the
-# public SDK itself as running the unittests requires the EDK.
-
-test("mojo_public_application_unittests") {
- deps = [
- ":run_all_unittests",
- "../../public/cpp/application/tests",
- ]
-}
-
-test("mojo_public_bindings_unittests") {
- deps = [
- ":run_all_unittests",
- "../../public/cpp/bindings/tests",
- ]
-}
-
-test("mojo_public_environment_unittests") {
- deps = [
- ":run_all_unittests",
- "../../public/cpp/environment/tests",
- ]
-}
-
-test("mojo_public_system_perftests") {
- deps = [
- ":run_all_perftests",
- "../../public/c/system/tests:perftests",
- ]
-}
-
-test("mojo_public_system_unittests") {
- deps = [
- ":run_all_unittests",
- "../../public/cpp/system/tests",
- ]
-}
-
-test("mojo_public_utility_unittests") {
- deps = [
- ":run_all_unittests",
- "../../public/cpp/utility/tests",
- ]
-}
diff --git a/mojo/edk/test/multiprocess_test_helper.cc b/mojo/edk/test/multiprocess_test_helper.cc
deleted file mode 100644
index 6dd8b72..0000000
--- a/mojo/edk/test/multiprocess_test_helper.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2013 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 "mojo/edk/test/multiprocess_test_helper.h"
-
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "base/process/kill.h"
-#include "base/process/process_handle.h"
-#include "build/build_config.h"
-#include "mojo/edk/embedder/platform_channel_pair.h"
-
-namespace mojo {
-namespace test {
-
-MultiprocessTestHelper::MultiprocessTestHelper() {
- platform_channel_pair_.reset(new embedder::PlatformChannelPair());
- server_platform_handle = platform_channel_pair_->PassServerHandle();
-}
-
-MultiprocessTestHelper::~MultiprocessTestHelper() {
- CHECK(!test_child_.IsValid());
- server_platform_handle.reset();
- platform_channel_pair_.reset();
-}
-
-void MultiprocessTestHelper::StartChild(const std::string& test_child_name) {
- CHECK(platform_channel_pair_);
- CHECK(!test_child_name.empty());
- CHECK(!test_child_.IsValid());
-
- std::string test_child_main = test_child_name + "TestChildMain";
-
- base::CommandLine command_line(
- base::GetMultiProcessTestChildBaseCommandLine());
- embedder::HandlePassingInformation handle_passing_info;
- platform_channel_pair_->PrepareToPassClientHandleToChildProcess(
- &command_line, &handle_passing_info);
-
- base::LaunchOptions options;
-#if defined(OS_POSIX)
- options.fds_to_remap = &handle_passing_info;
-#elif defined(OS_WIN)
- options.start_hidden = true;
- options.handles_to_inherit = &handle_passing_info;
-#else
-#error "Not supported yet."
-#endif
-
- test_child_ =
- base::SpawnMultiProcessTestChild(test_child_main, command_line, options);
- platform_channel_pair_->ChildProcessLaunched();
-
- CHECK(test_child_.IsValid());
-}
-
-int MultiprocessTestHelper::WaitForChildShutdown() {
- CHECK(test_child_.IsValid());
-
- int rv = -1;
- CHECK(
- test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &rv));
- test_child_.Close();
- return rv;
-}
-
-bool MultiprocessTestHelper::WaitForChildTestShutdown() {
- return WaitForChildShutdown() == 0;
-}
-
-// static
-void MultiprocessTestHelper::ChildSetup() {
- CHECK(base::CommandLine::InitializedForCurrentProcess());
- client_platform_handle =
- embedder::PlatformChannelPair::PassClientHandleFromParentProcess(
- *base::CommandLine::ForCurrentProcess());
-}
-
-// static
-embedder::ScopedPlatformHandle MultiprocessTestHelper::client_platform_handle;
-
-} // namespace test
-} // namespace mojo
diff --git a/mojo/edk/test/multiprocess_test_helper.h b/mojo/edk/test/multiprocess_test_helper.h
deleted file mode 100644
index e40b309c..0000000
--- a/mojo/edk/test/multiprocess_test_helper.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
-#define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
-
-#include <string>
-
-#include "base/macros.h"
-#include "base/process/process.h"
-#include "base/test/multiprocess_test.h"
-#include "base/test/test_timeouts.h"
-#include "mojo/edk/embedder/scoped_platform_handle.h"
-#include "testing/multiprocess_func_list.h"
-
-namespace mojo {
-
-namespace embedder {
-class PlatformChannelPair;
-}
-
-namespace test {
-
-class MultiprocessTestHelper {
- public:
- MultiprocessTestHelper();
- ~MultiprocessTestHelper();
-
- // Start a child process and run the "main" function "named" |test_child_name|
- // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or
- // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below).
- void StartChild(const std::string& test_child_name);
- // Wait for the child process to terminate.
- // Returns the exit code of the child process. Note that, though it's declared
- // to be an |int|, the exit code is subject to mangling by the OS. E.g., we
- // usually return -1 on error in the child (e.g., if |test_child_name| was not
- // found), but this is mangled to 255 on Linux. You should only rely on codes
- // 0-127 being preserved, and -1 being outside the range 0-127.
- int WaitForChildShutdown();
-
- // Like |WaitForChildShutdown()|, but returns true on success (exit code of 0)
- // and false otherwise. You probably want to do something like
- // |EXPECT_TRUE(WaitForChildTestShutdown());|. Mainly for use with
- // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()|.
- bool WaitForChildTestShutdown();
-
- // For use by |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| only:
- static void ChildSetup();
-
- // For use in the main process:
- embedder::ScopedPlatformHandle server_platform_handle;
-
- // For use (and only valid) in the child process:
- static embedder::ScopedPlatformHandle client_platform_handle;
-
- private:
- scoped_ptr<embedder::PlatformChannelPair> platform_channel_pair_;
-
- // Valid after |StartChild()| and before |WaitForChildShutdown()|.
- base::Process test_child_;
-
- DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper);
-};
-
-// Use this to declare the child process's "main()" function for tests using
-// |MultiprocessTestHelper|. It returns an |int|, which will be the process's
-// exit code (but see the comment about |WaitForChildShutdown()|).
-#define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \
- MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
- test_child_name##TestChildMain, \
- ::mojo::test::MultiprocessTestHelper::ChildSetup)
-
-// Use this (and |WaitForChildTestShutdown()|) for the child process's "main()",
-// if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return
-// type. (Note that while an |ASSERT_...()| failure will abort the test in the
-// child, it will not abort the test in the parent.)
-#define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \
- void test_child_name##TestChildTest(); \
- MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
- test_child_name##TestChildTest(); \
- return (::testing::Test::HasFatalFailure() || \
- ::testing::Test::HasNonfatalFailure()) \
- ? 1 \
- : 0; \
- } \
- void test_child_name##TestChildTest()
-
-} // namespace test
-} // namespace mojo
-
-#endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_
diff --git a/mojo/edk/test/multiprocess_test_helper_unittest.cc b/mojo/edk/test/multiprocess_test_helper_unittest.cc
deleted file mode 100644
index 93496fb..0000000
--- a/mojo/edk/test/multiprocess_test_helper_unittest.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-// Copyright 2013 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 "mojo/edk/test/multiprocess_test_helper.h"
-
-#include "base/logging.h"
-#include "build/build_config.h"
-#include "mojo/edk/embedder/scoped_platform_handle.h"
-#include "mojo/edk/test/test_utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(OS_POSIX)
-#include <fcntl.h>
-#endif
-
-namespace mojo {
-namespace test {
-namespace {
-
-bool IsNonBlocking(const embedder::PlatformHandle& handle) {
-#if defined(OS_WIN)
- // Haven't figured out a way to query whether a HANDLE was created with
- // FILE_FLAG_OVERLAPPED.
- return true;
-#else
- return fcntl(handle.fd, F_GETFL) & O_NONBLOCK;
-#endif
-}
-
-bool WriteByte(const embedder::PlatformHandle& handle, char c) {
- size_t bytes_written = 0;
- BlockingWrite(handle, &c, 1, &bytes_written);
- return bytes_written == 1;
-}
-
-bool ReadByte(const embedder::PlatformHandle& handle, char* c) {
- size_t bytes_read = 0;
- BlockingRead(handle, c, 1, &bytes_read);
- return bytes_read == 1;
-}
-
-typedef testing::Test MultiprocessTestHelperTest;
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_RunChild DISABLED_RunChild
-#else
-#define MAYBE_RunChild RunChild
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_RunChild) {
- MultiprocessTestHelper helper;
- EXPECT_TRUE(helper.server_platform_handle.is_valid());
-
- helper.StartChild("RunChild");
- EXPECT_EQ(123, helper.WaitForChildShutdown());
-}
-
-MOJO_MULTIPROCESS_TEST_CHILD_MAIN(RunChild) {
- CHECK(MultiprocessTestHelper::client_platform_handle.is_valid());
- return 123;
-}
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_TestChildMainNotFound DISABLED_TestChildMainNotFound
-#else
-#define MAYBE_TestChildMainNotFound TestChildMainNotFound
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_TestChildMainNotFound) {
- MultiprocessTestHelper helper;
- helper.StartChild("NoSuchTestChildMain");
- int result = helper.WaitForChildShutdown();
- EXPECT_FALSE(result >= 0 && result <= 127);
-}
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_PassedChannel DISABLED_PassedChannel
-#else
-#define MAYBE_PassedChannel PassedChannel
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_PassedChannel) {
- MultiprocessTestHelper helper;
- EXPECT_TRUE(helper.server_platform_handle.is_valid());
- helper.StartChild("PassedChannel");
-
- // Take ownership of the handle.
- embedder::ScopedPlatformHandle handle = helper.server_platform_handle.Pass();
-
- // The handle should be non-blocking.
- EXPECT_TRUE(IsNonBlocking(handle.get()));
-
- // Write a byte.
- const char c = 'X';
- EXPECT_TRUE(WriteByte(handle.get(), c));
-
- // It'll echo it back to us, incremented.
- char d = 0;
- EXPECT_TRUE(ReadByte(handle.get(), &d));
- EXPECT_EQ(c + 1, d);
-
- // And return it, incremented again.
- EXPECT_EQ(c + 2, helper.WaitForChildShutdown());
-}
-
-MOJO_MULTIPROCESS_TEST_CHILD_MAIN(PassedChannel) {
- CHECK(MultiprocessTestHelper::client_platform_handle.is_valid());
-
- // Take ownership of the handle.
- embedder::ScopedPlatformHandle handle =
- MultiprocessTestHelper::client_platform_handle.Pass();
-
- // The handle should be non-blocking.
- EXPECT_TRUE(IsNonBlocking(handle.get()));
-
- // Read a byte.
- char c = 0;
- EXPECT_TRUE(ReadByte(handle.get(), &c));
-
- // Write it back, incremented.
- c++;
- EXPECT_TRUE(WriteByte(handle.get(), c));
-
- // And return it, incremented again.
- c++;
- return static_cast<int>(c);
-}
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_ChildTestPasses DISABLED_ChildTestPasses
-#else
-#define MAYBE_ChildTestPasses ChildTestPasses
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_ChildTestPasses) {
- MultiprocessTestHelper helper;
- EXPECT_TRUE(helper.server_platform_handle.is_valid());
- helper.StartChild("ChildTestPasses");
- EXPECT_TRUE(helper.WaitForChildTestShutdown());
-}
-
-MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestPasses) {
- ASSERT_TRUE(MultiprocessTestHelper::client_platform_handle.is_valid());
- EXPECT_TRUE(
- IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()));
-}
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_ChildTestFailsAssert DISABLED_ChildTestFailsAssert
-#else
-#define MAYBE_ChildTestFailsAssert ChildTestFailsAssert
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_ChildTestFailsAssert) {
- MultiprocessTestHelper helper;
- EXPECT_TRUE(helper.server_platform_handle.is_valid());
- helper.StartChild("ChildTestFailsAssert");
- EXPECT_FALSE(helper.WaitForChildTestShutdown());
-}
-
-MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestFailsAssert) {
- ASSERT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid())
- << "DISREGARD: Expected failure in child process";
- ASSERT_FALSE(
- IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()))
- << "Not reached";
- CHECK(false) << "Not reached";
-}
-
-#if defined(OS_ANDROID)
-// Android multi-process tests are not executing the new process. This is flaky.
-#define MAYBE_ChildTestFailsExpect DISABLED_ChildTestFailsExpect
-#else
-#define MAYBE_ChildTestFailsExpect ChildTestFailsExpect
-#endif // defined(OS_ANDROID)
-TEST_F(MultiprocessTestHelperTest, MAYBE_ChildTestFailsExpect) {
- MultiprocessTestHelper helper;
- EXPECT_TRUE(helper.server_platform_handle.is_valid());
- helper.StartChild("ChildTestFailsExpect");
- EXPECT_FALSE(helper.WaitForChildTestShutdown());
-}
-
-MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestFailsExpect) {
- EXPECT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid())
- << "DISREGARD: Expected failure #1 in child process";
- EXPECT_FALSE(
- IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()))
- << "DISREGARD: Expected failure #2 in child process";
-}
-
-} // namespace
-} // namespace test
-} // namespace mojo
diff --git a/mojo/edk/test/run_all_perftests.cc b/mojo/edk/test/run_all_perftests.cc
deleted file mode 100644
index f0eacc6..0000000
--- a/mojo/edk/test/run_all_perftests.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2013 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 "base/test/perf_test_suite.h"
-#include "mojo/edk/embedder/test_embedder.h"
-#include "mojo/edk/test/test_support_impl.h"
-#include "mojo/public/tests/test_support_private.h"
-
-int main(int argc, char** argv) {
- mojo::embedder::test::InitWithSimplePlatformSupport();
- mojo::test::TestSupport::Init(new mojo::test::TestSupportImpl());
- return base::PerfTestSuite(argc, argv).Run();
-}
diff --git a/mojo/edk/test/run_all_unittests.cc b/mojo/edk/test/run_all_unittests.cc
deleted file mode 100644
index 166a73e..0000000
--- a/mojo/edk/test/run_all_unittests.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2013 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 "base/bind.h"
-#include "base/test/launcher/unit_test_launcher.h"
-#include "base/test/test_suite.h"
-#include "mojo/edk/embedder/test_embedder.h"
-#include "mojo/edk/test/test_support_impl.h"
-#include "mojo/public/tests/test_support_private.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-int main(int argc, char** argv) {
- // Silence death test thread warnings on Linux. We can afford to run our death
- // tests a little more slowly (< 10 ms per death test on a Z620).
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
-
- base::TestSuite test_suite(argc, argv);
-
- mojo::embedder::test::InitWithSimplePlatformSupport();
- mojo::test::TestSupport::Init(new mojo::test::TestSupportImpl());
-
- return base::LaunchUnitTests(
- argc, argv,
- base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
-}
diff --git a/mojo/edk/test/test_support_impl.cc b/mojo/edk/test/test_support_impl.cc
deleted file mode 100644
index 34b32ce..0000000
--- a/mojo/edk/test/test_support_impl.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2014 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 "mojo/edk/test/test_support_impl.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <string>
-
-#include "base/files/file_enumerator.h"
-#include "base/files/file_path.h"
-#include "base/files/file_util.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/test/perf_log.h"
-
-namespace mojo {
-namespace test {
-namespace {
-
-base::FilePath ResolveSourceRootRelativePath(const char* relative_path) {
- base::FilePath path;
- if (!PathService::Get(base::DIR_SOURCE_ROOT, &path))
- return base::FilePath();
-
- std::vector<std::string> components;
- base::SplitString(relative_path, '/', &components);
-
- for (size_t i = 0; i < components.size(); ++i) {
- if (!components[i].empty())
- path = path.AppendASCII(components[i]);
- }
-
- return path;
-}
-
-} // namespace
-
-TestSupportImpl::TestSupportImpl() {
-}
-
-TestSupportImpl::~TestSupportImpl() {
-}
-
-void TestSupportImpl::LogPerfResult(const char* test_name,
- const char* sub_test_name,
- double value,
- const char* units) {
- DCHECK(test_name);
- if (sub_test_name) {
- std::string name = base::StringPrintf("%s/%s", test_name, sub_test_name);
- base::LogPerfResult(name.c_str(), value, units);
- } else {
- base::LogPerfResult(test_name, value, units);
- }
-}
-
-FILE* TestSupportImpl::OpenSourceRootRelativeFile(const char* relative_path) {
- return base::OpenFile(ResolveSourceRootRelativePath(relative_path), "rb");
-}
-
-char** TestSupportImpl::EnumerateSourceRootRelativeDirectory(
- const char* relative_path) {
- std::vector<std::string> names;
- base::FileEnumerator e(ResolveSourceRootRelativePath(relative_path), false,
- base::FileEnumerator::FILES);
- for (base::FilePath name = e.Next(); !name.empty(); name = e.Next())
- names.push_back(name.BaseName().AsUTF8Unsafe());
-
- // |names.size() + 1| for null terminator.
- char** rv = static_cast<char**>(calloc(names.size() + 1, sizeof(char*)));
- for (size_t i = 0; i < names.size(); ++i)
- rv[i] = base::strdup(names[i].c_str());
- return rv;
-}
-
-} // namespace test
-} // namespace mojo
diff --git a/mojo/edk/test/test_support_impl.h b/mojo/edk/test/test_support_impl.h
deleted file mode 100644
index 533bfce..0000000
--- a/mojo/edk/test/test_support_impl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
-#define MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
-
-#include "base/macros.h"
-#include "mojo/public/tests/test_support_private.h"
-
-namespace mojo {
-namespace test {
-
-class TestSupportImpl : public TestSupport {
- public:
- TestSupportImpl();
- ~TestSupportImpl() override;
-
- void LogPerfResult(const char* test_name,
- const char* sub_test_name,
- double value,
- const char* units) override;
- FILE* OpenSourceRootRelativeFile(const char* relative_path) override;
- char** EnumerateSourceRootRelativeDirectory(
- const char* relative_path) override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestSupportImpl);
-};
-
-} // namespace test
-} // namespace mojo
-
-#endif // MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
diff --git a/mojo/edk/test/test_utils.h b/mojo/edk/test/test_utils.h
deleted file mode 100644
index 9287457..0000000
--- a/mojo/edk/test/test_utils.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef MOJO_EDK_TEST_TEST_UTILS_H_
-#define MOJO_EDK_TEST_TEST_UTILS_H_
-
-#include <stddef.h>
-#include <stdio.h>
-
-#include <string>
-
-#include "base/files/file_path.h"
-#include "base/files/scoped_file.h"
-#include "mojo/edk/embedder/platform_handle.h"
-#include "mojo/edk/embedder/scoped_platform_handle.h"
-
-namespace mojo {
-namespace test {
-
-// On success, |bytes_written| is updated to the number of bytes written;
-// otherwise it is untouched.
-bool BlockingWrite(const embedder::PlatformHandle& handle,
- const void* buffer,
- size_t bytes_to_write,
- size_t* bytes_written);
-
-// On success, |bytes_read| is updated to the number of bytes read; otherwise it
-// is untouched.
-bool BlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read);
-
-// If the read is done successfully or would block, the function returns true
-// and updates |bytes_read| to the number of bytes read (0 if the read would
-// block); otherwise it returns false and leaves |bytes_read| untouched.
-// |handle| must already be in non-blocking mode.
-bool NonBlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read);
-
-// Gets a (scoped) |PlatformHandle| from the given (scoped) |FILE|.
-embedder::ScopedPlatformHandle PlatformHandleFromFILE(base::ScopedFILE fp);
-
-// Gets a (scoped) |FILE| from a (scoped) |PlatformHandle|.
-base::ScopedFILE FILEFromPlatformHandle(embedder::ScopedPlatformHandle h,
- const char* mode);
-
-// Returns the path to the mojom js bindings file.
-base::FilePath GetFilePathForJSResource(const std::string& path);
-
-} // namespace test
-} // namespace mojo
-
-#endif // MOJO_EDK_TEST_TEST_UTILS_H_
diff --git a/mojo/edk/test/test_utils_posix.cc b/mojo/edk/test/test_utils_posix.cc
deleted file mode 100644
index 6491baf..0000000
--- a/mojo/edk/test/test_utils_posix.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2014 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 "mojo/edk/test/test_utils.h"
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "base/base_paths.h"
-#include "base/path_service.h"
-#include "base/posix/eintr_wrapper.h"
-
-namespace mojo {
-namespace test {
-
-bool BlockingWrite(const embedder::PlatformHandle& handle,
- const void* buffer,
- size_t bytes_to_write,
- size_t* bytes_written) {
- int original_flags = fcntl(handle.fd, F_GETFL);
- if (original_flags == -1 ||
- fcntl(handle.fd, F_SETFL, original_flags & (~O_NONBLOCK)) != 0) {
- return false;
- }
-
- ssize_t result = HANDLE_EINTR(write(handle.fd, buffer, bytes_to_write));
-
- fcntl(handle.fd, F_SETFL, original_flags);
-
- if (result < 0)
- return false;
-
- *bytes_written = result;
- return true;
-}
-
-bool BlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read) {
- int original_flags = fcntl(handle.fd, F_GETFL);
- if (original_flags == -1 ||
- fcntl(handle.fd, F_SETFL, original_flags & (~O_NONBLOCK)) != 0) {
- return false;
- }
-
- ssize_t result = HANDLE_EINTR(read(handle.fd, buffer, buffer_size));
-
- fcntl(handle.fd, F_SETFL, original_flags);
-
- if (result < 0)
- return false;
-
- *bytes_read = result;
- return true;
-}
-
-bool NonBlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read) {
- ssize_t result = HANDLE_EINTR(read(handle.fd, buffer, buffer_size));
-
- if (result < 0) {
- if (errno != EAGAIN && errno != EWOULDBLOCK)
- return false;
-
- *bytes_read = 0;
- } else {
- *bytes_read = result;
- }
-
- return true;
-}
-
-embedder::ScopedPlatformHandle PlatformHandleFromFILE(base::ScopedFILE fp) {
- CHECK(fp);
- int rv = dup(fileno(fp.get()));
- PCHECK(rv != -1) << "dup";
- return embedder::ScopedPlatformHandle(embedder::PlatformHandle(rv));
-}
-
-base::ScopedFILE FILEFromPlatformHandle(embedder::ScopedPlatformHandle h,
- const char* mode) {
- CHECK(h.is_valid());
- base::ScopedFILE rv(fdopen(h.release().fd, mode));
- PCHECK(rv) << "fdopen";
- return rv.Pass();
-}
-
-base::FilePath GetFilePathForJSResource(const std::string& path) {
- std::string binding_path = "gen/" + path + ".js";
- base::FilePath exe_dir;
- PathService::Get(base::DIR_EXE, &exe_dir);
- return exe_dir.AppendASCII(binding_path);
-}
-
-} // namespace test
-} // namespace mojo
diff --git a/mojo/edk/test/test_utils_win.cc b/mojo/edk/test/test_utils_win.cc
deleted file mode 100644
index 2387945..0000000
--- a/mojo/edk/test/test_utils_win.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2014 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 "mojo/edk/test/test_utils.h"
-
-#include <windows.h>
-#include <fcntl.h>
-#include <io.h>
-#include <string.h>
-
-#include "base/base_paths.h"
-#include "base/path_service.h"
-#include "base/strings/string_util.h"
-
-namespace mojo {
-namespace test {
-
-bool BlockingWrite(const embedder::PlatformHandle& handle,
- const void* buffer,
- size_t bytes_to_write,
- size_t* bytes_written) {
- OVERLAPPED overlapped = {0};
- DWORD bytes_written_dword = 0;
-
- if (!WriteFile(handle.handle, buffer, static_cast<DWORD>(bytes_to_write),
- &bytes_written_dword, &overlapped)) {
- if (GetLastError() != ERROR_IO_PENDING ||
- !GetOverlappedResult(handle.handle, &overlapped, &bytes_written_dword,
- TRUE)) {
- return false;
- }
- }
-
- *bytes_written = bytes_written_dword;
- return true;
-}
-
-bool BlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read) {
- OVERLAPPED overlapped = {0};
- DWORD bytes_read_dword = 0;
-
- if (!ReadFile(handle.handle, buffer, static_cast<DWORD>(buffer_size),
- &bytes_read_dword, &overlapped)) {
- if (GetLastError() != ERROR_IO_PENDING ||
- !GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword,
- TRUE)) {
- return false;
- }
- }
-
- *bytes_read = bytes_read_dword;
- return true;
-}
-
-bool NonBlockingRead(const embedder::PlatformHandle& handle,
- void* buffer,
- size_t buffer_size,
- size_t* bytes_read) {
- OVERLAPPED overlapped = {0};
- DWORD bytes_read_dword = 0;
-
- if (!ReadFile(handle.handle, buffer, static_cast<DWORD>(buffer_size),
- &bytes_read_dword, &overlapped)) {
- if (GetLastError() != ERROR_IO_PENDING)
- return false;
-
- CancelIo(handle.handle);
-
- if (!GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword,
- TRUE)) {
- *bytes_read = 0;
- return true;
- }
- }
-
- *bytes_read = bytes_read_dword;
- return true;
-}
-
-embedder::ScopedPlatformHandle PlatformHandleFromFILE(base::ScopedFILE fp) {
- CHECK(fp);
-
- HANDLE rv = INVALID_HANDLE_VALUE;
- PCHECK(DuplicateHandle(
- GetCurrentProcess(),
- reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(fp.get()))),
- GetCurrentProcess(), &rv, 0, TRUE, DUPLICATE_SAME_ACCESS))
- << "DuplicateHandle";
- return embedder::ScopedPlatformHandle(embedder::PlatformHandle(rv));
-}
-
-base::ScopedFILE FILEFromPlatformHandle(embedder::ScopedPlatformHandle h,
- const char* mode) {
- CHECK(h.is_valid());
- // Microsoft's documentation for |_open_osfhandle()| only discusses these
- // flags (and |_O_WTEXT|). Hmmm.
- int flags = 0;
- if (strchr(mode, 'a'))
- flags |= _O_APPEND;
- if (strchr(mode, 'r'))
- flags |= _O_RDONLY;
- if (strchr(mode, 't'))
- flags |= _O_TEXT;
- base::ScopedFILE rv(_fdopen(
- _open_osfhandle(reinterpret_cast<intptr_t>(h.release().handle), flags),
- mode));
- PCHECK(rv) << "_fdopen";
- return rv.Pass();
-}
-
-base::FilePath GetFilePathForJSResource(const std::string& path) {
- std::string binding_path = "gen/" + path + ".js";
- base::ReplaceChars(binding_path, "//", "\\", &binding_path);
- base::FilePath exe_dir;
- PathService::Get(base::DIR_EXE, &exe_dir);
- return exe_dir.AppendASCII(binding_path);
-}
-
-} // namespace test
-} // namespace mojo