Bug 883537 - Remove dead testing code from chromium; r=bsmedberg
authorMs2ger <ms2ger@gmail.com>
Sun, 23 Jun 2013 09:14:36 +0200
changeset 147641 dc5b9d21be2e50e607ac23d17eeeb82c7c347454
parent 147640 6474695077bfdae679125a3ddb8adfd36eb51e67
child 147642 29769461065f5fa6e78d4403f636113f0f140485
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs883537
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 883537 - Remove dead testing code from chromium; r=bsmedberg
ipc/chromium/src/base/at_exit_unittest.cc
ipc/chromium/src/base/atomicops_unittest.cc
ipc/chromium/src/base/command_line_unittest.cc
ipc/chromium/src/base/condition_variable_unittest.cc
ipc/chromium/src/base/data_pack_unittest.cc
ipc/chromium/src/base/debug_util_unittest.cc
ipc/chromium/src/base/directory_watcher_unittest.cc
ipc/chromium/src/base/field_trial_unittest.cc
ipc/chromium/src/base/file_descriptor_shuffle_unittest.cc
ipc/chromium/src/base/file_path_unittest.cc
ipc/chromium/src/base/file_util_unittest.cc
ipc/chromium/src/base/file_version_info_unittest.cc
ipc/chromium/src/base/histogram.h
ipc/chromium/src/base/histogram_unittest.cc
ipc/chromium/src/base/hmac_unittest.cc
ipc/chromium/src/base/idletimer_unittest.cc
ipc/chromium/src/base/lazy_instance_unittest.cc
ipc/chromium/src/base/linked_ptr_unittest.cc
ipc/chromium/src/base/mac_util_unittest.cc
ipc/chromium/src/base/message_loop_unittest.cc
ipc/chromium/src/base/object_watcher_unittest.cc
ipc/chromium/src/base/observer_list_unittest.cc
ipc/chromium/src/base/path_service_unittest.cc
ipc/chromium/src/base/pe_image_unittest.cc
ipc/chromium/src/base/pickle.h
ipc/chromium/src/base/pickle_unittest.cc
ipc/chromium/src/base/pr_time_unittest.cc
ipc/chromium/src/base/process_util_unittest.cc
ipc/chromium/src/base/rand_util_unittest.cc
ipc/chromium/src/base/ref_counted_unittest.cc
ipc/chromium/src/base/scoped_bstr_win_unittest.cc
ipc/chromium/src/base/scoped_comptr_win_unittest.cc
ipc/chromium/src/base/scoped_ptr_unittest.cc
ipc/chromium/src/base/scoped_temp_dir_unittest.cc
ipc/chromium/src/base/scoped_variant_win_unittest.cc
ipc/chromium/src/base/shared_memory_unittest.cc
ipc/chromium/src/base/simple_thread_unittest.cc
ipc/chromium/src/base/singleton_unittest.cc
ipc/chromium/src/base/stack_container_unittest.cc
ipc/chromium/src/base/stats_table_unittest.cc
ipc/chromium/src/base/string_escape_unittest.cc
ipc/chromium/src/base/string_piece_unittest.cc
ipc/chromium/src/base/string_tokenizer_unittest.cc
ipc/chromium/src/base/string_util_unittest.cc
ipc/chromium/src/base/sys_info_unittest.cc
ipc/chromium/src/base/sys_string_conversions_unittest.cc
ipc/chromium/src/base/system_monitor_unittest.cc
ipc/chromium/src/base/thread_collision_warner_unittest.cc
ipc/chromium/src/base/thread_local_storage_unittest.cc
ipc/chromium/src/base/thread_local_unittest.cc
ipc/chromium/src/base/thread_unittest.cc
ipc/chromium/src/base/time_unittest.cc
ipc/chromium/src/base/time_win_unittest.cc
ipc/chromium/src/base/timer_unittest.cc
ipc/chromium/src/base/tracked_objects_unittest.cc
ipc/chromium/src/base/tuple_unittest.cc
ipc/chromium/src/base/values_unittest.cc
ipc/chromium/src/base/version_unittest.cc
ipc/chromium/src/base/waitable_event_unittest.cc
ipc/chromium/src/base/waitable_event_watcher_unittest.cc
ipc/chromium/src/base/watchdog_unittest.cc
ipc/chromium/src/base/win_util_unittest.cc
ipc/chromium/src/base/wmi_util_unittest.cc
ipc/chromium/src/base/word_iterator_unittest.cc
ipc/chromium/src/base/worker_pool_linux_unittest.cc
ipc/chromium/src/base/worker_pool_unittest.cc
ipc/chromium/src/testing/gtest/include/gtest/gtest-death-test.h
ipc/chromium/src/testing/gtest/include/gtest/gtest-message.h
ipc/chromium/src/testing/gtest/include/gtest/gtest-param-test.h
ipc/chromium/src/testing/gtest/include/gtest/gtest-param-test.h.pump
ipc/chromium/src/testing/gtest/include/gtest/gtest-spi.h
ipc/chromium/src/testing/gtest/include/gtest/gtest-test-part.h
ipc/chromium/src/testing/gtest/include/gtest/gtest-typed-test.h
ipc/chromium/src/testing/gtest/include/gtest/gtest.h
ipc/chromium/src/testing/gtest/include/gtest/gtest_pred_impl.h
ipc/chromium/src/testing/gtest/include/gtest/gtest_prod.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-filepath.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-internal.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-param-util.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-string.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-type-util.h
ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-type-util.h.pump
deleted file mode 100644
--- a/ipc/chromium/src/base/at_exit_unittest.cc
+++ /dev/null
@@ -1,85 +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 "base/at_exit.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-// Don't test the global AtExitManager, because asking it to process its
-// AtExit callbacks can ruin the global state that other tests may depend on.
-class ShadowingAtExitManager : public base::AtExitManager {
- public:
-  ShadowingAtExitManager() : AtExitManager(true) {}
-};
-
-int g_test_counter_1 = 0;
-int g_test_counter_2 = 0;
-
-void IncrementTestCounter1(void* unused) {
-  ++g_test_counter_1;
-}
-
-void IncrementTestCounter2(void* unused) {
-  ++g_test_counter_2;
-}
-
-void ZeroTestCounters() {
-  g_test_counter_1 = 0;
-  g_test_counter_2 = 0;
-}
-
-void ExpectCounter1IsZero(void* unused) {
-  EXPECT_EQ(0, g_test_counter_1);
-}
-
-void ExpectParamIsNull(void* param) {
-  EXPECT_EQ(static_cast<void*>(NULL), param);
-}
-
-void ExpectParamIsCounter(void* param) {
-  EXPECT_EQ(&g_test_counter_1, param);
-}
-
-}  // namespace
-
-TEST(AtExitTest, Basic) {
-  ShadowingAtExitManager shadowing_at_exit_manager;
-
-  ZeroTestCounters();
-  base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);
-  base::AtExitManager::RegisterCallback(&IncrementTestCounter2, NULL);
-  base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);
-
-  EXPECT_EQ(0, g_test_counter_1);
-  EXPECT_EQ(0, g_test_counter_2);
-  base::AtExitManager::ProcessCallbacksNow();
-  EXPECT_EQ(2, g_test_counter_1);
-  EXPECT_EQ(1, g_test_counter_2);
-}
-
-TEST(AtExitTest, LIFOOrder) {
-  ShadowingAtExitManager shadowing_at_exit_manager;
-
-  ZeroTestCounters();
-  base::AtExitManager::RegisterCallback(&IncrementTestCounter1, NULL);
-  base::AtExitManager::RegisterCallback(&ExpectCounter1IsZero, NULL);
-  base::AtExitManager::RegisterCallback(&IncrementTestCounter2, NULL);
-
-  EXPECT_EQ(0, g_test_counter_1);
-  EXPECT_EQ(0, g_test_counter_2);
-  base::AtExitManager::ProcessCallbacksNow();
-  EXPECT_EQ(1, g_test_counter_1);
-  EXPECT_EQ(1, g_test_counter_2);
-}
-
-TEST(AtExitTest, Param) {
-  ShadowingAtExitManager shadowing_at_exit_manager;
-
-  base::AtExitManager::RegisterCallback(&ExpectParamIsNull, NULL);
-  base::AtExitManager::RegisterCallback(&ExpectParamIsCounter,
-                                        &g_test_counter_1);
-  base::AtExitManager::ProcessCallbacksNow();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/atomicops_unittest.cc
+++ /dev/null
@@ -1,237 +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 "base/atomicops.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-template <class AtomicType>
-static void TestAtomicIncrement() {
-  // For now, we just test single threaded execution
-
-  // use a guard value to make sure the NoBarrier_AtomicIncrement doesn't go
-  // outside the expected address bounds.  This is in particular to
-  // test that some future change to the asm code doesn't cause the
-  // 32-bit NoBarrier_AtomicIncrement doesn't do the wrong thing on 64-bit
-  // machines.
-  struct {
-    AtomicType prev_word;
-    AtomicType count;
-    AtomicType next_word;
-  } s;
-
-  AtomicType prev_word_value, next_word_value;
-  memset(&prev_word_value, 0xFF, sizeof(AtomicType));
-  memset(&next_word_value, 0xEE, sizeof(AtomicType));
-
-  s.prev_word = prev_word_value;
-  s.count = 0;
-  s.next_word = next_word_value;
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 1), 1);
-  EXPECT_EQ(s.count, 1);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 2), 3);
-  EXPECT_EQ(s.count, 3);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 3), 6);
-  EXPECT_EQ(s.count, 6);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -3), 3);
-  EXPECT_EQ(s.count, 3);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -2), 1);
-  EXPECT_EQ(s.count, 1);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -1), 0);
-  EXPECT_EQ(s.count, 0);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -1), -1);
-  EXPECT_EQ(s.count, -1);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, -4), -5);
-  EXPECT_EQ(s.count, -5);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-
-  EXPECT_EQ(base::subtle::NoBarrier_AtomicIncrement(&s.count, 5), 0);
-  EXPECT_EQ(s.count, 0);
-  EXPECT_EQ(s.prev_word, prev_word_value);
-  EXPECT_EQ(s.next_word, next_word_value);
-}
-
-
-#define NUM_BITS(T) (sizeof(T) * 8)
-
-
-template <class AtomicType>
-static void TestCompareAndSwap() {
-  AtomicType value = 0;
-  AtomicType prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 1);
-  EXPECT_EQ(1, value);
-  EXPECT_EQ(0, prev);
-
-  // Use test value that has non-zero bits in both halves, more for testing
-  // 64-bit implementation on 32-bit platforms.
-  const AtomicType k_test_val = (GG_ULONGLONG(1) <<
-                                 (NUM_BITS(AtomicType) - 2)) + 11;
-  value = k_test_val;
-  prev = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 5);
-  EXPECT_EQ(k_test_val, value);
-  EXPECT_EQ(k_test_val, prev);
-
-  value = k_test_val;
-  prev = base::subtle::NoBarrier_CompareAndSwap(&value, k_test_val, 5);
-  EXPECT_EQ(5, value);
-  EXPECT_EQ(k_test_val, prev);
-}
-
-
-template <class AtomicType>
-static void TestAtomicExchange() {
-  AtomicType value = 0;
-  AtomicType new_value = base::subtle::NoBarrier_AtomicExchange(&value, 1);
-  EXPECT_EQ(1, value);
-  EXPECT_EQ(0, new_value);
-
-  // Use test value that has non-zero bits in both halves, more for testing
-  // 64-bit implementation on 32-bit platforms.
-  const AtomicType k_test_val = (GG_ULONGLONG(1) <<
-                                 (NUM_BITS(AtomicType) - 2)) + 11;
-  value = k_test_val;
-  new_value = base::subtle::NoBarrier_AtomicExchange(&value, k_test_val);
-  EXPECT_EQ(k_test_val, value);
-  EXPECT_EQ(k_test_val, new_value);
-
-  value = k_test_val;
-  new_value = base::subtle::NoBarrier_AtomicExchange(&value, 5);
-  EXPECT_EQ(5, value);
-  EXPECT_EQ(k_test_val, new_value);
-}
-
-
-template <class AtomicType>
-static void TestAtomicIncrementBounds() {
-  // Test at rollover boundary between int_max and int_min
-  AtomicType test_val = (GG_ULONGLONG(1) <<
-                         (NUM_BITS(AtomicType) - 1));
-  AtomicType value = -1 ^ test_val;
-  AtomicType new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
-  EXPECT_EQ(test_val, value);
-  EXPECT_EQ(value, new_value);
-
-  base::subtle::NoBarrier_AtomicIncrement(&value, -1);
-  EXPECT_EQ(-1 ^ test_val, value);
-
-  // Test at 32-bit boundary for 64-bit atomic type.
-  test_val = GG_ULONGLONG(1) << (NUM_BITS(AtomicType) / 2);
-  value = test_val - 1;
-  new_value = base::subtle::NoBarrier_AtomicIncrement(&value, 1);
-  EXPECT_EQ(test_val, value);
-  EXPECT_EQ(value, new_value);
-
-  base::subtle::NoBarrier_AtomicIncrement(&value, -1);
-  EXPECT_EQ(test_val - 1, value);
-}
-
-// Return an AtomicType with the value 0xa5a5a5..
-template <class AtomicType>
-static AtomicType TestFillValue() {
-  AtomicType val = 0;
-  memset(&val, 0xa5, sizeof(AtomicType));
-  return val;
-}
-
-// This is a simple sanity check that values are correct. Not testing
-// atomicity
-template <class AtomicType>
-static void TestStore() {
-  const AtomicType kVal1 = TestFillValue<AtomicType>();
-  const AtomicType kVal2 = static_cast<AtomicType>(-1);
-
-  AtomicType value;
-
-  base::subtle::NoBarrier_Store(&value, kVal1);
-  EXPECT_EQ(kVal1, value);
-  base::subtle::NoBarrier_Store(&value, kVal2);
-  EXPECT_EQ(kVal2, value);
-
-  base::subtle::Acquire_Store(&value, kVal1);
-  EXPECT_EQ(kVal1, value);
-  base::subtle::Acquire_Store(&value, kVal2);
-  EXPECT_EQ(kVal2, value);
-
-  base::subtle::Release_Store(&value, kVal1);
-  EXPECT_EQ(kVal1, value);
-  base::subtle::Release_Store(&value, kVal2);
-  EXPECT_EQ(kVal2, value);
-}
-
-// This is a simple sanity check that values are correct. Not testing
-// atomicity
-template <class AtomicType>
-static void TestLoad() {
-  const AtomicType kVal1 = TestFillValue<AtomicType>();
-  const AtomicType kVal2 = static_cast<AtomicType>(-1);
-
-  AtomicType value;
-
-  value = kVal1;
-  EXPECT_EQ(kVal1, base::subtle::NoBarrier_Load(&value));
-  value = kVal2;
-  EXPECT_EQ(kVal2, base::subtle::NoBarrier_Load(&value));
-
-  value = kVal1;
-  EXPECT_EQ(kVal1, base::subtle::Acquire_Load(&value));
-  value = kVal2;
-  EXPECT_EQ(kVal2, base::subtle::Acquire_Load(&value));
-
-  value = kVal1;
-  EXPECT_EQ(kVal1, base::subtle::Release_Load(&value));
-  value = kVal2;
-  EXPECT_EQ(kVal2, base::subtle::Release_Load(&value));
-}
-
-TEST(AtomicOpsTest, Inc) {
-  TestAtomicIncrement<base::subtle::Atomic32>();
-  TestAtomicIncrement<base::subtle::AtomicWord>();
-}
-
-TEST(AtomicOpsTest, CompareAndSwap) {
-  TestCompareAndSwap<base::subtle::Atomic32>();
-  TestCompareAndSwap<base::subtle::AtomicWord>();
-}
-
-TEST(AtomicOpsTest, Exchange) {
-  TestAtomicExchange<base::subtle::Atomic32>();
-  TestAtomicExchange<base::subtle::AtomicWord>();
-}
-
-TEST(AtomicOpsTest, IncrementBounds) {
-  TestAtomicIncrementBounds<base::subtle::Atomic32>();
-  TestAtomicIncrementBounds<base::subtle::AtomicWord>();
-}
-
-TEST(AtomicOpsTest, Store) {
-  TestStore<base::subtle::Atomic32>();
-  TestStore<base::subtle::AtomicWord>();
-}
-
-TEST(AtomicOpsTest, Load) {
-  TestLoad<base::subtle::Atomic32>();
-  TestLoad<base::subtle::AtomicWord>();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/command_line_unittest.cc
+++ /dev/null
@@ -1,128 +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 <string>
-#include <vector>
-
-#include "base/command_line.h"
-#include "base/basictypes.h"
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(CommandLineTest, CommandLineConstructor) {
-#if defined(OS_WIN)
-  CommandLine cl(L"");
-  cl.ParseFromString(L"program --foo= -bAr  /Spaetzel=pierogi /Baz flim "
-                     L"--other-switches=\"--dog=canine --cat=feline\" "
-                     L"-spaetzle=Crepe   -=loosevalue  flan "
-                     L"--input-translation=\"45\"--output-rotation "
-                     L"-- -- --not-a-switch "
-                     L"\"in the time of submarines...\"");
-  EXPECT_FALSE(cl.command_line_string().empty());
-#elif defined(OS_POSIX)
-  const char* argv[] = {"program", "--foo=", "-bar",
-                        "-spaetzel=pierogi", "-baz", "flim",
-                        "--other-switches=--dog=canine --cat=feline",
-                        "-spaetzle=Crepe", "-=loosevalue", "flan",
-                        "--input-translation=45--output-rotation",
-                        "--", "--", "--not-a-switch",
-                        "in the time of submarines..."};
-  CommandLine cl(arraysize(argv), argv);
-#endif
-  EXPECT_FALSE(cl.HasSwitch(L"cruller"));
-  EXPECT_FALSE(cl.HasSwitch(L"flim"));
-  EXPECT_FALSE(cl.HasSwitch(L"program"));
-  EXPECT_FALSE(cl.HasSwitch(L"dog"));
-  EXPECT_FALSE(cl.HasSwitch(L"cat"));
-  EXPECT_FALSE(cl.HasSwitch(L"output-rotation"));
-  EXPECT_FALSE(cl.HasSwitch(L"not-a-switch"));
-  EXPECT_FALSE(cl.HasSwitch(L"--"));
-
-  EXPECT_EQ(L"program", cl.program());
-
-  EXPECT_TRUE(cl.HasSwitch(L"foo"));
-  EXPECT_TRUE(cl.HasSwitch(L"bar"));
-  EXPECT_TRUE(cl.HasSwitch(L"baz"));
-  EXPECT_TRUE(cl.HasSwitch(L"spaetzle"));
-#if defined(OS_WIN)
-  EXPECT_TRUE(cl.HasSwitch(L"SPAETZLE"));
-#endif
-  EXPECT_TRUE(cl.HasSwitch(L"other-switches"));
-  EXPECT_TRUE(cl.HasSwitch(L"input-translation"));
-
-  EXPECT_EQ(L"Crepe", cl.GetSwitchValue(L"spaetzle"));
-  EXPECT_EQ(L"", cl.GetSwitchValue(L"Foo"));
-  EXPECT_EQ(L"", cl.GetSwitchValue(L"bar"));
-  EXPECT_EQ(L"", cl.GetSwitchValue(L"cruller"));
-  EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue(L"other-switches"));
-  EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue(L"input-translation"));
-
-  std::vector<std::wstring> loose_values = cl.GetLooseValues();
-  ASSERT_EQ(5U, loose_values.size());
-
-  std::vector<std::wstring>::const_iterator iter = loose_values.begin();
-  EXPECT_EQ(L"flim", *iter);
-  ++iter;
-  EXPECT_EQ(L"flan", *iter);
-  ++iter;
-  EXPECT_EQ(L"--", *iter);
-  ++iter;
-  EXPECT_EQ(L"--not-a-switch", *iter);
-  ++iter;
-  EXPECT_EQ(L"in the time of submarines...", *iter);
-  ++iter;
-  EXPECT_TRUE(iter == loose_values.end());
-#if defined(OS_POSIX)
-  const std::vector<std::string>& argvec = cl.argv();
-
-  for (size_t i = 0; i < argvec.size(); i++) {
-    EXPECT_EQ(0, argvec[i].compare(argv[i]));
-  }
-#endif
-}
-
-// Tests behavior with an empty input string.
-TEST(CommandLineTest, EmptyString) {
-#if defined(OS_WIN)
-  CommandLine cl(L"");
-  EXPECT_TRUE(cl.command_line_string().empty());
-  EXPECT_TRUE(cl.program().empty());
-#elif defined(OS_POSIX)
-  CommandLine cl(0, NULL);
-  EXPECT_TRUE(cl.argv().size() == 0);
-#endif
-  EXPECT_EQ(0U, cl.GetLooseValues().size());
-}
-
-// Test methods for appending switches to a command line.
-TEST(CommandLineTest, AppendSwitches) {
-  std::wstring switch1 = L"switch1";
-  std::wstring switch2 = L"switch2";
-  std::wstring value = L"value";
-  std::wstring switch3 = L"switch3";
-  std::wstring value3 = L"a value with spaces";
-  std::wstring switch4 = L"switch4";
-  std::wstring value4 = L"\"a value with quotes\"";
-
-#if defined(OS_WIN)
-  CommandLine cl(L"Program");
-#elif defined(OS_POSIX)
-  std::vector<std::string> argv;
-  argv.push_back(std::string("Program"));
-  CommandLine cl(argv);
-#endif
-
-  cl.AppendSwitch(switch1);
-  cl.AppendSwitchWithValue(switch2, value);
-  cl.AppendSwitchWithValue(switch3, value3);
-  cl.AppendSwitchWithValue(switch4, value4);
-
-  EXPECT_TRUE(cl.HasSwitch(switch1));
-  EXPECT_TRUE(cl.HasSwitch(switch2));
-  EXPECT_EQ(value, cl.GetSwitchValue(switch2));
-  EXPECT_TRUE(cl.HasSwitch(switch3));
-  EXPECT_EQ(value3, cl.GetSwitchValue(switch3));
-  EXPECT_TRUE(cl.HasSwitch(switch4));
-  EXPECT_EQ(value4, cl.GetSwitchValue(switch4));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/condition_variable_unittest.cc
+++ /dev/null
@@ -1,738 +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.
-
-// Multi-threaded tests of ConditionVariable class.
-
-#include <time.h>
-#include <algorithm>
-#include <vector>
-
-#include "base/condition_variable.h"
-#include "base/logging.h"
-#include "base/platform_thread.h"
-#include "base/scoped_ptr.h"
-#include "base/spin_wait.h"
-#include "base/thread_collision_warner.h"
-#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
-
-using base::TimeDelta;
-using base::TimeTicks;
-
-namespace {
-//------------------------------------------------------------------------------
-// Define our test class, with several common variables.
-//------------------------------------------------------------------------------
-
-class ConditionVariableTest : public PlatformTest {
- public:
-  const TimeDelta kZeroMs;
-  const TimeDelta kTenMs;
-  const TimeDelta kThirtyMs;
-  const TimeDelta kFortyFiveMs;
-  const TimeDelta kSixtyMs;
-  const TimeDelta kOneHundredMs;
-
-  explicit ConditionVariableTest()
-    : kZeroMs(TimeDelta::FromMilliseconds(0)),
-      kTenMs(TimeDelta::FromMilliseconds(10)),
-      kThirtyMs(TimeDelta::FromMilliseconds(30)),
-      kFortyFiveMs(TimeDelta::FromMilliseconds(45)),
-      kSixtyMs(TimeDelta::FromMilliseconds(60)),
-      kOneHundredMs(TimeDelta::FromMilliseconds(100)) {
-  }
-};
-
-//------------------------------------------------------------------------------
-// Define a class that will control activities an several multi-threaded tests.
-// The general structure of multi-threaded tests is that a test case will
-// construct an instance of a WorkQueue.  The WorkQueue will spin up some
-// threads and control them throughout their lifetime, as well as maintaining
-// a central repository of the work thread's activity.  Finally, the WorkQueue
-// will command the the worker threads to terminate.  At that point, the test
-// cases will validate that the WorkQueue has records showing that the desired
-// activities were performed.
-//------------------------------------------------------------------------------
-
-// Callers are responsible for synchronizing access to the following class.
-// The WorkQueue::lock_, as accessed via WorkQueue::lock(), should be used for
-// all synchronized access.
-class WorkQueue : public PlatformThread::Delegate {
- public:
-  explicit WorkQueue(int thread_count);
-  ~WorkQueue();
-
-  // PlatformThread::Delegate interface.
-  void ThreadMain();
-
-  //----------------------------------------------------------------------------
-  // Worker threads only call the following methods.
-  // They should use the lock to get exclusive access.
-  int GetThreadId();  // Get an ID assigned to a thread..
-  bool EveryIdWasAllocated() const;  // Indicates that all IDs were handed out.
-  TimeDelta GetAnAssignment(int thread_id);  // Get a work task duration.
-  void WorkIsCompleted(int thread_id);
-
-  int task_count() const;
-  bool allow_help_requests() const;  // Workers can signal more workers.
-  bool shutdown() const;  // Check if shutdown has been requested.
-
-  void thread_shutting_down();
-
-
-  //----------------------------------------------------------------------------
-  // Worker threads can call them but not needed to acquire a lock.
-  Lock* lock();
-
-  ConditionVariable* work_is_available();
-  ConditionVariable* all_threads_have_ids();
-  ConditionVariable* no_more_tasks();
-
-  //----------------------------------------------------------------------------
-  // The rest of the methods are for use by the controlling master thread (the
-  // test case code).
-  void ResetHistory();
-  int GetMinCompletionsByWorkerThread() const;
-  int GetMaxCompletionsByWorkerThread() const;
-  int GetNumThreadsTakingAssignments() const;
-  int GetNumThreadsCompletingTasks() const;
-  int GetNumberOfCompletedTasks() const;
-  TimeDelta GetWorkTime() const;
-
-  void SetWorkTime(TimeDelta delay);
-  void SetTaskCount(int count);
-  void SetAllowHelp(bool allow);
-
-  // Caller must acquire lock before calling.
-  void SetShutdown();
-
-  // Compares the |shutdown_task_count_| to the |thread_count| and returns true
-  // if they are equal.  This check will acquire the |lock_| so the caller
-  // should not hold the lock when calling this method.
-  bool ThreadSafeCheckShutdown(int thread_count);
-
- private:
-  // Both worker threads and controller use the following to synchronize.
-  Lock lock_;
-  ConditionVariable work_is_available_;  // To tell threads there is work.
-
-  // Conditions to notify the controlling process (if it is interested).
-  ConditionVariable all_threads_have_ids_;  // All threads are running.
-  ConditionVariable no_more_tasks_;  // Task count is zero.
-
-  const int thread_count_;
-  scoped_array<PlatformThreadHandle> thread_handles_;
-  std::vector<int> assignment_history_;  // Number of assignment per worker.
-  std::vector<int> completion_history_;  // Number of completions per worker.
-  int thread_started_counter_;  // Used to issue unique id to workers.
-  int shutdown_task_count_;  // Number of tasks told to shutdown
-  int task_count_;  // Number of assignment tasks waiting to be processed.
-  TimeDelta worker_delay_;  // Time each task takes to complete.
-  bool allow_help_requests_;  // Workers can signal more workers.
-  bool shutdown_;  // Set when threads need to terminate.
-
-  DFAKE_MUTEX(locked_methods_)
-};
-
-//------------------------------------------------------------------------------
-// The next section contains the actual tests.
-//------------------------------------------------------------------------------
-
-TEST_F(ConditionVariableTest, StartupShutdownTest) {
-  Lock lock;
-
-  // First try trivial startup/shutdown.
-  {
-    ConditionVariable cv1(&lock);
-  }  // Call for cv1 destruction.
-
-  // Exercise with at least a few waits.
-  ConditionVariable cv(&lock);
-
-  lock.Acquire();
-  cv.TimedWait(kTenMs);  // Wait for 10 ms.
-  cv.TimedWait(kTenMs);  // Wait for 10 ms.
-  lock.Release();
-
-  lock.Acquire();
-  cv.TimedWait(kTenMs);  // Wait for 10 ms.
-  cv.TimedWait(kTenMs);  // Wait for 10 ms.
-  cv.TimedWait(kTenMs);  // Wait for 10 ms.
-  lock.Release();
-}  // Call for cv destruction.
-
-TEST_F(ConditionVariableTest, TimeoutTest) {
-  Lock lock;
-  ConditionVariable cv(&lock);
-  lock.Acquire();
-
-  TimeTicks start = TimeTicks::Now();
-  const TimeDelta WAIT_TIME = TimeDelta::FromMilliseconds(300);
-  // Allow for clocking rate granularity.
-  const TimeDelta FUDGE_TIME = TimeDelta::FromMilliseconds(50);
-
-  cv.TimedWait(WAIT_TIME + FUDGE_TIME);
-  TimeDelta duration = TimeTicks::Now() - start;
-  // We can't use EXPECT_GE here as the TimeDelta class does not support the
-  // required stream conversion.
-  EXPECT_TRUE(duration >= WAIT_TIME);
-
-  lock.Release();
-}
-
-// Test serial task servicing, as well as two parallel task servicing methods.
-// TODO(maruel): http://crbug.com/10607
-TEST_F(ConditionVariableTest, DISABLED_MultiThreadConsumerTest) {
-  const int kThreadCount = 10;
-  WorkQueue queue(kThreadCount);  // Start the threads.
-
-  const int kTaskCount = 10;  // Number of tasks in each mini-test here.
-
-  base::Time start_time;  // Used to time task processing.
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    while (!queue.EveryIdWasAllocated())
-      queue.all_threads_have_ids()->Wait();
-  }
-
-  // Wait a bit more to allow threads to reach their wait state.
-  // If threads aren't in a wait state, they may start to gobble up tasks in
-  // parallel, short-circuiting (breaking) this test.
-  PlatformThread::Sleep(100);
-
-  {
-    // Since we have no tasks yet, all threads should be waiting by now.
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(0, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(0, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(0, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make one worker do 30ms tasks sequentially.
-    queue.ResetHistory();
-    queue.SetTaskCount(kTaskCount);
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(false);
-
-    start_time = base::Time::Now();
-  }
-
-  queue.work_is_available()->Signal();  // Start up one thread.
-
-
-  {
-    // Wait until all 10 work tasks have at least been assigned.
-    AutoLock auto_lock(*queue.lock());
-    while(queue.task_count())
-      queue.no_more_tasks()->Wait();
-    // The last of the tasks *might* still be running, but... all but one should
-    // be done by now, since tasks are being done serially.
-    EXPECT_LE(queue.GetWorkTime().InMilliseconds() * (kTaskCount - 1),
-              (base::Time::Now() - start_time).InMilliseconds());
-
-    EXPECT_EQ(1, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(1, queue.GetNumThreadsCompletingTasks());
-    EXPECT_LE(kTaskCount - 1, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_LE(kTaskCount - 1, queue.GetNumberOfCompletedTasks());
-  }
-
-  // Wait to be sure all tasks are done.
-  while (1) {
-    {
-      AutoLock auto_lock(*queue.lock());
-      if (kTaskCount == queue.GetNumberOfCompletedTasks())
-        break;
-    }
-    PlatformThread::Sleep(30);  // Wait a little.
-  }
-
-  {
-    // Check that all work was done by one thread id.
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(1, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(1, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(kTaskCount, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(kTaskCount, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make each task include getting help from another worker, so
-    // so that the work gets done in paralell.
-    queue.ResetHistory();
-    queue.SetTaskCount(kTaskCount);
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(true);
-
-    start_time = base::Time::Now();
-  }
-
-  queue.work_is_available()->Signal();  // But each worker can signal another.
-  // Wait to allow the all workers to get done.
-  while (1) {
-    {
-      AutoLock auto_lock(*queue.lock());
-      if (kTaskCount == queue.GetNumberOfCompletedTasks())
-        break;
-    }
-    PlatformThread::Sleep(30);  // Wait a little.
-  }
-
-  {
-    // Wait until all work tasks have at least been assigned.
-    AutoLock auto_lock(*queue.lock());
-    while(queue.task_count())
-      queue.no_more_tasks()->Wait();
-    // Since they can all run almost in parallel, there is no guarantee that all
-    // tasks are finished, but we should have gotten here faster than it would
-    // take to run all tasks serially.
-    EXPECT_GT(queue.GetWorkTime().InMilliseconds() * (kTaskCount - 1),
-              (base::Time::Now() - start_time).InMilliseconds());
-
-    // To avoid racy assumptions, we'll just assert that at least 2 threads
-    // did work.
-    EXPECT_LE(2, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(kTaskCount, queue.GetNumberOfCompletedTasks());
-
-    // Try to ask all workers to help, and only a few will do the work.
-    queue.ResetHistory();
-    queue.SetTaskCount(3);
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(false);
-  }
-  queue.work_is_available()->Broadcast();  // Make them all try.
-  // Wait to allow the 3 workers to get done.
-  PlatformThread::Sleep(45);
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(3, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(3, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(1, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(3, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make each task get help from another worker.
-    queue.ResetHistory();
-    queue.SetTaskCount(3);
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(true);  // Allow (unnecessary) help requests.
-  }
-  queue.work_is_available()->Broadcast();  // We already signal all threads.
-  // Wait to allow the 3 workers to get done.
-  PlatformThread::Sleep(100);
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(3, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(3, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(1, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(3, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make each task get help from another worker.
-    queue.ResetHistory();
-    queue.SetTaskCount(20);
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(true);
-  }
-  queue.work_is_available()->Signal();  // But each worker can signal another.
-  // Wait to allow the 10 workers to get done.
-  PlatformThread::Sleep(100);  // Should take about 60 ms.
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(10, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(10, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(2, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(2, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(20, queue.GetNumberOfCompletedTasks());
-
-    // Same as last test, but with Broadcast().
-    queue.ResetHistory();
-    queue.SetTaskCount(20);  // 2 tasks per process.
-    queue.SetWorkTime(kThirtyMs);
-    queue.SetAllowHelp(true);
-  }
-  queue.work_is_available()->Broadcast();
-  // Wait to allow the 10 workers to get done.
-  PlatformThread::Sleep(100);  // Should take about 60 ms.
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(10, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(10, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(2, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(2, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(20, queue.GetNumberOfCompletedTasks());
-
-    queue.SetShutdown();
-  }
-  queue.work_is_available()->Broadcast();  // Force check for shutdown.
-
-  SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(1),
-                                   queue.ThreadSafeCheckShutdown(kThreadCount));
-  PlatformThread::Sleep(10);  // Be sure they're all shutdown.
-}
-
-TEST_F(ConditionVariableTest, LargeFastTaskTest) {
-  const int kThreadCount = 200;
-  WorkQueue queue(kThreadCount);  // Start the threads.
-
-  Lock private_lock;  // Used locally for master to wait.
-  AutoLock private_held_lock(private_lock);
-  ConditionVariable private_cv(&private_lock);
-
-  {
-    AutoLock auto_lock(*queue.lock());
-    while (!queue.EveryIdWasAllocated())
-      queue.all_threads_have_ids()->Wait();
-  }
-
-  // Wait a bit more to allow threads to reach their wait state.
-  private_cv.TimedWait(kThirtyMs);
-
-  {
-    // Since we have no tasks, all threads should be waiting by now.
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(0, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(0, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_EQ(0, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetMinCompletionsByWorkerThread());
-    EXPECT_EQ(0, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make all workers do (an average of) 20 tasks.
-    queue.ResetHistory();
-    queue.SetTaskCount(20 * kThreadCount);
-    queue.SetWorkTime(kFortyFiveMs);
-    queue.SetAllowHelp(false);
-  }
-  queue.work_is_available()->Broadcast();  // Start up all threads.
-  // Wait until we've handed out all tasks.
-  {
-    AutoLock auto_lock(*queue.lock());
-    while (queue.task_count() != 0)
-      queue.no_more_tasks()->Wait();
-  }
-
-  // Wait till the last of the tasks complete.
-  // Don't bother to use locks: We may not get info in time... but we'll see it
-  // eventually.
-  SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(1),
-                                    20 * kThreadCount ==
-                                      queue.GetNumberOfCompletedTasks());
-
-  {
-    // With Broadcast(), every thread should have participated.
-    // but with racing.. they may not all have done equal numbers of tasks.
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(kThreadCount, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(kThreadCount, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_LE(20, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(20 * kThreadCount, queue.GetNumberOfCompletedTasks());
-
-    // Set up to make all workers do (an average of) 4 tasks.
-    queue.ResetHistory();
-    queue.SetTaskCount(kThreadCount * 4);
-    queue.SetWorkTime(kFortyFiveMs);
-    queue.SetAllowHelp(true);  // Might outperform Broadcast().
-  }
-  queue.work_is_available()->Signal();  // Start up one thread.
-
-  // Wait until we've handed out all tasks
-  {
-    AutoLock auto_lock(*queue.lock());
-    while (queue.task_count() != 0)
-      queue.no_more_tasks()->Wait();
-  }
-
-  // Wait till the last of the tasks complete.
-  // Don't bother to use locks: We may not get info in time... but we'll see it
-  // eventually.
-  SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(1),
-                                    4 * kThreadCount ==
-                                      queue.GetNumberOfCompletedTasks());
-
-  {
-    // With Signal(), every thread should have participated.
-    // but with racing.. they may not all have done four tasks.
-    AutoLock auto_lock(*queue.lock());
-    EXPECT_EQ(kThreadCount, queue.GetNumThreadsTakingAssignments());
-    EXPECT_EQ(kThreadCount, queue.GetNumThreadsCompletingTasks());
-    EXPECT_EQ(0, queue.task_count());
-    EXPECT_LE(4, queue.GetMaxCompletionsByWorkerThread());
-    EXPECT_EQ(4 * kThreadCount, queue.GetNumberOfCompletedTasks());
-
-    queue.SetShutdown();
-  }
-  queue.work_is_available()->Broadcast();  // Force check for shutdown.
-
-  // Wait for shutdowns to complete.
-  SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(1),
-                                   queue.ThreadSafeCheckShutdown(kThreadCount));
-  PlatformThread::Sleep(10);  // Be sure they're all shutdown.
-}
-
-//------------------------------------------------------------------------------
-// Finally we provide the implementation for the methods in the WorkQueue class.
-//------------------------------------------------------------------------------
-
-WorkQueue::WorkQueue(int thread_count)
-  : lock_(),
-    work_is_available_(&lock_),
-    all_threads_have_ids_(&lock_),
-    no_more_tasks_(&lock_),
-    thread_count_(thread_count),
-    thread_handles_(new PlatformThreadHandle[thread_count]),
-    assignment_history_(thread_count),
-    completion_history_(thread_count),
-    thread_started_counter_(0),
-    shutdown_task_count_(0),
-    task_count_(0),
-    allow_help_requests_(false),
-    shutdown_(false) {
-  EXPECT_GE(thread_count_, 1);
-  ResetHistory();
-  SetTaskCount(0);
-  SetWorkTime(TimeDelta::FromMilliseconds(30));
-
-  for (int i = 0; i < thread_count_; ++i) {
-    PlatformThreadHandle pth;
-    EXPECT_TRUE(PlatformThread::Create(0, this, &pth));
-    thread_handles_[i] = pth;
-  }
-}
-
-WorkQueue::~WorkQueue() {
-  {
-    AutoLock auto_lock(lock_);
-    SetShutdown();
-  }
-  work_is_available_.Broadcast();  // Tell them all to terminate.
-
-  for (int i = 0; i < thread_count_; ++i) {
-    PlatformThread::Join(thread_handles_[i]);
-  }
-}
-
-int WorkQueue::GetThreadId() {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  DCHECK(!EveryIdWasAllocated());
-  return thread_started_counter_++;  // Give out Unique IDs.
-}
-
-bool WorkQueue::EveryIdWasAllocated() const {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  return thread_count_ == thread_started_counter_;
-}
-
-TimeDelta WorkQueue::GetAnAssignment(int thread_id) {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  DCHECK_LT(0, task_count_);
-  assignment_history_[thread_id]++;
-  if (0 == --task_count_) {
-    no_more_tasks_.Signal();
-  }
-  return worker_delay_;
-}
-
-void WorkQueue::WorkIsCompleted(int thread_id) {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  completion_history_[thread_id]++;
-}
-
-int WorkQueue::task_count() const {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  return task_count_;
-}
-
-bool WorkQueue::allow_help_requests() const {
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  return allow_help_requests_;
-}
-
-bool WorkQueue::shutdown() const {
-  lock_.AssertAcquired();
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  return shutdown_;
-}
-
-// Because this method is called from the test's main thread we need to actually
-// take the lock.  Threads will call the thread_shutting_down() method with the
-// lock already acquired.
-bool WorkQueue::ThreadSafeCheckShutdown(int thread_count) {
-  bool all_shutdown;
-  AutoLock auto_lock(lock_);
-  {
-    // Declare in scope so DFAKE is guranteed to be destroyed before AutoLock.
-    DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-    all_shutdown = (shutdown_task_count_ == thread_count);
-  }
-  return all_shutdown;
-}
-
-void WorkQueue::thread_shutting_down() {
-  lock_.AssertAcquired();
-  DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
-  shutdown_task_count_++;
-}
-
-Lock* WorkQueue::lock() {
-  return &lock_;
-}
-
-ConditionVariable* WorkQueue::work_is_available() {
-  return &work_is_available_;
-}
-
-ConditionVariable* WorkQueue::all_threads_have_ids() {
-  return &all_threads_have_ids_;
-}
-
-ConditionVariable* WorkQueue::no_more_tasks() {
-  return &no_more_tasks_;
-}
-
-void WorkQueue::ResetHistory() {
-  for (int i = 0; i < thread_count_; ++i) {
-    assignment_history_[i] = 0;
-    completion_history_[i] = 0;
-  }
-}
-
-int WorkQueue::GetMinCompletionsByWorkerThread() const {
-  int minumum = completion_history_[0];
-  for (int i = 0; i < thread_count_; ++i)
-    minumum = std::min(minumum, completion_history_[i]);
-  return minumum;
-}
-
-int WorkQueue::GetMaxCompletionsByWorkerThread() const {
-  int maximum = completion_history_[0];
-  for (int i = 0; i < thread_count_; ++i)
-    maximum = std::max(maximum, completion_history_[i]);
-  return maximum;
-}
-
-int WorkQueue::GetNumThreadsTakingAssignments() const {
-  int count = 0;
-  for (int i = 0; i < thread_count_; ++i)
-    if (assignment_history_[i])
-      count++;
-  return count;
-}
-
-int WorkQueue::GetNumThreadsCompletingTasks() const {
-  int count = 0;
-  for (int i = 0; i < thread_count_; ++i)
-    if (completion_history_[i])
-      count++;
-  return count;
-}
-
-int WorkQueue::GetNumberOfCompletedTasks() const {
-  int total = 0;
-  for (int i = 0; i < thread_count_; ++i)
-    total += completion_history_[i];
-  return total;
-}
-
-TimeDelta WorkQueue::GetWorkTime() const {
-  return worker_delay_;
-}
-
-void WorkQueue::SetWorkTime(TimeDelta delay) {
-  worker_delay_ = delay;
-}
-
-void WorkQueue::SetTaskCount(int count) {
-  task_count_ = count;
-}
-
-void WorkQueue::SetAllowHelp(bool allow) {
-  allow_help_requests_ = allow;
-}
-
-void WorkQueue::SetShutdown() {
-  lock_.AssertAcquired();
-  shutdown_ = true;
-}
-
-//------------------------------------------------------------------------------
-// Define the standard worker task. Several tests will spin out many of these
-// threads.
-//------------------------------------------------------------------------------
-
-// The multithread tests involve several threads with a task to perform as
-// directed by an instance of the class WorkQueue.
-// The task is to:
-// a) Check to see if there are more tasks (there is a task counter).
-//    a1) Wait on condition variable if there are no tasks currently.
-// b) Call a function to see what should be done.
-// c) Do some computation based on the number of milliseconds returned in (b).
-// d) go back to (a).
-
-// WorkQueue::ThreadMain() implements the above task for all threads.
-// It calls the controlling object to tell the creator about progress, and to
-// ask about tasks.
-
-void WorkQueue::ThreadMain() {
-  int thread_id;
-  {
-    AutoLock auto_lock(lock_);
-    thread_id = GetThreadId();
-    if (EveryIdWasAllocated())
-      all_threads_have_ids()->Signal();  // Tell creator we're ready.
-  }
-
-  Lock private_lock;  // Used to waste time on "our work".
-  while (1) {  // This is the main consumer loop.
-    TimeDelta work_time;
-    bool could_use_help;
-    {
-      AutoLock auto_lock(lock_);
-      while (0 == task_count() && !shutdown()) {
-        work_is_available()->Wait();
-      }
-      if (shutdown()) {
-        // Ack the notification of a shutdown message back to the controller.
-        thread_shutting_down();
-        return;  // Terminate.
-      }
-      // Get our task duration from the queue.
-      work_time = GetAnAssignment(thread_id);
-      could_use_help = (task_count() > 0) && allow_help_requests();
-    }  // Release lock
-
-    // Do work (outside of locked region.
-    if (could_use_help)
-      work_is_available()->Signal();  // Get help from other threads.
-
-    if (work_time > TimeDelta::FromMilliseconds(0)) {
-      // We could just sleep(), but we'll instead further exercise the
-      // condition variable class, and do a timed wait.
-      AutoLock auto_lock(private_lock);
-      ConditionVariable private_cv(&private_lock);
-      private_cv.TimedWait(work_time);  // Unsynchronized waiting.
-    }
-
-    {
-      AutoLock auto_lock(lock_);
-      // Send notification that we completed our "work."
-      WorkIsCompleted(thread_id);
-    }
-  }
-}
-
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/data_pack_unittest.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 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 "base/data_pack.h"
-
-#include "base/file_path.h"
-#include "base/path_service.h"
-#include "base/string_piece.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-class DataPackTest : public testing::Test {
- public:
-  DataPackTest() {
-    PathService::Get(base::DIR_SOURCE_ROOT, &data_path_);
-    data_path_ = data_path_.Append(
-        FILE_PATH_LITERAL("base/data/data_pack_unittest/sample.pak"));
-  }
-
-  FilePath data_path_;
-};
-
-TEST_F(DataPackTest, Load) {
-  base::DataPack pack;
-  ASSERT_TRUE(pack.Load(data_path_));
-
-  StringPiece data;
-  ASSERT_TRUE(pack.Get(4, &data));
-  EXPECT_EQ("this is id 4", data);
-  ASSERT_TRUE(pack.Get(6, &data));
-  EXPECT_EQ("this is id 6", data);
-
-  // Try reading zero-length data blobs, just in case.
-  ASSERT_TRUE(pack.Get(1, &data));
-  EXPECT_EQ(0U, data.length());
-  ASSERT_TRUE(pack.Get(10, &data));
-  EXPECT_EQ(0U, data.length());
-
-  // Try looking up an invalid key.
-  ASSERT_FALSE(pack.Get(140, &data));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/debug_util_unittest.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2006-2009 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 <sstream>
-#include <string>
-
-#include "base/debug_util.h"
-#include "base/logging.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(StackTrace, OutputToStream) {
-  StackTrace trace;
-
-  // Dump the trace into a string.
-  std::ostringstream os;
-  trace.OutputToStream(&os);
-  std::string backtrace_message = os.str();
-
-  size_t frames_found = 0;
-  trace.Addresses(&frames_found);
-  if (frames_found == 0) {
-    LOG(ERROR) << "No stack frames found.  Skipping rest of test.";
-    return;
-  }
-
-  // Check if the output has symbol initialization warning.  If it does, fail.
-  if (backtrace_message.find("Dumping unresolved backtrace") != 
-      std::string::npos) {
-    LOG(ERROR) << "Unable to resolve symbols.  Skipping rest of test.";
-    return;
-  }
-
-#if 0
-//TODO(ajwong): Disabling checking of symbol resolution since it depends
-//  on whether or not symbols are present, and there are too many
-//  configurations to reliably ensure that symbols are findable.
-#if defined(OS_MACOSX)
-
-  // Symbol resolution via the backtrace_symbol funciton does not work well
-  // in OsX.
-  // See this thread: 
-  //
-  //    http://lists.apple.com/archives/darwin-dev/2009/Mar/msg00111.html
-  //
-  // Just check instead that we find our way back to the "start" symbol
-  // which should be the first symbol in the trace.
-  //
-  // TODO(port): Find a more reliable way to resolve symbols.
-
-  // Expect to at least find main.
-  EXPECT_TRUE(backtrace_message.find("start") != std::string::npos)
-      << "Expected to find start in backtrace:\n"
-      << backtrace_message;
-
-#else  // defined(OS_MACOSX)
-
-  // Expect to at least find main.
-  EXPECT_TRUE(backtrace_message.find("main") != std::string::npos)
-      << "Expected to find main in backtrace:\n"
-      << backtrace_message;
-
-#if defined(OS_WIN)
-// MSVC doesn't allow the use of C99's __func__ within C++, so we fake it with
-// MSVC's __FUNCTION__ macro.
-#define __func__ __FUNCTION__
-#endif
-
-  // Expect to find this function as well.
-  // Note: This will fail if not linked with -rdynamic (aka -export_dynamic)
-  EXPECT_TRUE(backtrace_message.find(__func__) != std::string::npos)
-      << "Expected to find " << __func__ << " in backtrace:\n"
-      << backtrace_message;
-
-#endif  // define(OS_MACOSX)
-#endif
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/directory_watcher_unittest.cc
+++ /dev/null
@@ -1,406 +0,0 @@
-// Copyright (c) 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 "base/directory_watcher.h"
-
-#include <limits>
-
-#include "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/message_loop.h"
-#include "base/path_service.h"
-#include "base/platform_thread.h"
-#include "base/string_util.h"
-#if defined(OS_WIN)
-#include "base/win_util.h"
-#endif  // defined(OS_WIN)
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-// For tests where we wait a bit to verify nothing happened
-const int kWaitForEventTime = 1000;
-
-class DirectoryWatcherTest : public testing::Test {
- public:
-  // Implementation of DirectoryWatcher on Mac requires UI loop.
-  DirectoryWatcherTest() : loop_(MessageLoop::TYPE_UI) {
-  }
-
-  void OnTestDelegateFirstNotification(const FilePath& path) {
-    notified_delegates_++;
-    if (notified_delegates_ >= expected_notified_delegates_)
-      MessageLoop::current()->Quit();
-  }
-
- protected:
-  virtual void SetUp() {
-    // Name a subdirectory of the temp directory.
-    FilePath path;
-    ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path));
-    test_dir_ = path.Append(FILE_PATH_LITERAL("DirectoryWatcherTest"));
-
-    // Create a fresh, empty copy of this directory.
-    file_util::Delete(test_dir_, true);
-    file_util::CreateDirectory(test_dir_);
-  }
-
-  virtual void TearDown() {
-    // Make sure there are no tasks in the loop.
-    loop_.RunAllPending();
-
-    // Clean up test directory.
-    ASSERT_TRUE(file_util::Delete(test_dir_, true));
-    ASSERT_FALSE(file_util::PathExists(test_dir_));
-  }
-
-  // Write |content| to the |filename|. Returns true on success.
-  bool WriteTestFile(const FilePath& filename,
-                     const std::string& content) {
-    return (file_util::WriteFile(filename, content.c_str(), content.length()) ==
-            static_cast<int>(content.length()));
-  }
-
-  // Create directory |name| under test_dir_. If |sync| is true, runs
-  // SyncIfPOSIX. Returns path to the created directory, including test_dir_.
-  FilePath CreateTestDirDirectoryASCII(const std::string& name, bool sync) {
-    FilePath path(test_dir_.AppendASCII(name));
-    EXPECT_TRUE(file_util::CreateDirectory(path));
-    if (sync)
-      SyncIfPOSIX();
-    return path;
-  }
-
-  void SetExpectedNumberOfNotifiedDelegates(int n) {
-    notified_delegates_ = 0;
-    expected_notified_delegates_ = n;
-  }
-
-  void VerifyExpectedNumberOfNotifiedDelegates() {
-    // Check that we get at least the expected number of notified delegates.
-    if (expected_notified_delegates_ - notified_delegates_ > 0)
-      loop_.Run();
-
-    // Check that we get no more than the expected number of notified delegates.
-    loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask,
-                          kWaitForEventTime);
-    loop_.Run();
-    EXPECT_EQ(expected_notified_delegates_, notified_delegates_);
-  }
-
-  // We need this function for reliable tests on Mac OS X. FSEvents API
-  // has a latency interval and can merge multiple events into one,
-  // and we need a clear distinction between events triggered by test setup code
-  // and test code.
-  void SyncIfPOSIX() {
-#if defined(OS_POSIX)
-    sync();
-#endif  // defined(OS_POSIX)
-  }
-
-  MessageLoop loop_;
-
-  // The path to a temporary directory used for testing.
-  FilePath test_dir_;
-
-  // The number of test delegates which received their notification.
-  int notified_delegates_;
-
-  // The number of notified test delegates after which we quit the message loop.
-  int expected_notified_delegates_;
-};
-
-class TestDelegate : public DirectoryWatcher::Delegate {
- public:
-  TestDelegate(DirectoryWatcherTest* test)
-      : test_(test),
-        got_notification_(false),
-        original_thread_id_(PlatformThread::CurrentId()) {
-  }
-
-  bool got_notification() const {
-    return got_notification_;
-  }
-
-  void reset() {
-    got_notification_ = false;
-  }
-
-  virtual void OnDirectoryChanged(const FilePath& path) {
-    EXPECT_EQ(original_thread_id_, PlatformThread::CurrentId());
-    if (!got_notification_)
-      test_->OnTestDelegateFirstNotification(path);
-    got_notification_ = true;
-  }
-
- private:
-  // Hold a pointer to current test fixture to inform it on first notification.
-  DirectoryWatcherTest* test_;
-
-  // Set to true after first notification.
-  bool got_notification_;
-
-  // Keep track of original thread id to verify that callbacks are called
-  // on the same thread.
-  PlatformThreadId original_thread_id_;
-};
-
-// Basic test: add a file and verify we notice it.
-TEST_F(DirectoryWatcherTest, NewFile) {
-  DirectoryWatcher watcher;
-  TestDelegate delegate(this);
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, false));
-
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-// Verify that modifying a file is caught.
-TEST_F(DirectoryWatcherTest, ModifiedFile) {
-  // Write a file to the test dir.
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  SyncIfPOSIX();
-
-  DirectoryWatcher watcher;
-  TestDelegate delegate(this);
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, false));
-
-  // Now make sure we get notified if the file is modified.
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "new content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, DeletedFile) {
-  // Write a file to the test dir.
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  SyncIfPOSIX();
-
-  DirectoryWatcher watcher;
-  TestDelegate delegate(this);
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, false));
-
-  // Now make sure we get notified if the file is deleted.
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(file_util::Delete(test_dir_.AppendASCII("test_file"), false));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-// Verify that letting the watcher go out of scope stops notifications.
-TEST_F(DirectoryWatcherTest, Unregister) {
-  TestDelegate delegate(this);
-
-  {
-    DirectoryWatcher watcher;
-    ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, false));
-
-    // And then let it fall out of scope, clearing its watch.
-  }
-
-  // Write a file to the test dir.
-  SetExpectedNumberOfNotifiedDelegates(0);
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, SubDirRecursive) {
-  FilePath subdir(CreateTestDirDirectoryASCII("SubDir", true));
-
-#if defined(OS_LINUX)
-  // TODO(port): Recursive watches are not implemented on Linux.
-  return;
-#endif  // !defined(OS_WIN)
-
-  // Verify that modifications to a subdirectory are noticed by recursive watch.
-  TestDelegate delegate(this);
-  DirectoryWatcher watcher;
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, true));
-  // Write a file to the subdir.
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, SubDirNonRecursive) {
-#if defined(OS_WIN)
-  // Disable this test for earlier version of Windows. It turned out to be
-  // very difficult to create a reliable test for them.
-  if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA)
-    return;
-#endif  // defined(OS_WIN)
-
-  FilePath subdir(CreateTestDirDirectoryASCII("SubDir", false));
-
-  // Create a test file before the test. On Windows we get a notification
-  // when creating a file in a subdir even with a non-recursive watch.
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content"));
-
-  SyncIfPOSIX();
-
-  // Verify that modifications to a subdirectory are not noticed
-  // by a not-recursive watch.
-  DirectoryWatcher watcher;
-  TestDelegate delegate(this);
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, false));
-
-  // Modify the test file. There should be no notifications.
-  SetExpectedNumberOfNotifiedDelegates(0);
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "other content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-namespace {
-// Used by the DeleteDuringNotify test below.
-// Deletes the DirectoryWatcher when it's notified.
-class Deleter : public DirectoryWatcher::Delegate {
- public:
-  Deleter(DirectoryWatcher* watcher, MessageLoop* loop)
-      : watcher_(watcher),
-        loop_(loop) {
-  }
-
-  virtual void OnDirectoryChanged(const FilePath& path) {
-    watcher_.reset(NULL);
-    loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask());
-  }
-
-  scoped_ptr<DirectoryWatcher> watcher_;
-  MessageLoop* loop_;
-};
-}  // anonymous namespace
-
-// Verify that deleting a watcher during the callback
-TEST_F(DirectoryWatcherTest, DeleteDuringNotify) {
-  DirectoryWatcher* watcher = new DirectoryWatcher;
-  Deleter deleter(watcher, &loop_);  // Takes ownership of watcher.
-  ASSERT_TRUE(watcher->Watch(test_dir_, &deleter, false));
-
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  loop_.Run();
-
-  // We win if we haven't crashed yet.
-  // Might as well double-check it got deleted, too.
-  ASSERT_TRUE(deleter.watcher_.get() == NULL);
-}
-
-TEST_F(DirectoryWatcherTest, MultipleWatchersSingleFile) {
-  DirectoryWatcher watcher1, watcher2;
-  TestDelegate delegate1(this), delegate2(this);
-  ASSERT_TRUE(watcher1.Watch(test_dir_, &delegate1, false));
-  ASSERT_TRUE(watcher2.Watch(test_dir_, &delegate2, false));
-
-  SetExpectedNumberOfNotifiedDelegates(2);
-  ASSERT_TRUE(WriteTestFile(test_dir_.AppendASCII("test_file"), "content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, MultipleWatchersDifferentFiles) {
-  const int kNumberOfWatchers = 5;
-  DirectoryWatcher watchers[kNumberOfWatchers];
-  TestDelegate delegates[kNumberOfWatchers] = {this, this, this, this, this};
-  FilePath subdirs[kNumberOfWatchers];
-  for (int i = 0; i < kNumberOfWatchers; i++) {
-    subdirs[i] = CreateTestDirDirectoryASCII("Dir" + IntToString(i), false);
-    ASSERT_TRUE(watchers[i].Watch(subdirs[i], &delegates[i], false));
-  }
-  for (int i = 0; i < kNumberOfWatchers; i++) {
-    // Verify that we only get modifications from one watcher (each watcher has
-    // different directory).
-
-    for (int j = 0; j < kNumberOfWatchers; j++)
-      delegates[j].reset();
-
-    // Write a file to the subdir.
-    SetExpectedNumberOfNotifiedDelegates(1);
-    ASSERT_TRUE(WriteTestFile(subdirs[i].AppendASCII("test_file"), "content"));
-    VerifyExpectedNumberOfNotifiedDelegates();
-
-    loop_.RunAllPending();
-  }
-}
-
-#if defined(OS_WIN) || defined(OS_MACOSX)
-// TODO(phajdan.jr): Enable when support for Linux recursive watches is added.
-
-TEST_F(DirectoryWatcherTest, WatchCreatedDirectory) {
-  TestDelegate delegate(this);
-  DirectoryWatcher watcher;
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, true));
-
-  SetExpectedNumberOfNotifiedDelegates(1);
-  FilePath subdir(CreateTestDirDirectoryASCII("SubDir", true));
-  // Create a file inside the subdir to force Windows to fire notifications.
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-
-  delegate.reset();
-
-  // Verify that changes inside the subdir are noticed.
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "other content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, RecursiveWatchDeletedSubdirectory) {
-  FilePath subdir(CreateTestDirDirectoryASCII("SubDir", true));
-
-  TestDelegate delegate(this);
-  DirectoryWatcher watcher;
-  ASSERT_TRUE(watcher.Watch(test_dir_, &delegate, true));
-
-  // Write a file to the subdir.
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-
-  delegate.reset();
-
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(file_util::Delete(subdir, true));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-
-TEST_F(DirectoryWatcherTest, MoveFileAcrossWatches) {
-  FilePath subdir1(CreateTestDirDirectoryASCII("SubDir1", true));
-  FilePath subdir2(CreateTestDirDirectoryASCII("SubDir2", true));
-
-  TestDelegate delegate1(this), delegate2(this);
-  DirectoryWatcher watcher1, watcher2;
-  ASSERT_TRUE(watcher1.Watch(subdir1, &delegate1, true));
-  ASSERT_TRUE(watcher2.Watch(subdir2, &delegate2, true));
-
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(subdir1.AppendASCII("file"), "some content"));
-  SyncIfPOSIX();
-  VerifyExpectedNumberOfNotifiedDelegates();
-
-  delegate1.reset();
-  delegate2.reset();
-
-  SetExpectedNumberOfNotifiedDelegates(2);
-  ASSERT_TRUE(file_util::Move(subdir1.AppendASCII("file"),
-                              subdir2.AppendASCII("file")));
-  VerifyExpectedNumberOfNotifiedDelegates();
-
-  delegate1.reset();
-  delegate2.reset();
-
-  SetExpectedNumberOfNotifiedDelegates(1);
-  ASSERT_TRUE(WriteTestFile(subdir2.AppendASCII("file"), "other content"));
-  VerifyExpectedNumberOfNotifiedDelegates();
-}
-#endif  // defined(OS_WIN) || defined(OS_MACOSX)
-
-// Verify that watching a directory that doesn't exist fails, but doesn't
-// asssert.
-// Basic test: add a file and verify we notice it.
-TEST_F(DirectoryWatcherTest, NonExistentDirectory) {
-  DirectoryWatcher watcher;
-  ASSERT_FALSE(watcher.Watch(test_dir_.AppendASCII("does-not-exist"), NULL,
-                             false));
-}
-
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/field_trial_unittest.cc
+++ /dev/null
@@ -1,116 +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.
-
-// Test of FieldTrial class
-
-#include "base/field_trial.h"
-
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-class FieldTrialTest : public testing::Test {
- public:
-  FieldTrialTest() : trial_list_() { }
-
- private:
-  FieldTrialList trial_list_;
-};
-
-// Test registration, and also check that destructors are called for trials
-// (and that Purify doesn't catch us leaking).
-TEST_F(FieldTrialTest, Registration) {
-  const char* name1 = "name 1 test";
-  const char* name2 = "name 2 test";
-  EXPECT_FALSE(FieldTrialList::Find(name1));
-  EXPECT_FALSE(FieldTrialList::Find(name2));
-
-  FieldTrial* trial1 = new FieldTrial(name1, 10);
-  EXPECT_EQ(trial1->group(), FieldTrial::kNotParticipating);
-  EXPECT_EQ(trial1->name(), name1);
-  EXPECT_EQ(trial1->group_name(), "");
-
-  trial1->AppendGroup("", 7);
-
-  EXPECT_EQ(trial1, FieldTrialList::Find(name1));
-  EXPECT_FALSE(FieldTrialList::Find(name2));
-
-  FieldTrial* trial2 = new FieldTrial(name2, 10);
-  EXPECT_EQ(trial2->group(), FieldTrial::kNotParticipating);
-  EXPECT_EQ(trial2->name(), name2);
-  EXPECT_EQ(trial2->group_name(), "");
-
-  trial2->AppendGroup("a first group", 7);
-
-  EXPECT_EQ(trial1, FieldTrialList::Find(name1));
-  EXPECT_EQ(trial2, FieldTrialList::Find(name2));
-  // Note: FieldTrialList should delete the objects at shutdown.
-}
-
-TEST_F(FieldTrialTest, AbsoluteProbabilities) {
-  char always_true[] = " always true";
-  char always_false[] = " always false";
-  for (int i = 1; i < 250; ++i) {
-    // Try lots of names, by changing the first character of the name.
-    always_true[0] = i;
-    always_false[0] = i;
-
-    FieldTrial* trial_true = new FieldTrial(always_true, 10);
-    const std::string winner = "_TheWinner";
-    int winner_group = trial_true->AppendGroup(winner, 10);
-
-    EXPECT_EQ(trial_true->group(), winner_group);
-    EXPECT_EQ(trial_true->group_name(), winner);
-
-    FieldTrial* trial_false = new FieldTrial(always_false, 10);
-    int loser_group = trial_false->AppendGroup("ALoser", 0);
-
-    EXPECT_NE(trial_false->group(), loser_group);
-  }
-}
-
-TEST_F(FieldTrialTest, MiddleProbabilities) {
-  char name[] = " same name";
-  bool false_event_seen = false;
-  bool true_event_seen = false;
-  for (int i = 1; i < 250; ++i) {
-    name[0] = i;
-    FieldTrial* trial = new FieldTrial(name, 10);
-    int might_win = trial->AppendGroup("MightWin", 5);
-
-    if (trial->group() == might_win) {
-      true_event_seen = true;
-    } else {
-      false_event_seen = true;
-    }
-    if (false_event_seen && true_event_seen)
-      return;  // Successful test!!!
-  }
-  // Very surprising to get here. Probability should be around 1 in 2 ** 250.
-  // One of the following will fail.
-  EXPECT_TRUE(false_event_seen);
-  EXPECT_TRUE(true_event_seen);
-}
-
-TEST_F(FieldTrialTest, OneWinner) {
-  char name[] = "Some name";
-  int group_count(10);
-
-  FieldTrial* trial = new FieldTrial(name, group_count);
-  int winner_index(-2);
-  std::string winner_name;
-
-  for (int i = 1; i <= group_count; ++i) {
-    int might_win = trial->AppendGroup("", 1);
-
-    if (trial->group() == might_win) {
-      EXPECT_EQ(winner_index, -2);
-      winner_index = might_win;
-      StringAppendF(&winner_name, "_%d", might_win);
-      EXPECT_EQ(winner_name, trial->group_name());
-    }
-  }
-  EXPECT_GE(winner_index, 0);
-  EXPECT_EQ(trial->group(), winner_index);
-  EXPECT_EQ(winner_name, trial->group_name());
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/file_descriptor_shuffle_unittest.cc
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright (c) 2009 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/file_descriptor_shuffle.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using base::InjectiveMultimap;
-using base::InjectionArc;
-using base::PerformInjectiveMultimap;
-using base::InjectionDelegate;
-
-namespace {
-typedef testing::Test FileDescriptorShuffleTest;
-}
-
-// 'Duplicated' file descriptors start at this number
-static const int kDuplicateBase = 1000;
-
-struct Action {
-  enum Type {
-    CLOSE,
-    MOVE,
-    DUPLICATE,
-  };
-
-  Action(Type in_type, int in_fd1, int in_fd2 = -1)
-      : type(in_type),
-        fd1(in_fd1),
-        fd2(in_fd2) {
-  }
-
-  bool operator==(const Action& other) const {
-    return other.type == type &&
-           other.fd1 == fd1 &&
-           other.fd2 == fd2;
-  }
-
-  Type type;
-  int fd1;
-  int fd2;
-};
-
-class InjectionTracer : public InjectionDelegate {
- public:
-  InjectionTracer()
-      : next_duplicate_(kDuplicateBase) {
-  }
-
-  bool Duplicate(int* result, int fd) {
-    *result = next_duplicate_++;
-    actions_.push_back(Action(Action::DUPLICATE, *result, fd));
-    return true;
-  }
-
-  bool Move(int src, int dest) {
-    actions_.push_back(Action(Action::MOVE, src, dest));
-    return true;
-  }
-
-  void Close(int fd) {
-    actions_.push_back(Action(Action::CLOSE, fd));
-  }
-
-  const std::vector<Action>& actions() const { return actions_; }
-
- private:
-  int next_duplicate_;
-  std::vector<Action> actions_;
-};
-
-TEST(FileDescriptorShuffleTest, Empty) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(0u, tracer.actions().size());
-}
-
-TEST(FileDescriptorShuffleTest, Noop) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 0, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(0u, tracer.actions().size());
-}
-
-TEST(FileDescriptorShuffleTest, NoopAndClose) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 0, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(0u, tracer.actions().size());
-}
-
-TEST(FileDescriptorShuffleTest, Simple1) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(1u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-}
-
-TEST(FileDescriptorShuffleTest, Simple2) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-  map.push_back(InjectionArc(2, 3, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(2u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 2, 3));
-}
-
-TEST(FileDescriptorShuffleTest, Simple3) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(2u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::CLOSE, 0));
-}
-
-TEST(FileDescriptorShuffleTest, Simple4) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(10, 0, true));
-  map.push_back(InjectionArc(1, 1, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(2u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 10, 0));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::CLOSE, 10));
-}
-
-TEST(FileDescriptorShuffleTest, Cycle) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-  map.push_back(InjectionArc(1, 0, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(4u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] ==
-              Action(Action::DUPLICATE, kDuplicateBase, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::MOVE, kDuplicateBase, 0));
-  EXPECT_TRUE(tracer.actions()[3] == Action(Action::CLOSE, kDuplicateBase));
-}
-
-TEST(FileDescriptorShuffleTest, CycleAndClose1) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, true));
-  map.push_back(InjectionArc(1, 0, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(4u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] ==
-              Action(Action::DUPLICATE, kDuplicateBase, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::MOVE, kDuplicateBase, 0));
-  EXPECT_TRUE(tracer.actions()[3] == Action(Action::CLOSE, kDuplicateBase));
-}
-
-TEST(FileDescriptorShuffleTest, CycleAndClose2) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-  map.push_back(InjectionArc(1, 0, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(4u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] ==
-              Action(Action::DUPLICATE, kDuplicateBase, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::MOVE, kDuplicateBase, 0));
-  EXPECT_TRUE(tracer.actions()[3] == Action(Action::CLOSE, kDuplicateBase));
-}
-
-TEST(FileDescriptorShuffleTest, CycleAndClose3) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, true));
-  map.push_back(InjectionArc(1, 0, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(4u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] ==
-              Action(Action::DUPLICATE, kDuplicateBase, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::MOVE, kDuplicateBase, 0));
-  EXPECT_TRUE(tracer.actions()[3] == Action(Action::CLOSE, kDuplicateBase));
-}
-
-TEST(FileDescriptorShuffleTest, Fanout) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-  map.push_back(InjectionArc(0, 2, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(2u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 2));
-}
-
-TEST(FileDescriptorShuffleTest, FanoutAndClose1) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, true));
-  map.push_back(InjectionArc(0, 2, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(3u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 2));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::CLOSE, 0));
-}
-
-TEST(FileDescriptorShuffleTest, FanoutAndClose2) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, false));
-  map.push_back(InjectionArc(0, 2, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(3u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 2));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::CLOSE, 0));
-}
-
-TEST(FileDescriptorShuffleTest, FanoutAndClose3) {
-  InjectiveMultimap map;
-  InjectionTracer tracer;
-  map.push_back(InjectionArc(0, 1, true));
-  map.push_back(InjectionArc(0, 2, true));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &tracer));
-  EXPECT_EQ(3u, tracer.actions().size());
-  EXPECT_TRUE(tracer.actions()[0] == Action(Action::MOVE, 0, 1));
-  EXPECT_TRUE(tracer.actions()[1] == Action(Action::MOVE, 0, 2));
-  EXPECT_TRUE(tracer.actions()[2] == Action(Action::CLOSE, 0));
-}
-
-class FailingDelegate : public InjectionDelegate {
- public:
-  bool Duplicate(int* result, int fd) {
-    return false;
-  }
-
-  bool Move(int src, int dest) {
-    return false;
-  }
-
-  void Close(int fd) {
-  }
-};
-
-TEST(FileDescriptorShuffleTest, EmptyWithFailure) {
-  InjectiveMultimap map;
-  FailingDelegate failing;
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &failing));
-}
-
-TEST(FileDescriptorShuffleTest, NoopWithFailure) {
-  InjectiveMultimap map;
-  FailingDelegate failing;
-  map.push_back(InjectionArc(0, 0, false));
-
-  EXPECT_TRUE(PerformInjectiveMultimap(map, &failing));
-}
-
-TEST(FileDescriptorShuffleTest, Simple1WithFailure) {
-  InjectiveMultimap map;
-  FailingDelegate failing;
-  map.push_back(InjectionArc(0, 1, false));
-
-  EXPECT_FALSE(PerformInjectiveMultimap(map, &failing));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/file_path_unittest.cc
+++ /dev/null
@@ -1,534 +0,0 @@
-// Copyright (c) 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 "base/basictypes.h"
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
-
-// This macro helps avoid wrapped lines in the test structs.
-#define FPL(x) FILE_PATH_LITERAL(x)
-
-struct UnaryTestData {
-  const FilePath::CharType* input;
-  const FilePath::CharType* expected;
-};
-
-struct UnaryBooleanTestData {
-  const FilePath::CharType* input;
-  bool expected;
-};
-
-struct BinaryTestData {
-  const FilePath::CharType* inputs[2];
-  const FilePath::CharType* expected;
-};
-
-// file_util winds up using autoreleased objects on the Mac, so this needs
-// to be a PlatformTest
-class FilePathTest : public PlatformTest {
- protected:
-  virtual void SetUp() {
-    PlatformTest::SetUp();
-  }
-  virtual void TearDown() {
-    PlatformTest::TearDown();
-  }
-};
-
-TEST_F(FilePathTest, DirName) {
-  const struct UnaryTestData cases[] = {
-    { FPL(""),              FPL(".") },
-    { FPL("aa"),            FPL(".") },
-    { FPL("/aa/bb"),        FPL("/aa") },
-    { FPL("/aa/bb/"),       FPL("/aa") },
-    { FPL("/aa/bb//"),      FPL("/aa") },
-    { FPL("/aa/bb/ccc"),    FPL("/aa/bb") },
-    { FPL("/aa"),           FPL("/") },
-    { FPL("/aa/"),          FPL("/") },
-    { FPL("/"),             FPL("/") },
-    { FPL("//"),            FPL("//") },
-    { FPL("///"),           FPL("/") },
-    { FPL("aa/"),           FPL(".") },
-    { FPL("aa/bb"),         FPL("aa") },
-    { FPL("aa/bb/"),        FPL("aa") },
-    { FPL("aa/bb//"),       FPL("aa") },
-    { FPL("aa//bb//"),      FPL("aa") },
-    { FPL("aa//bb/"),       FPL("aa") },
-    { FPL("aa//bb"),        FPL("aa") },
-    { FPL("//aa/bb"),       FPL("//aa") },
-    { FPL("//aa/"),         FPL("//") },
-    { FPL("//aa"),          FPL("//") },
-    { FPL("0:"),            FPL(".") },
-    { FPL("@:"),            FPL(".") },
-    { FPL("[:"),            FPL(".") },
-    { FPL("`:"),            FPL(".") },
-    { FPL("{:"),            FPL(".") },
-    { FPL("\xB3:"),         FPL(".") },
-    { FPL("\xC5:"),         FPL(".") },
-#if defined(OS_WIN)
-    { FPL("\x0143:"),       FPL(".") },
-#endif  // OS_WIN
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("c:"),            FPL("c:") },
-    { FPL("C:"),            FPL("C:") },
-    { FPL("A:"),            FPL("A:") },
-    { FPL("Z:"),            FPL("Z:") },
-    { FPL("a:"),            FPL("a:") },
-    { FPL("z:"),            FPL("z:") },
-    { FPL("c:aa"),          FPL("c:") },
-    { FPL("c:/"),           FPL("c:/") },
-    { FPL("c://"),          FPL("c://") },
-    { FPL("c:///"),         FPL("c:/") },
-    { FPL("c:/aa"),         FPL("c:/") },
-    { FPL("c:/aa/"),        FPL("c:/") },
-    { FPL("c:/aa/bb"),      FPL("c:/aa") },
-    { FPL("c:aa/bb"),       FPL("c:aa") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { FPL("\\aa\\bb"),      FPL("\\aa") },
-    { FPL("\\aa\\bb\\"),    FPL("\\aa") },
-    { FPL("\\aa\\bb\\\\"),  FPL("\\aa") },
-    { FPL("\\aa\\bb\\ccc"), FPL("\\aa\\bb") },
-    { FPL("\\aa"),          FPL("\\") },
-    { FPL("\\aa\\"),        FPL("\\") },
-    { FPL("\\"),            FPL("\\") },
-    { FPL("\\\\"),          FPL("\\\\") },
-    { FPL("\\\\\\"),        FPL("\\") },
-    { FPL("aa\\"),          FPL(".") },
-    { FPL("aa\\bb"),        FPL("aa") },
-    { FPL("aa\\bb\\"),      FPL("aa") },
-    { FPL("aa\\bb\\\\"),    FPL("aa") },
-    { FPL("aa\\\\bb\\\\"),  FPL("aa") },
-    { FPL("aa\\\\bb\\"),    FPL("aa") },
-    { FPL("aa\\\\bb"),      FPL("aa") },
-    { FPL("\\\\aa\\bb"),    FPL("\\\\aa") },
-    { FPL("\\\\aa\\"),      FPL("\\\\") },
-    { FPL("\\\\aa"),        FPL("\\\\") },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("c:\\"),          FPL("c:\\") },
-    { FPL("c:\\\\"),        FPL("c:\\\\") },
-    { FPL("c:\\\\\\"),      FPL("c:\\") },
-    { FPL("c:\\aa"),        FPL("c:\\") },
-    { FPL("c:\\aa\\"),      FPL("c:\\") },
-    { FPL("c:\\aa\\bb"),    FPL("c:\\aa") },
-    { FPL("c:aa\\bb"),      FPL("c:aa") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#endif  // FILE_PATH_USES_WIN_SEPARATORS
-  };
-
-  for (size_t i = 0; i < arraysize(cases); ++i) {
-    FilePath input(cases[i].input);
-    FilePath observed = input.DirName();
-    EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) <<
-              "i: " << i << ", input: " << input.value();
-  }
-}
-
-TEST_F(FilePathTest, BaseName) {
-  const struct UnaryTestData cases[] = {
-    { FPL(""),              FPL("") },
-    { FPL("aa"),            FPL("aa") },
-    { FPL("/aa/bb"),        FPL("bb") },
-    { FPL("/aa/bb/"),       FPL("bb") },
-    { FPL("/aa/bb//"),      FPL("bb") },
-    { FPL("/aa/bb/ccc"),    FPL("ccc") },
-    { FPL("/aa"),           FPL("aa") },
-    { FPL("/"),             FPL("/") },
-    { FPL("//"),            FPL("//") },
-    { FPL("///"),           FPL("/") },
-    { FPL("aa/"),           FPL("aa") },
-    { FPL("aa/bb"),         FPL("bb") },
-    { FPL("aa/bb/"),        FPL("bb") },
-    { FPL("aa/bb//"),       FPL("bb") },
-    { FPL("aa//bb//"),      FPL("bb") },
-    { FPL("aa//bb/"),       FPL("bb") },
-    { FPL("aa//bb"),        FPL("bb") },
-    { FPL("//aa/bb"),       FPL("bb") },
-    { FPL("//aa/"),         FPL("aa") },
-    { FPL("//aa"),          FPL("aa") },
-    { FPL("0:"),            FPL("0:") },
-    { FPL("@:"),            FPL("@:") },
-    { FPL("[:"),            FPL("[:") },
-    { FPL("`:"),            FPL("`:") },
-    { FPL("{:"),            FPL("{:") },
-    { FPL("\xB3:"),         FPL("\xB3:") },
-    { FPL("\xC5:"),         FPL("\xC5:") },
-#if defined(OS_WIN)
-    { FPL("\x0143:"),       FPL("\x0143:") },
-#endif  // OS_WIN
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("c:"),            FPL("") },
-    { FPL("C:"),            FPL("") },
-    { FPL("A:"),            FPL("") },
-    { FPL("Z:"),            FPL("") },
-    { FPL("a:"),            FPL("") },
-    { FPL("z:"),            FPL("") },
-    { FPL("c:aa"),          FPL("aa") },
-    { FPL("c:/"),           FPL("/") },
-    { FPL("c://"),          FPL("//") },
-    { FPL("c:///"),         FPL("/") },
-    { FPL("c:/aa"),         FPL("aa") },
-    { FPL("c:/aa/"),        FPL("aa") },
-    { FPL("c:/aa/bb"),      FPL("bb") },
-    { FPL("c:aa/bb"),       FPL("bb") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { FPL("\\aa\\bb"),      FPL("bb") },
-    { FPL("\\aa\\bb\\"),    FPL("bb") },
-    { FPL("\\aa\\bb\\\\"),  FPL("bb") },
-    { FPL("\\aa\\bb\\ccc"), FPL("ccc") },
-    { FPL("\\aa"),          FPL("aa") },
-    { FPL("\\"),            FPL("\\") },
-    { FPL("\\\\"),          FPL("\\\\") },
-    { FPL("\\\\\\"),        FPL("\\") },
-    { FPL("aa\\"),          FPL("aa") },
-    { FPL("aa\\bb"),        FPL("bb") },
-    { FPL("aa\\bb\\"),      FPL("bb") },
-    { FPL("aa\\bb\\\\"),    FPL("bb") },
-    { FPL("aa\\\\bb\\\\"),  FPL("bb") },
-    { FPL("aa\\\\bb\\"),    FPL("bb") },
-    { FPL("aa\\\\bb"),      FPL("bb") },
-    { FPL("\\\\aa\\bb"),    FPL("bb") },
-    { FPL("\\\\aa\\"),      FPL("aa") },
-    { FPL("\\\\aa"),        FPL("aa") },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("c:\\"),          FPL("\\") },
-    { FPL("c:\\\\"),        FPL("\\\\") },
-    { FPL("c:\\\\\\"),      FPL("\\") },
-    { FPL("c:\\aa"),        FPL("aa") },
-    { FPL("c:\\aa\\"),      FPL("aa") },
-    { FPL("c:\\aa\\bb"),    FPL("bb") },
-    { FPL("c:aa\\bb"),      FPL("bb") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#endif  // FILE_PATH_USES_WIN_SEPARATORS
-  };
-
-  for (size_t i = 0; i < arraysize(cases); ++i) {
-    FilePath input(cases[i].input);
-    FilePath observed = input.BaseName();
-    EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) <<
-              "i: " << i << ", input: " << input.value();
-  }
-}
-
-TEST_F(FilePathTest, Append) {
-  const struct BinaryTestData cases[] = {
-    { { FPL(""),           FPL("cc") }, FPL("cc") },
-    { { FPL("."),          FPL("ff") }, FPL("ff") },
-    { { FPL("/"),          FPL("cc") }, FPL("/cc") },
-    { { FPL("/aa"),        FPL("") },   FPL("/aa") },
-    { { FPL("/aa/"),       FPL("") },   FPL("/aa") },
-    { { FPL("//aa"),       FPL("") },   FPL("//aa") },
-    { { FPL("//aa/"),      FPL("") },   FPL("//aa") },
-    { { FPL("//"),         FPL("aa") }, FPL("//aa") },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { { FPL("c:"),         FPL("a") },  FPL("c:a") },
-    { { FPL("c:"),         FPL("") },   FPL("c:") },
-    { { FPL("c:/"),        FPL("a") },  FPL("c:/a") },
-    { { FPL("c://"),       FPL("a") },  FPL("c://a") },
-    { { FPL("c:///"),      FPL("a") },  FPL("c:/a") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    // Append introduces the default separator character, so these test cases
-    // need to be defined with different expected results on platforms that use
-    // different default separator characters.
-    { { FPL("\\"),         FPL("cc") }, FPL("\\cc") },
-    { { FPL("\\aa"),       FPL("") },   FPL("\\aa") },
-    { { FPL("\\aa\\"),     FPL("") },   FPL("\\aa") },
-    { { FPL("\\\\aa"),     FPL("") },   FPL("\\\\aa") },
-    { { FPL("\\\\aa\\"),   FPL("") },   FPL("\\\\aa") },
-    { { FPL("\\\\"),       FPL("aa") }, FPL("\\\\aa") },
-    { { FPL("/aa/bb"),     FPL("cc") }, FPL("/aa/bb\\cc") },
-    { { FPL("/aa/bb/"),    FPL("cc") }, FPL("/aa/bb\\cc") },
-    { { FPL("aa/bb/"),     FPL("cc") }, FPL("aa/bb\\cc") },
-    { { FPL("aa/bb"),      FPL("cc") }, FPL("aa/bb\\cc") },
-    { { FPL("a/b"),        FPL("c") },  FPL("a/b\\c") },
-    { { FPL("a/b/"),       FPL("c") },  FPL("a/b\\c") },
-    { { FPL("//aa"),       FPL("bb") }, FPL("//aa\\bb") },
-    { { FPL("//aa/"),      FPL("bb") }, FPL("//aa\\bb") },
-    { { FPL("\\aa\\bb"),   FPL("cc") }, FPL("\\aa\\bb\\cc") },
-    { { FPL("\\aa\\bb\\"), FPL("cc") }, FPL("\\aa\\bb\\cc") },
-    { { FPL("aa\\bb\\"),   FPL("cc") }, FPL("aa\\bb\\cc") },
-    { { FPL("aa\\bb"),     FPL("cc") }, FPL("aa\\bb\\cc") },
-    { { FPL("a\\b"),       FPL("c") },  FPL("a\\b\\c") },
-    { { FPL("a\\b\\"),     FPL("c") },  FPL("a\\b\\c") },
-    { { FPL("\\\\aa"),     FPL("bb") }, FPL("\\\\aa\\bb") },
-    { { FPL("\\\\aa\\"),   FPL("bb") }, FPL("\\\\aa\\bb") },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { { FPL("c:\\"),       FPL("a") },  FPL("c:\\a") },
-    { { FPL("c:\\\\"),     FPL("a") },  FPL("c:\\\\a") },
-    { { FPL("c:\\\\\\"),   FPL("a") },  FPL("c:\\a") },
-    { { FPL("c:\\"),       FPL("") },   FPL("c:\\") },
-    { { FPL("c:\\a"),      FPL("b") },  FPL("c:\\a\\b") },
-    { { FPL("c:\\a\\"),    FPL("b") },  FPL("c:\\a\\b") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#else  // FILE_PATH_USES_WIN_SEPARATORS
-    { { FPL("/aa/bb"),     FPL("cc") }, FPL("/aa/bb/cc") },
-    { { FPL("/aa/bb/"),    FPL("cc") }, FPL("/aa/bb/cc") },
-    { { FPL("aa/bb/"),     FPL("cc") }, FPL("aa/bb/cc") },
-    { { FPL("aa/bb"),      FPL("cc") }, FPL("aa/bb/cc") },
-    { { FPL("a/b"),        FPL("c") },  FPL("a/b/c") },
-    { { FPL("a/b/"),       FPL("c") },  FPL("a/b/c") },
-    { { FPL("//aa"),       FPL("bb") }, FPL("//aa/bb") },
-    { { FPL("//aa/"),      FPL("bb") }, FPL("//aa/bb") },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { { FPL("c:/"),        FPL("a") },  FPL("c:/a") },
-    { { FPL("c:/"),        FPL("") },   FPL("c:/") },
-    { { FPL("c:/a"),       FPL("b") },  FPL("c:/a/b") },
-    { { FPL("c:/a/"),      FPL("b") },  FPL("c:/a/b") },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#endif  // FILE_PATH_USES_WIN_SEPARATORS
-  };
-
-  for (size_t i = 0; i < arraysize(cases); ++i) {
-    FilePath root(cases[i].inputs[0]);
-    FilePath::StringType leaf(cases[i].inputs[1]);
-    FilePath observed_str = root.Append(leaf);
-    EXPECT_EQ(FilePath::StringType(cases[i].expected), observed_str.value()) <<
-              "i: " << i << ", root: " << root.value() << ", leaf: " << leaf;
-    FilePath observed_path = root.Append(FilePath(leaf));
-    EXPECT_EQ(FilePath::StringType(cases[i].expected), observed_path.value()) <<
-              "i: " << i << ", root: " << root.value() << ", leaf: " << leaf;
-
-    // TODO(erikkay): It would be nice to have a unicode test append value to
-    // handle the case when AppendASCII is passed UTF8
-#if defined(OS_WIN)
-    std::string ascii = WideToASCII(leaf);
-#elif defined(OS_POSIX)
-    std::string ascii = leaf;
-#endif
-    observed_str = root.AppendASCII(ascii);
-    EXPECT_EQ(FilePath::StringType(cases[i].expected), observed_str.value()) <<
-              "i: " << i << ", root: " << root.value() << ", leaf: " << leaf;
-  }
-}
-
-TEST_F(FilePathTest, IsAbsolute) {
-  const struct UnaryBooleanTestData cases[] = {
-    { FPL(""),       false },
-    { FPL("a"),      false },
-    { FPL("c:"),     false },
-    { FPL("c:a"),    false },
-    { FPL("a/b"),    false },
-    { FPL("//"),     true },
-    { FPL("//a"),    true },
-    { FPL("c:a/b"),  false },
-    { FPL("?:/a"),   false },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("/"),      false },
-    { FPL("/a"),     false },
-    { FPL("/."),     false },
-    { FPL("/.."),    false },
-    { FPL("c:/"),    true },
-    { FPL("c:/a"),   true },
-    { FPL("c:/."),   true },
-    { FPL("c:/.."),  true },
-    { FPL("C:/a"),   true },
-    { FPL("d:/a"),   true },
-#else  // FILE_PATH_USES_DRIVE_LETTERS
-    { FPL("/"),      true },
-    { FPL("/a"),     true },
-    { FPL("/."),     true },
-    { FPL("/.."),    true },
-    { FPL("c:/"),    false },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { FPL("a\\b"),   false },
-    { FPL("\\\\"),   true },
-    { FPL("\\\\a"),  true },
-    { FPL("a\\b"),   false },
-    { FPL("\\\\"),   true },
-    { FPL("//a"),    true },
-    { FPL("c:a\\b"), false },
-    { FPL("?:\\a"),  false },
-#if defined(FILE_PATH_USES_DRIVE_LETTERS)
-    { FPL("\\"),     false },
-    { FPL("\\a"),    false },
-    { FPL("\\."),    false },
-    { FPL("\\.."),   false },
-    { FPL("c:\\"),   true },
-    { FPL("c:\\"),   true },
-    { FPL("c:\\a"),  true },
-    { FPL("c:\\."),  true },
-    { FPL("c:\\.."), true },
-    { FPL("C:\\a"),  true },
-    { FPL("d:\\a"),  true },
-#else  // FILE_PATH_USES_DRIVE_LETTERS
-    { FPL("\\"),     true },
-    { FPL("\\a"),    true },
-    { FPL("\\."),    true },
-    { FPL("\\.."),   true },
-    { FPL("c:\\"),   false },
-#endif  // FILE_PATH_USES_DRIVE_LETTERS
-#endif  // FILE_PATH_USES_WIN_SEPARATORS
-  };
-
-  for (size_t i = 0; i < arraysize(cases); ++i) {
-    FilePath input(cases[i].input);
-    bool observed = input.IsAbsolute();
-    EXPECT_EQ(cases[i].expected, observed) <<
-              "i: " << i << ", input: " << input.value();
-  }
-}
-
-TEST_F(FilePathTest, Extension) {
-  FilePath base_dir(FILE_PATH_LITERAL("base_dir"));
-
-  FilePath jpg = base_dir.Append(FILE_PATH_LITERAL("foo.jpg"));
-  EXPECT_EQ(jpg.Extension(), FILE_PATH_LITERAL(".jpg"));
-
-  FilePath base = jpg.BaseName().RemoveExtension();
-  EXPECT_EQ(base.value(), FILE_PATH_LITERAL("foo"));
-
-  FilePath path_no_ext = base_dir.Append(base);
-  EXPECT_EQ(jpg.RemoveExtension().value(), path_no_ext.value());
-
-  EXPECT_EQ(path_no_ext.value(), path_no_ext.RemoveExtension().value());
-  EXPECT_EQ(path_no_ext.Extension(), FILE_PATH_LITERAL(""));
-}
-
-TEST_F(FilePathTest, Extension2) {
-  const struct UnaryTestData cases[] = {
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { FPL("C:\\a\\b\\c.ext"),        FPL(".ext") },
-    { FPL("C:\\a\\b\\c."),           FPL(".") },
-    { FPL("C:\\a\\b\\c"),            FPL("") },
-    { FPL("C:\\a\\b\\"),             FPL("") },
-    { FPL("C:\\a\\b.\\"),            FPL(".") },
-    { FPL("C:\\a\\b\\c.ext1.ext2"),  FPL(".ext2") },
-    { FPL("C:\\foo.bar\\\\\\"),      FPL(".bar") },
-    { FPL("C:\\foo.bar\\.."),        FPL("") },
-    { FPL("C:\\foo.bar\\..\\\\"),    FPL("") },
-#endif
-    { FPL("/foo/bar/baz.ext"),       FPL(".ext") },
-    { FPL("/foo/bar/baz."),          FPL(".") },
-    { FPL("/foo/bar/baz.."),         FPL(".") },
-    { FPL("/foo/bar/baz"),           FPL("") },
-    { FPL("/foo/bar/"),              FPL("") },
-    { FPL("/foo/bar./"),             FPL(".") },
-    { FPL("/foo/bar/baz.ext1.ext2"), FPL(".ext2") },
-    { FPL("."),                      FPL("") },
-    { FPL(".."),                     FPL("") },
-    { FPL("./foo"),                  FPL("") },
-    { FPL("./foo.ext"),              FPL(".ext") },
-    { FPL("/foo.ext1/bar.ext2"),     FPL(".ext2") },
-    { FPL("/foo.bar////"),           FPL(".bar") },
-    { FPL("/foo.bar/.."),            FPL("") },
-    { FPL("/foo.bar/..////"),        FPL("") },
-  };
-  for (unsigned int i = 0; i < arraysize(cases); ++i) {
-    FilePath path(cases[i].input);
-    FilePath::StringType extension = path.Extension();
-    EXPECT_STREQ(cases[i].expected, extension.c_str()) << "i: " << i <<
-        ", path: " << path.value();
-  }
-}
-
-TEST_F(FilePathTest, InsertBeforeExtension) {
-  const struct BinaryTestData cases[] = {
-    { { FPL(""),                FPL("") },        FPL("") },
-    { { FPL(""),                FPL("txt") },     FPL("") },
-    { { FPL("."),               FPL("txt") },     FPL("") },
-    { { FPL(".."),              FPL("txt") },     FPL("") },
-    { { FPL("foo.dll"),         FPL("txt") },     FPL("footxt.dll") },
-    { { FPL("."),               FPL("") },        FPL(".") },
-    { { FPL("foo.dll"),         FPL(".txt") },    FPL("foo.txt.dll") },
-    { { FPL("foo"),             FPL("txt") },     FPL("footxt") },
-    { { FPL("foo"),             FPL(".txt") },    FPL("foo.txt") },
-    { { FPL("foo.baz.dll"),     FPL("txt") },     FPL("foo.baztxt.dll") },
-    { { FPL("foo.baz.dll"),     FPL(".txt") },    FPL("foo.baz.txt.dll") },
-    { { FPL("foo.dll"),         FPL("") },        FPL("foo.dll") },
-    { { FPL("foo.dll"),         FPL(".") },       FPL("foo..dll") },
-    { { FPL("foo"),             FPL("") },        FPL("foo") },
-    { { FPL("foo"),             FPL(".") },       FPL("foo.") },
-    { { FPL("foo.baz.dll"),     FPL("") },        FPL("foo.baz.dll") },
-    { { FPL("foo.baz.dll"),     FPL(".") },       FPL("foo.baz..dll") },
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { { FPL("\\"),              FPL("") },        FPL("\\") },
-    { { FPL("\\"),              FPL("txt") },     FPL("\\txt") },
-    { { FPL("\\."),             FPL("txt") },     FPL("") },
-    { { FPL("\\.."),            FPL("txt") },     FPL("") },
-    { { FPL("\\."),             FPL("") },        FPL("\\.") },
-    { { FPL("C:\\bar\\foo.dll"), FPL("txt") },
-        FPL("C:\\bar\\footxt.dll") },
-    { { FPL("C:\\bar.baz\\foodll"), FPL("txt") },
-        FPL("C:\\bar.baz\\foodlltxt") },
-    { { FPL("C:\\bar.baz\\foo.dll"), FPL("txt") },
-        FPL("C:\\bar.baz\\footxt.dll") },
-    { { FPL("C:\\bar.baz\\foo.dll.exe"), FPL("txt") },
-        FPL("C:\\bar.baz\\foo.dlltxt.exe") },
-    { { FPL("C:\\bar.baz\\foo"), FPL("") },
-        FPL("C:\\bar.baz\\foo") },
-    { { FPL("C:\\bar.baz\\foo.exe"), FPL("") },
-        FPL("C:\\bar.baz\\foo.exe") },
-    { { FPL("C:\\bar.baz\\foo.dll.exe"), FPL("") },
-        FPL("C:\\bar.baz\\foo.dll.exe") },
-    { { FPL("C:\\bar\\baz\\foo.exe"), FPL(" (1)") },
-        FPL("C:\\bar\\baz\\foo (1).exe") },
-    { { FPL("C:\\foo.baz\\\\"), FPL(" (1)") },    FPL("C:\\foo (1).baz") },
-    { { FPL("C:\\foo.baz\\..\\"), FPL(" (1)") },  FPL("") },
-#endif
-    { { FPL("/"),               FPL("") },        FPL("/") },
-    { { FPL("/"),               FPL("txt") },     FPL("/txt") },
-    { { FPL("/."),              FPL("txt") },     FPL("") },
-    { { FPL("/.."),             FPL("txt") },     FPL("") },
-    { { FPL("/."),              FPL("") },        FPL("/.") },
-    { { FPL("/bar/foo.dll"),    FPL("txt") },     FPL("/bar/footxt.dll") },
-    { { FPL("/bar.baz/foodll"), FPL("txt") },     FPL("/bar.baz/foodlltxt") },
-    { { FPL("/bar.baz/foo.dll"), FPL("txt") },    FPL("/bar.baz/footxt.dll") },
-    { { FPL("/bar.baz/foo.dll.exe"), FPL("txt") },
-        FPL("/bar.baz/foo.dlltxt.exe") },
-    { { FPL("/bar.baz/foo"),    FPL("") },        FPL("/bar.baz/foo") },
-    { { FPL("/bar.baz/foo.exe"), FPL("") },       FPL("/bar.baz/foo.exe") },
-    { { FPL("/bar.baz/foo.dll.exe"), FPL("") },   FPL("/bar.baz/foo.dll.exe") },
-    { { FPL("/bar/baz/foo.exe"), FPL(" (1)") },   FPL("/bar/baz/foo (1).exe") },
-    { { FPL("/bar/baz/..////"), FPL(" (1)") },    FPL("") },
-  };
-  for (unsigned int i = 0; i < arraysize(cases); ++i) {
-    FilePath path(cases[i].inputs[0]);
-    FilePath result = path.InsertBeforeExtension(cases[i].inputs[1]);
-    EXPECT_EQ(cases[i].expected, result.value()) << "i: " << i <<
-        ", path: " << path.value() << ", insert: " << cases[i].inputs[1];
-  }
-}
-
-TEST_F(FilePathTest, ReplaceExtension) {
-  const struct BinaryTestData cases[] = {
-    { { FPL(""),              FPL("") },      FPL("") },
-    { { FPL(""),              FPL("txt") },   FPL("") },
-    { { FPL("."),             FPL("txt") },   FPL("") },
-    { { FPL(".."),            FPL("txt") },   FPL("") },
-    { { FPL("."),             FPL("") },      FPL("") },
-    { { FPL("foo.dll"),       FPL("txt") },   FPL("foo.txt") },
-    { { FPL("foo..dll"),      FPL("txt") },   FPL("foo..txt") },
-    { { FPL("foo.dll"),       FPL(".txt") },  FPL("foo.txt") },
-    { { FPL("foo"),           FPL("txt") },   FPL("foo.txt") },
-    { { FPL("foo."),          FPL("txt") },   FPL("foo.txt") },
-    { { FPL("foo.."),         FPL("txt") },   FPL("foo..txt") },
-    { { FPL("foo"),           FPL(".txt") },  FPL("foo.txt") },
-    { { FPL("foo.baz.dll"),   FPL("txt") },   FPL("foo.baz.txt") },
-    { { FPL("foo.baz.dll"),   FPL(".txt") },  FPL("foo.baz.txt") },
-    { { FPL("foo.dll"),       FPL("") },      FPL("foo") },
-    { { FPL("foo.dll"),       FPL(".") },     FPL("foo") },
-    { { FPL("foo"),           FPL("") },      FPL("foo") },
-    { { FPL("foo"),           FPL(".") },     FPL("foo") },
-    { { FPL("foo.baz.dll"),   FPL("") },      FPL("foo.baz") },
-    { { FPL("foo.baz.dll"),   FPL(".") },     FPL("foo.baz") },
-#if defined(FILE_PATH_USES_WIN_SEPARATORS)
-    { { FPL("C:\\foo.bar\\foo"),    FPL("baz") }, FPL("C:\\foo.bar\\foo.baz") },
-    { { FPL("C:\\foo.bar\\..\\\\"), FPL("baz") }, FPL("") },
-#endif
-    { { FPL("/foo.bar/foo"),        FPL("baz") }, FPL("/foo.bar/foo.baz") },
-    { { FPL("/foo.bar/..////"),     FPL("baz") }, FPL("") },
-  };
-  for (unsigned int i = 0; i < arraysize(cases); ++i) {
-    FilePath path(cases[i].inputs[0]);
-    FilePath replaced = path.ReplaceExtension(cases[i].inputs[1]);
-    EXPECT_EQ(cases[i].expected, replaced.value()) << "i: " << i <<
-        ", path: " << path.value() << ", replace: " << cases[i].inputs[1];
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/file_util_unittest.cc
+++ /dev/null
@@ -1,1096 +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 "build/build_config.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#include <shellapi.h>
-#include <shlobj.h>
-#endif
-
-#include <fstream>
-#include <iostream>
-#include <set>
-
-#include "base/base_paths.h"
-#include "base/file_path.h"
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "base/platform_thread.h"
-#include "base/string_util.h"
-#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
-
-// This macro helps avoid wrapped lines in the test structs.
-#define FPL(x) FILE_PATH_LITERAL(x)
-
-namespace {
-
-// file_util winds up using autoreleased objects on the Mac, so this needs
-// to be a PlatformTest
-class FileUtilTest : public PlatformTest {
- protected:
-  virtual void SetUp() {
-    PlatformTest::SetUp();
-    // Name a subdirectory of the temp directory.
-    ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_));
-    test_dir_ = test_dir_.Append(FILE_PATH_LITERAL("FileUtilTest"));
-
-    // Create a fresh, empty copy of this directory.
-    file_util::Delete(test_dir_, true);
-    file_util::CreateDirectory(test_dir_);
-  }
-  virtual void TearDown() {
-    PlatformTest::TearDown();
-    // Clean up test directory
-    ASSERT_TRUE(file_util::Delete(test_dir_, true));
-    ASSERT_FALSE(file_util::PathExists(test_dir_));
-  }
-
-  // the path to temporary directory used to contain the test operations
-  FilePath test_dir_;
-};
-
-// Collects all the results from the given file enumerator, and provides an
-// interface to query whether a given file is present.
-class FindResultCollector {
- public:
-  FindResultCollector(file_util::FileEnumerator& enumerator) {
-    FilePath cur_file;
-    while (!(cur_file = enumerator.Next()).value().empty()) {
-      FilePath::StringType path = cur_file.value();
-      // The file should not be returned twice.
-      EXPECT_TRUE(files_.end() == files_.find(path))
-          << "Same file returned twice";
-
-      // Save for later.
-      files_.insert(path);
-    }
-  }
-
-  // Returns true if the enumerator found the file.
-  bool HasFile(const FilePath& file) const {
-    return files_.find(file.value()) != files_.end();
-  }
-
-  int size() {
-    return static_cast<int>(files_.size());
-  }
-
- private:
-  std::set<FilePath::StringType> files_;
-};
-
-// Simple function to dump some text into a new file.
-void CreateTextFile(const FilePath& filename,
-                    const std::wstring& contents) {
-  std::ofstream file;
-  file.open(WideToUTF8(filename.ToWStringHack()).c_str());
-  ASSERT_TRUE(file.is_open());
-  file << contents;
-  file.close();
-}
-
-// Simple function to take out some text from a file.
-std::wstring ReadTextFile(const FilePath& filename) {
-  wchar_t contents[64];
-  std::wifstream file;
-  file.open(WideToUTF8(filename.ToWStringHack()).c_str());
-  EXPECT_TRUE(file.is_open());
-  file.getline(contents, 64);
-  file.close();
-  return std::wstring(contents);
-}
-
-#if defined(OS_WIN)
-uint64_t FileTimeAsUint64(const FILETIME& ft) {
-  ULARGE_INTEGER u;
-  u.LowPart = ft.dwLowDateTime;
-  u.HighPart = ft.dwHighDateTime;
-  return u.QuadPart;
-}
-#endif
-
-const struct append_case {
-  const wchar_t* path;
-  const wchar_t* ending;
-  const wchar_t* result;
-} append_cases[] = {
-#if defined(OS_WIN)
-  {L"c:\\colon\\backslash", L"path", L"c:\\colon\\backslash\\path"},
-  {L"c:\\colon\\backslash\\", L"path", L"c:\\colon\\backslash\\path"},
-  {L"c:\\colon\\backslash\\\\", L"path", L"c:\\colon\\backslash\\\\path"},
-  {L"c:\\colon\\backslash\\", L"", L"c:\\colon\\backslash\\"},
-  {L"c:\\colon\\backslash", L"", L"c:\\colon\\backslash\\"},
-  {L"", L"path", L"\\path"},
-  {L"", L"", L"\\"},
-#elif defined(OS_POSIX)
-  {L"/foo/bar", L"path", L"/foo/bar/path"},
-  {L"/foo/bar/", L"path", L"/foo/bar/path"},
-  {L"/foo/bar//", L"path", L"/foo/bar//path"},
-  {L"/foo/bar/", L"", L"/foo/bar/"},
-  {L"/foo/bar", L"", L"/foo/bar/"},
-  {L"", L"path", L"/path"},
-  {L"", L"", L"/"},
-#endif
-};
-
-TEST_F(FileUtilTest, AppendToPath) {
-  for (unsigned int i = 0; i < arraysize(append_cases); ++i) {
-    const append_case& value = append_cases[i];
-    std::wstring result = value.path;
-    file_util::AppendToPath(&result, value.ending);
-    EXPECT_EQ(value.result, result);
-  }
-
-#ifdef NDEBUG
-  file_util::AppendToPath(NULL, L"path");  // asserts in debug mode
-#endif
-}
-
-static const struct InsertBeforeExtensionCase {
-  const FilePath::CharType* path;
-  const FilePath::CharType* suffix;
-  const FilePath::CharType* result;
-} kInsertBeforeExtension[] = {
-  {FPL(""), FPL(""), FPL("")},
-  {FPL(""), FPL("txt"), FPL("txt")},
-  {FPL("."), FPL("txt"), FPL("txt.")},
-  {FPL("."), FPL(""), FPL(".")},
-  {FPL("foo.dll"), FPL("txt"), FPL("footxt.dll")},
-  {FPL("foo.dll"), FPL(".txt"), FPL("foo.txt.dll")},
-  {FPL("foo"), FPL("txt"), FPL("footxt")},
-  {FPL("foo"), FPL(".txt"), FPL("foo.txt")},
-  {FPL("foo.baz.dll"), FPL("txt"), FPL("foo.baztxt.dll")},
-  {FPL("foo.baz.dll"), FPL(".txt"), FPL("foo.baz.txt.dll")},
-  {FPL("foo.dll"), FPL(""), FPL("foo.dll")},
-  {FPL("foo.dll"), FPL("."), FPL("foo..dll")},
-  {FPL("foo"), FPL(""), FPL("foo")},
-  {FPL("foo"), FPL("."), FPL("foo.")},
-  {FPL("foo.baz.dll"), FPL(""), FPL("foo.baz.dll")},
-  {FPL("foo.baz.dll"), FPL("."), FPL("foo.baz..dll")},
-#if defined(OS_WIN)
-  {FPL("\\"), FPL(""), FPL("\\")},
-  {FPL("\\"), FPL("txt"), FPL("\\txt")},
-  {FPL("\\."), FPL("txt"), FPL("\\txt.")},
-  {FPL("\\."), FPL(""), FPL("\\.")},
-  {FPL("C:\\bar\\foo.dll"), FPL("txt"), FPL("C:\\bar\\footxt.dll")},
-  {FPL("C:\\bar.baz\\foodll"), FPL("txt"), FPL("C:\\bar.baz\\foodlltxt")},
-  {FPL("C:\\bar.baz\\foo.dll"), FPL("txt"), FPL("C:\\bar.baz\\footxt.dll")},
-  {FPL("C:\\bar.baz\\foo.dll.exe"), FPL("txt"),
-   FPL("C:\\bar.baz\\foo.dlltxt.exe")},
-  {FPL("C:\\bar.baz\\foo"), FPL(""), FPL("C:\\bar.baz\\foo")},
-  {FPL("C:\\bar.baz\\foo.exe"), FPL(""), FPL("C:\\bar.baz\\foo.exe")},
-  {FPL("C:\\bar.baz\\foo.dll.exe"), FPL(""), FPL("C:\\bar.baz\\foo.dll.exe")},
-  {FPL("C:\\bar\\baz\\foo.exe"), FPL(" (1)"), FPL("C:\\bar\\baz\\foo (1).exe")},
-#elif defined(OS_POSIX)
-  {FPL("/"), FPL(""), FPL("/")},
-  {FPL("/"), FPL("txt"), FPL("/txt")},
-  {FPL("/."), FPL("txt"), FPL("/txt.")},
-  {FPL("/."), FPL(""), FPL("/.")},
-  {FPL("/bar/foo.dll"), FPL("txt"), FPL("/bar/footxt.dll")},
-  {FPL("/bar.baz/foodll"), FPL("txt"), FPL("/bar.baz/foodlltxt")},
-  {FPL("/bar.baz/foo.dll"), FPL("txt"), FPL("/bar.baz/footxt.dll")},
-  {FPL("/bar.baz/foo.dll.exe"), FPL("txt"), FPL("/bar.baz/foo.dlltxt.exe")},
-  {FPL("/bar.baz/foo"), FPL(""), FPL("/bar.baz/foo")},
-  {FPL("/bar.baz/foo.exe"), FPL(""), FPL("/bar.baz/foo.exe")},
-  {FPL("/bar.baz/foo.dll.exe"), FPL(""), FPL("/bar.baz/foo.dll.exe")},
-  {FPL("/bar/baz/foo.exe"), FPL(" (1)"), FPL("/bar/baz/foo (1).exe")},
-#endif
-};
-
-TEST_F(FileUtilTest, InsertBeforeExtensionTest) {
-  for (unsigned int i = 0; i < arraysize(kInsertBeforeExtension); ++i) {
-    FilePath path(kInsertBeforeExtension[i].path);
-    file_util::InsertBeforeExtension(&path, kInsertBeforeExtension[i].suffix);
-    EXPECT_EQ(kInsertBeforeExtension[i].result, path.value());
-  }
-}
-
-static const struct filename_case {
-  const wchar_t* path;
-  const wchar_t* filename;
-} filename_cases[] = {
-#if defined(OS_WIN)
-  {L"c:\\colon\\backslash", L"backslash"},
-  {L"c:\\colon\\backslash\\", L""},
-  {L"\\\\filename.exe", L"filename.exe"},
-  {L"filename.exe", L"filename.exe"},
-  {L"", L""},
-  {L"\\\\\\", L""},
-  {L"c:/colon/backslash", L"backslash"},
-  {L"c:/colon/backslash/", L""},
-  {L"//////", L""},
-  {L"///filename.exe", L"filename.exe"},
-#elif defined(OS_POSIX)
-  {L"/foo/bar", L"bar"},
-  {L"/foo/bar/", L""},
-  {L"/filename.exe", L"filename.exe"},
-  {L"filename.exe", L"filename.exe"},
-  {L"", L""},
-  {L"/", L""},
-#endif
-};
-
-TEST_F(FileUtilTest, GetFilenameFromPath) {
-  for (unsigned int i = 0; i < arraysize(filename_cases); ++i) {
-    const filename_case& value = filename_cases[i];
-    std::wstring result = file_util::GetFilenameFromPath(value.path);
-    EXPECT_EQ(value.filename, result);
-  }
-}
-
-// Test finding the file type from a path name
-static const struct extension_case {
-  const wchar_t* path;
-  const wchar_t* extension;
-} extension_cases[] = {
-#if defined(OS_WIN)
-  {L"C:\\colon\\backslash\\filename.extension", L"extension"},
-  {L"C:\\colon\\backslash\\filename.", L""},
-  {L"C:\\colon\\backslash\\filename", L""},
-  {L"C:\\colon\\backslash\\", L""},
-  {L"C:\\colon\\backslash.\\", L""},
-  {L"C:\\colon\\backslash\filename.extension.extension2", L"extension2"},
-#elif defined(OS_POSIX)
-  {L"/foo/bar/filename.extension", L"extension"},
-  {L"/foo/bar/filename.", L""},
-  {L"/foo/bar/filename", L""},
-  {L"/foo/bar/", L""},
-  {L"/foo/bar./", L""},
-  {L"/foo/bar/filename.extension.extension2", L"extension2"},
-  {L".", L""},
-  {L"..", L""},
-  {L"./foo", L""},
-  {L"./foo.extension", L"extension"},
-  {L"/foo.extension1/bar.extension2", L"extension2"},
-#endif
-};
-
-TEST_F(FileUtilTest, GetFileExtensionFromPath) {
-  for (unsigned int i = 0; i < arraysize(extension_cases); ++i) {
-    const extension_case& ext = extension_cases[i];
-    const std::wstring fext = file_util::GetFileExtensionFromPath(ext.path);
-    EXPECT_EQ(ext.extension, fext);
-  }
-}
-
-// Test finding the directory component of a path
-static const struct dir_case {
-  const wchar_t* full_path;
-  const wchar_t* directory;
-} dir_cases[] = {
-#if defined(OS_WIN)
-  {L"C:\\WINDOWS\\system32\\gdi32.dll", L"C:\\WINDOWS\\system32"},
-  {L"C:\\WINDOWS\\system32\\not_exist_thx_1138", L"C:\\WINDOWS\\system32"},
-  {L"C:\\WINDOWS\\system32\\", L"C:\\WINDOWS\\system32"},
-  {L"C:\\WINDOWS\\system32\\\\", L"C:\\WINDOWS\\system32"},
-  {L"C:\\WINDOWS\\system32", L"C:\\WINDOWS"},
-  {L"C:\\WINDOWS\\system32.\\", L"C:\\WINDOWS\\system32."},
-  {L"C:\\", L"C:"},
-#elif defined(OS_POSIX)
-  {L"/foo/bar/gdi32.dll", L"/foo/bar"},
-  {L"/foo/bar/not_exist_thx_1138", L"/foo/bar"},
-  {L"/foo/bar/", L"/foo/bar"},
-  {L"/foo/bar//", L"/foo/bar"},
-  {L"/foo/bar", L"/foo"},
-  {L"/foo/bar./", L"/foo/bar."},
-  {L"/", L"/"},
-  {L".", L"."},
-  {L"..", L"."}, // yes, ".." technically lives in "."
-#endif
-};
-
-TEST_F(FileUtilTest, GetDirectoryFromPath) {
-  for (unsigned int i = 0; i < arraysize(dir_cases); ++i) {
-    const dir_case& dir = dir_cases[i];
-    const std::wstring parent =
-        file_util::GetDirectoryFromPath(dir.full_path);
-    EXPECT_EQ(dir.directory, parent);
-  }
-}
-
-TEST_F(FileUtilTest, CountFilesCreatedAfter) {
-  // Create old file (that we don't want to count)
-  FilePath old_file_name = test_dir_.Append(FILE_PATH_LITERAL("Old File.txt"));
-  CreateTextFile(old_file_name, L"Just call me Mr. Creakybits");
-
-  // Age to perfection
-#if defined(OS_WIN)
-  PlatformThread::Sleep(100);
-#elif defined(OS_POSIX)
-  // We need to wait at least one second here because the precision of
-  // file creation time is one second.
-  PlatformThread::Sleep(1500);
-#endif
-
-  // Establish our cutoff time
-  base::Time now(base::Time::NowFromSystemTime());
-  EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
-
-  // Create a new file (that we do want to count)
-  FilePath new_file_name = test_dir_.Append(FILE_PATH_LITERAL("New File.txt"));
-  CreateTextFile(new_file_name, L"Waaaaaaaaaaaaaah.");
-
-  // We should see only the new file.
-  EXPECT_EQ(1, file_util::CountFilesCreatedAfter(test_dir_, now));
-
-  // Delete new file, we should see no files after cutoff now
-  EXPECT_TRUE(file_util::Delete(new_file_name, false));
-  EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
-}
-
-// Tests that the Delete function works as expected, especially
-// the recursion flag.  Also coincidentally tests PathExists.
-TEST_F(FileUtilTest, Delete) {
-  // Create a file
-  FilePath file_name = test_dir_.Append(FILE_PATH_LITERAL("Test File.txt"));
-  CreateTextFile(file_name, L"I'm cannon fodder.");
-
-  ASSERT_TRUE(file_util::PathExists(file_name));
-
-  FilePath subdir_path = test_dir_.Append(FILE_PATH_LITERAL("Subdirectory"));
-  file_util::CreateDirectory(subdir_path);
-
-  ASSERT_TRUE(file_util::PathExists(subdir_path));
-
-  FilePath directory_contents = test_dir_;
-#if defined(OS_WIN)
-  // TODO(erikkay): see if anyone's actually using this feature of the API
-  directory_contents = directory_contents.Append(FILE_PATH_LITERAL("*"));
-  // Delete non-recursively and check that only the file is deleted
-  ASSERT_TRUE(file_util::Delete(directory_contents, false));
-  EXPECT_FALSE(file_util::PathExists(file_name));
-  EXPECT_TRUE(file_util::PathExists(subdir_path));
-#endif
-
-  // Delete recursively and make sure all contents are deleted
-  ASSERT_TRUE(file_util::Delete(directory_contents, true));
-  EXPECT_FALSE(file_util::PathExists(file_name));
-  EXPECT_FALSE(file_util::PathExists(subdir_path));
-}
-
-TEST_F(FileUtilTest, Move) {
-  // Create a directory
-  FilePath dir_name_from =
-      test_dir_.Append(FILE_PATH_LITERAL("Move_From_Subdir"));
-  file_util::CreateDirectory(dir_name_from);
-  ASSERT_TRUE(file_util::PathExists(dir_name_from));
-
-  // Create a file under the directory
-  FilePath file_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Move_Test_File.txt"));
-  CreateTextFile(file_name_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name_from));
-
-  // Move the directory
-  FilePath dir_name_to = test_dir_.Append(FILE_PATH_LITERAL("Move_To_Subdir"));
-  FilePath file_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("Move_Test_File.txt"));
-
-  ASSERT_FALSE(file_util::PathExists(dir_name_to));
-
-  EXPECT_TRUE(file_util::Move(dir_name_from, dir_name_to));
-
-  // Check everything has been moved.
-  EXPECT_FALSE(file_util::PathExists(dir_name_from));
-  EXPECT_FALSE(file_util::PathExists(file_name_from));
-  EXPECT_TRUE(file_util::PathExists(dir_name_to));
-  EXPECT_TRUE(file_util::PathExists(file_name_to));
-}
-
-TEST_F(FileUtilTest, CopyDirectoryRecursively) {
-  // Create a directory.
-  FilePath dir_name_from =
-      test_dir_.Append(FILE_PATH_LITERAL("Copy_From_Subdir"));
-  file_util::CreateDirectory(dir_name_from);
-  ASSERT_TRUE(file_util::PathExists(dir_name_from));
-
-  // Create a file under the directory.
-  FilePath file_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  CreateTextFile(file_name_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name_from));
-
-  // Create a subdirectory.
-  FilePath subdir_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Subdir"));
-  file_util::CreateDirectory(subdir_name_from);
-  ASSERT_TRUE(file_util::PathExists(subdir_name_from));
-
-  // Create a file under the subdirectory.
-  FilePath file_name2_from =
-      subdir_name_from.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  CreateTextFile(file_name2_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name2_from));
-
-  // Copy the directory recursively.
-  FilePath dir_name_to =
-      test_dir_.Append(FILE_PATH_LITERAL("Copy_To_Subdir"));
-  FilePath file_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  FilePath subdir_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("Subdir"));
-  FilePath file_name2_to =
-      subdir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-
-  ASSERT_FALSE(file_util::PathExists(dir_name_to));
-
-  EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_to, true));
-
-  // Check everything has been copied.
-  EXPECT_TRUE(file_util::PathExists(dir_name_from));
-  EXPECT_TRUE(file_util::PathExists(file_name_from));
-  EXPECT_TRUE(file_util::PathExists(subdir_name_from));
-  EXPECT_TRUE(file_util::PathExists(file_name2_from));
-  EXPECT_TRUE(file_util::PathExists(dir_name_to));
-  EXPECT_TRUE(file_util::PathExists(file_name_to));
-  EXPECT_TRUE(file_util::PathExists(subdir_name_to));
-  EXPECT_TRUE(file_util::PathExists(file_name2_to));
-}
-
-TEST_F(FileUtilTest, CopyDirectory) {
-  // Create a directory.
-  FilePath dir_name_from =
-      test_dir_.Append(FILE_PATH_LITERAL("Copy_From_Subdir"));
-  file_util::CreateDirectory(dir_name_from);
-  ASSERT_TRUE(file_util::PathExists(dir_name_from));
-
-  // Create a file under the directory.
-  FilePath file_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  CreateTextFile(file_name_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name_from));
-
-  // Create a subdirectory.
-  FilePath subdir_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Subdir"));
-  file_util::CreateDirectory(subdir_name_from);
-  ASSERT_TRUE(file_util::PathExists(subdir_name_from));
-
-  // Create a file under the subdirectory.
-  FilePath file_name2_from =
-      subdir_name_from.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  CreateTextFile(file_name2_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name2_from));
-
-  // Copy the directory not recursively.
-  FilePath dir_name_to =
-      test_dir_.Append(FILE_PATH_LITERAL("Copy_To_Subdir"));
-  FilePath file_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  FilePath subdir_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("Subdir"));
-
-  ASSERT_FALSE(file_util::PathExists(dir_name_to));
-
-  EXPECT_TRUE(file_util::CopyDirectory(dir_name_from, dir_name_to, false));
-
-  // Check everything has been copied.
-  EXPECT_TRUE(file_util::PathExists(dir_name_from));
-  EXPECT_TRUE(file_util::PathExists(file_name_from));
-  EXPECT_TRUE(file_util::PathExists(subdir_name_from));
-  EXPECT_TRUE(file_util::PathExists(file_name2_from));
-  EXPECT_TRUE(file_util::PathExists(dir_name_to));
-  EXPECT_TRUE(file_util::PathExists(file_name_to));
-  EXPECT_FALSE(file_util::PathExists(subdir_name_to));
-}
-
-TEST_F(FileUtilTest, CopyFile) {
-  // Create a directory
-  FilePath dir_name_from =
-      test_dir_.Append(FILE_PATH_LITERAL("Copy_From_Subdir"));
-  file_util::CreateDirectory(dir_name_from);
-  ASSERT_TRUE(file_util::PathExists(dir_name_from));
-
-  // Create a file under the directory
-  FilePath file_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("Copy_Test_File.txt"));
-  const std::wstring file_contents(L"Gooooooooooooooooooooogle");
-  CreateTextFile(file_name_from, file_contents);
-  ASSERT_TRUE(file_util::PathExists(file_name_from));
-
-  // Copy the file.
-  FilePath dest_file = dir_name_from.Append(FILE_PATH_LITERAL("DestFile.txt"));
-  ASSERT_TRUE(file_util::CopyFile(file_name_from, dest_file));
-
-  // Copy the file to another location using '..' in the path.
-  std::wstring dest_file2(dir_name_from.ToWStringHack());
-  file_util::AppendToPath(&dest_file2, L"..");
-  file_util::AppendToPath(&dest_file2, L"DestFile.txt");
-  ASSERT_TRUE(file_util::CopyFile(file_name_from,
-                                  FilePath::FromWStringHack(dest_file2)));
-  std::wstring dest_file2_test(dir_name_from.ToWStringHack());
-  file_util::UpOneDirectory(&dest_file2_test);
-  file_util::AppendToPath(&dest_file2_test, L"DestFile.txt");
-
-  // Check everything has been copied.
-  EXPECT_TRUE(file_util::PathExists(file_name_from));
-  EXPECT_TRUE(file_util::PathExists(dest_file));
-  const std::wstring read_contents = ReadTextFile(dest_file);
-  EXPECT_EQ(file_contents, read_contents);
-  EXPECT_TRUE(file_util::PathExists(
-      FilePath::FromWStringHack(dest_file2_test)));
-  EXPECT_TRUE(file_util::PathExists(FilePath::FromWStringHack(dest_file2)));
-}
-
-// TODO(erikkay): implement
-#if defined(OS_WIN)
-TEST_F(FileUtilTest, GetFileCreationLocalTime) {
-  FilePath file_name = test_dir_.Append(L"Test File.txt");
-
-  SYSTEMTIME start_time;
-  GetLocalTime(&start_time);
-  Sleep(100);
-  CreateTextFile(file_name, L"New file!");
-  Sleep(100);
-  SYSTEMTIME end_time;
-  GetLocalTime(&end_time);
-
-  SYSTEMTIME file_creation_time;
-  file_util::GetFileCreationLocalTime(file_name.value(), &file_creation_time);
-
-  FILETIME start_filetime;
-  SystemTimeToFileTime(&start_time, &start_filetime);
-  FILETIME end_filetime;
-  SystemTimeToFileTime(&end_time, &end_filetime);
-  FILETIME file_creation_filetime;
-  SystemTimeToFileTime(&file_creation_time, &file_creation_filetime);
-
-  EXPECT_EQ(-1, CompareFileTime(&start_filetime, &file_creation_filetime)) <<
-    "start time: " << FileTimeAsUint64(start_filetime) << ", " <<
-    "creation time: " << FileTimeAsUint64(file_creation_filetime);
-
-  EXPECT_EQ(-1, CompareFileTime(&file_creation_filetime, &end_filetime)) <<
-    "creation time: " << FileTimeAsUint64(file_creation_filetime) << ", " <<
-    "end time: " << FileTimeAsUint64(end_filetime);
-
-  ASSERT_TRUE(DeleteFile(file_name.value().c_str()));
-}
-#endif
-
-// file_util winds up using autoreleased objects on the Mac, so this needs
-// to be a PlatformTest.
-typedef PlatformTest ReadOnlyFileUtilTest;
-
-TEST_F(ReadOnlyFileUtilTest, ContentsEqual) {
-  FilePath data_dir;
-  ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir));
-  data_dir = data_dir.Append(FILE_PATH_LITERAL("base"))
-                     .Append(FILE_PATH_LITERAL("data"))
-                     .Append(FILE_PATH_LITERAL("file_util_unittest"));
-  ASSERT_TRUE(file_util::PathExists(data_dir));
-
-  FilePath original_file =
-      data_dir.Append(FILE_PATH_LITERAL("original.txt"));
-  FilePath same_file =
-      data_dir.Append(FILE_PATH_LITERAL("same.txt"));
-  FilePath same_length_file =
-      data_dir.Append(FILE_PATH_LITERAL("same_length.txt"));
-  FilePath different_file =
-      data_dir.Append(FILE_PATH_LITERAL("different.txt"));
-  FilePath different_first_file =
-      data_dir.Append(FILE_PATH_LITERAL("different_first.txt"));
-  FilePath different_last_file =
-      data_dir.Append(FILE_PATH_LITERAL("different_last.txt"));
-  FilePath empty1_file =
-      data_dir.Append(FILE_PATH_LITERAL("empty1.txt"));
-  FilePath empty2_file =
-      data_dir.Append(FILE_PATH_LITERAL("empty2.txt"));
-  FilePath shortened_file =
-      data_dir.Append(FILE_PATH_LITERAL("shortened.txt"));
-  FilePath binary_file =
-      data_dir.Append(FILE_PATH_LITERAL("binary_file.bin"));
-  FilePath binary_file_same =
-      data_dir.Append(FILE_PATH_LITERAL("binary_file_same.bin"));
-  FilePath binary_file_diff =
-      data_dir.Append(FILE_PATH_LITERAL("binary_file_diff.bin"));
-
-  EXPECT_TRUE(file_util::ContentsEqual(original_file, original_file));
-  EXPECT_TRUE(file_util::ContentsEqual(original_file, same_file));
-  EXPECT_FALSE(file_util::ContentsEqual(original_file, same_length_file));
-  EXPECT_FALSE(file_util::ContentsEqual(original_file, different_file));
-  EXPECT_FALSE(file_util::ContentsEqual(L"bogusname", L"bogusname"));
-  EXPECT_FALSE(file_util::ContentsEqual(original_file, different_first_file));
-  EXPECT_FALSE(file_util::ContentsEqual(original_file, different_last_file));
-  EXPECT_TRUE(file_util::ContentsEqual(empty1_file, empty2_file));
-  EXPECT_FALSE(file_util::ContentsEqual(original_file, shortened_file));
-  EXPECT_FALSE(file_util::ContentsEqual(shortened_file, original_file));
-  EXPECT_TRUE(file_util::ContentsEqual(binary_file, binary_file_same));
-  EXPECT_FALSE(file_util::ContentsEqual(binary_file, binary_file_diff));
-}
-
-// We don't need equivalent functionality outside of Windows.
-#if defined(OS_WIN)
-TEST_F(FileUtilTest, ResolveShortcutTest) {
-  FilePath target_file = test_dir_.Append(L"Target.txt");
-  CreateTextFile(target_file, L"This is the target.");
-
-  FilePath link_file = test_dir_.Append(L"Link.lnk");
-
-  HRESULT result;
-  IShellLink *shell = NULL;
-  IPersistFile *persist = NULL;
-
-  CoInitialize(NULL);
-  // Temporarily create a shortcut for test
-  result = CoCreateInstance(CLSID_ShellLink, NULL,
-                          CLSCTX_INPROC_SERVER, IID_IShellLink,
-                          reinterpret_cast<LPVOID*>(&shell));
-  EXPECT_TRUE(SUCCEEDED(result));
-  result = shell->QueryInterface(IID_IPersistFile,
-                             reinterpret_cast<LPVOID*>(&persist));
-  EXPECT_TRUE(SUCCEEDED(result));
-  result = shell->SetPath(target_file.value().c_str());
-  EXPECT_TRUE(SUCCEEDED(result));
-  result = shell->SetDescription(L"ResolveShortcutTest");
-  EXPECT_TRUE(SUCCEEDED(result));
-  result = persist->Save(link_file.value().c_str(), TRUE);
-  EXPECT_TRUE(SUCCEEDED(result));
-  if (persist)
-    persist->Release();
-  if (shell)
-    shell->Release();
-
-  bool is_solved;
-  std::wstring link_file_str = link_file.value();
-  is_solved = file_util::ResolveShortcut(&link_file_str);
-  EXPECT_TRUE(is_solved);
-  std::wstring contents;
-  contents = ReadTextFile(FilePath(link_file_str));
-  EXPECT_EQ(L"This is the target.", contents);
-
-  // Cleaning
-  DeleteFile(target_file.value().c_str());
-  DeleteFile(link_file_str.c_str());
-  CoUninitialize();
-}
-
-TEST_F(FileUtilTest, CreateShortcutTest) {
-  const wchar_t file_contents[] = L"This is another target.";
-  FilePath target_file = test_dir_.Append(L"Target1.txt");
-  CreateTextFile(target_file, file_contents);
-
-  FilePath link_file = test_dir_.Append(L"Link1.lnk");
-
-  CoInitialize(NULL);
-  EXPECT_TRUE(file_util::CreateShortcutLink(target_file.value().c_str(),
-                                            link_file.value().c_str(),
-                                            NULL, NULL, NULL, NULL, 0));
-  std::wstring resolved_name = link_file.value();
-  EXPECT_TRUE(file_util::ResolveShortcut(&resolved_name));
-  std::wstring read_contents = ReadTextFile(FilePath(resolved_name));
-  EXPECT_EQ(file_contents, read_contents);
-
-  DeleteFile(target_file.value().c_str());
-  DeleteFile(link_file.value().c_str());
-  CoUninitialize();
-}
-
-TEST_F(FileUtilTest, CopyAndDeleteDirectoryTest) {
-  // Create a directory
-  FilePath dir_name_from =
-      test_dir_.Append(FILE_PATH_LITERAL("CopyAndDelete_From_Subdir"));
-  file_util::CreateDirectory(dir_name_from);
-  ASSERT_TRUE(file_util::PathExists(dir_name_from));
-
-  // Create a file under the directory
-  FilePath file_name_from =
-      dir_name_from.Append(FILE_PATH_LITERAL("CopyAndDelete_Test_File.txt"));
-  CreateTextFile(file_name_from, L"Gooooooooooooooooooooogle");
-  ASSERT_TRUE(file_util::PathExists(file_name_from));
-
-  // Move the directory by using CopyAndDeleteDirectory
-  FilePath dir_name_to = test_dir_.Append(
-      FILE_PATH_LITERAL("CopyAndDelete_To_Subdir"));
-  FilePath file_name_to =
-      dir_name_to.Append(FILE_PATH_LITERAL("CopyAndDelete_Test_File.txt"));
-
-  ASSERT_FALSE(file_util::PathExists(dir_name_to));
-
-  EXPECT_TRUE(file_util::CopyAndDeleteDirectory(dir_name_from, dir_name_to));
-
-  // Check everything has been moved.
-  EXPECT_FALSE(file_util::PathExists(dir_name_from));
-  EXPECT_FALSE(file_util::PathExists(file_name_from));
-  EXPECT_TRUE(file_util::PathExists(dir_name_to));
-  EXPECT_TRUE(file_util::PathExists(file_name_to));
-}
-#endif
-
-TEST_F(FileUtilTest, CreateTemporaryFileNameTest) {
-  std::wstring temp_files[3];
-  for (int i = 0; i < 3; i++) {
-    ASSERT_TRUE(file_util::CreateTemporaryFileName(&(temp_files[i])));
-    EXPECT_TRUE(file_util::PathExists(temp_files[i]));
-    EXPECT_FALSE(file_util::DirectoryExists(temp_files[i]));
-  }
-  for (int i = 0; i < 3; i++)
-    EXPECT_FALSE(temp_files[i] == temp_files[(i+1)%3]);
-  for (int i = 0; i < 3; i++)
-    EXPECT_TRUE(file_util::Delete(temp_files[i], false));
-}
-
-TEST_F(FileUtilTest, CreateAndOpenTemporaryFileNameTest) {
-  FilePath names[3];
-  FILE *fps[3];
-  int i;
-
-  // Create; make sure they are open and exist.
-  for (i = 0; i < 3; ++i) {
-    fps[i] = file_util::CreateAndOpenTemporaryFile(&(names[i]));
-    ASSERT_TRUE(fps[i]);
-    EXPECT_TRUE(file_util::PathExists(names[i]));
-  }
-
-  // Make sure all names are unique.
-  for (i = 0; i < 3; ++i) {
-    EXPECT_FALSE(names[i] == names[(i+1)%3]);
-  }
-
-  // Close and delete.
-  for (i = 0; i < 3; ++i) {
-    EXPECT_TRUE(file_util::CloseFile(fps[i]));
-    EXPECT_TRUE(file_util::Delete(names[i], false));
-  }
-}
-
-TEST_F(FileUtilTest, CreateNewTempDirectoryTest) {
-  std::wstring temp_dir;
-  ASSERT_TRUE(file_util::CreateNewTempDirectory(std::wstring(), &temp_dir));
-  EXPECT_TRUE(file_util::PathExists(temp_dir));
-  EXPECT_TRUE(file_util::Delete(temp_dir, false));
-}
-
-TEST_F(FileUtilTest, GetShmemTempDirTest) {
-  FilePath dir;
-  EXPECT_TRUE(file_util::GetShmemTempDir(&dir));
-  EXPECT_TRUE(file_util::DirectoryExists(dir));
-}
-
-TEST_F(FileUtilTest, CreateDirectoryTest) {
-  FilePath test_root =
-      test_dir_.Append(FILE_PATH_LITERAL("create_directory_test"));
-#if defined(OS_WIN)
-  FilePath test_path =
-      test_root.Append(FILE_PATH_LITERAL("dir\\tree\\likely\\doesnt\\exist\\"));
-#elif defined(OS_POSIX)
-  FilePath test_path =
-      test_root.Append(FILE_PATH_LITERAL("dir/tree/likely/doesnt/exist/"));
-#endif
-
-  EXPECT_FALSE(file_util::PathExists(test_path));
-  EXPECT_TRUE(file_util::CreateDirectory(test_path));
-  EXPECT_TRUE(file_util::PathExists(test_path));
-  // CreateDirectory returns true if the DirectoryExists returns true.
-  EXPECT_TRUE(file_util::CreateDirectory(test_path));
-
-  // Doesn't work to create it on top of a non-dir
-  test_path = test_path.Append(FILE_PATH_LITERAL("foobar.txt"));
-  EXPECT_FALSE(file_util::PathExists(test_path));
-  CreateTextFile(test_path, L"test file");
-  EXPECT_TRUE(file_util::PathExists(test_path));
-  EXPECT_FALSE(file_util::CreateDirectory(test_path));
-
-  EXPECT_TRUE(file_util::Delete(test_root, true));
-  EXPECT_FALSE(file_util::PathExists(test_root));
-  EXPECT_FALSE(file_util::PathExists(test_path));
-}
-
-TEST_F(FileUtilTest, DetectDirectoryTest) {
-  // Check a directory
-  FilePath test_root =
-      test_dir_.Append(FILE_PATH_LITERAL("detect_directory_test"));
-  EXPECT_FALSE(file_util::PathExists(test_root));
-  EXPECT_TRUE(file_util::CreateDirectory(test_root));
-  EXPECT_TRUE(file_util::PathExists(test_root));
-  EXPECT_TRUE(file_util::DirectoryExists(test_root));
-
-  // Check a file
-  FilePath test_path =
-      test_root.Append(FILE_PATH_LITERAL("foobar.txt"));
-  EXPECT_FALSE(file_util::PathExists(test_path));
-  CreateTextFile(test_path, L"test file");
-  EXPECT_TRUE(file_util::PathExists(test_path));
-  EXPECT_FALSE(file_util::DirectoryExists(test_path));
-  EXPECT_TRUE(file_util::Delete(test_path, false));
-
-  EXPECT_TRUE(file_util::Delete(test_root, true));
-}
-
-static const struct goodbad_pair {
-  std::wstring bad_name;
-  std::wstring good_name;
-} kIllegalCharacterCases[] = {
-  {L"bad*file:name?.jpg", L"bad-file-name-.jpg"},
-  {L"**********::::.txt", L"--------------.txt"},
-  // We can't use UCNs (universal character names) for C0/C1 characters and
-  // U+007F, but \x escape is interpreted by MSVC and gcc as we intend.
-  {L"bad\x0003\x0091 file\u200E\u200Fname.png", L"bad-- file--name.png"},
-#if defined(OS_WIN)
-  {L"bad*file\\name.jpg", L"bad-file-name.jpg"},
-  {L"\t  bad*file\\name/.jpg ", L"bad-file-name-.jpg"},
-  {L"bad\uFFFFfile\U0010FFFEname.jpg ", L"bad-file-name.jpg"},
-#elif defined(OS_POSIX)
-  {L"bad*file?name.jpg", L"bad-file-name.jpg"},
-  {L"\t  bad*file?name/.jpg ", L"bad-file-name-.jpg"},
-  {L"bad\uFFFFfile-name.jpg ", L"bad-file-name.jpg"},
-#endif
-  {L"this_file_name is okay!.mp3", L"this_file_name is okay!.mp3"},
-  {L"\u4E00\uAC00.mp3", L"\u4E00\uAC00.mp3"},
-  {L"\u0635\u200C\u0644.mp3", L"\u0635\u200C\u0644.mp3"},
-  {L"\U00010330\U00010331.mp3", L"\U00010330\U00010331.mp3"},
-  // Unassigned codepoints are ok.
-  {L"\u0378\U00040001.mp3", L"\u0378\U00040001.mp3"},
-};
-
-TEST_F(FileUtilTest, ReplaceIllegalCharactersTest) {
-  for (unsigned int i = 0; i < arraysize(kIllegalCharacterCases); ++i) {
-    std::wstring bad_name(kIllegalCharacterCases[i].bad_name);
-    file_util::ReplaceIllegalCharacters(&bad_name, L'-');
-    EXPECT_EQ(kIllegalCharacterCases[i].good_name, bad_name);
-  }
-}
-
-static const struct ReplaceExtensionCase {
-  std::wstring file_name;
-  FilePath::StringType extension;
-  std::wstring result;
-} kReplaceExtension[] = {
-  {L"", FILE_PATH_LITERAL(""), L""},
-  {L"", FILE_PATH_LITERAL("txt"), L".txt"},
-  {L".", FILE_PATH_LITERAL("txt"), L".txt"},
-  {L".", FILE_PATH_LITERAL(""), L""},
-  {L"foo.dll", FILE_PATH_LITERAL("txt"), L"foo.txt"},
-  {L"foo.dll", FILE_PATH_LITERAL(".txt"), L"foo.txt"},
-  {L"foo", FILE_PATH_LITERAL("txt"), L"foo.txt"},
-  {L"foo", FILE_PATH_LITERAL(".txt"), L"foo.txt"},
-  {L"foo.baz.dll", FILE_PATH_LITERAL("txt"), L"foo.baz.txt"},
-  {L"foo.baz.dll", FILE_PATH_LITERAL(".txt"), L"foo.baz.txt"},
-  {L"foo.dll", FILE_PATH_LITERAL(""), L"foo"},
-  {L"foo.dll", FILE_PATH_LITERAL("."), L"foo"},
-  {L"foo", FILE_PATH_LITERAL(""), L"foo"},
-  {L"foo", FILE_PATH_LITERAL("."), L"foo"},
-  {L"foo.baz.dll", FILE_PATH_LITERAL(""), L"foo.baz"},
-  {L"foo.baz.dll", FILE_PATH_LITERAL("."), L"foo.baz"},
-};
-
-TEST_F(FileUtilTest, ReplaceExtensionTest) {
-  for (unsigned int i = 0; i < arraysize(kReplaceExtension); ++i) {
-    FilePath path = FilePath::FromWStringHack(kReplaceExtension[i].file_name);
-    file_util::ReplaceExtension(&path, kReplaceExtension[i].extension);
-    EXPECT_EQ(kReplaceExtension[i].result, path.ToWStringHack());
-  }
-}
-
-// Make sure ReplaceExtension doesn't replace an extension that occurs as one of
-// the directory names of the path.
-TEST_F(FileUtilTest, ReplaceExtensionTestWithPathSeparators) {
-  FilePath path;
-  path = path.Append(FILE_PATH_LITERAL("foo.bar"));
-  path = path.Append(FILE_PATH_LITERAL("foo"));
-  // '/foo.bar/foo' with extension '.baz'
-  FilePath result_path = path;
-  file_util::ReplaceExtension(&result_path, FILE_PATH_LITERAL(".baz"));
-  EXPECT_EQ(path.value() + FILE_PATH_LITERAL(".baz"),
-            result_path.value());
-}
-
-TEST_F(FileUtilTest, FileEnumeratorTest) {
-  // Test an empty directory.
-  file_util::FileEnumerator f0(test_dir_, true,
-      file_util::FileEnumerator::FILES_AND_DIRECTORIES);
-  EXPECT_EQ(f0.Next().value(), FILE_PATH_LITERAL(""));
-  EXPECT_EQ(f0.Next().value(), FILE_PATH_LITERAL(""));
-
-  // create the directories
-  FilePath dir1 = test_dir_.Append(FILE_PATH_LITERAL("dir1"));
-  EXPECT_TRUE(file_util::CreateDirectory(dir1));
-  FilePath dir2 = test_dir_.Append(FILE_PATH_LITERAL("dir2"));
-  EXPECT_TRUE(file_util::CreateDirectory(dir2));
-  FilePath dir2inner = dir2.Append(FILE_PATH_LITERAL("inner"));
-  EXPECT_TRUE(file_util::CreateDirectory(dir2inner));
-
-  // create the files
-  FilePath dir2file = dir2.Append(FILE_PATH_LITERAL("dir2file.txt"));
-  CreateTextFile(dir2file, L"");
-  FilePath dir2innerfile = dir2inner.Append(FILE_PATH_LITERAL("innerfile.txt"));
-  CreateTextFile(dir2innerfile, L"");
-  FilePath file1 = test_dir_.Append(FILE_PATH_LITERAL("file1.txt"));
-  CreateTextFile(file1, L"");
-  FilePath file2_rel =
-      dir2.Append(FilePath::kParentDirectory)
-          .Append(FILE_PATH_LITERAL("file2.txt"));
-  CreateTextFile(file2_rel, L"");
-  FilePath file2_abs = test_dir_.Append(FILE_PATH_LITERAL("file2.txt"));
-
-  // Only enumerate files.
-  file_util::FileEnumerator f1(test_dir_, true,
-                               file_util::FileEnumerator::FILES);
-  FindResultCollector c1(f1);
-  EXPECT_TRUE(c1.HasFile(file1));
-  EXPECT_TRUE(c1.HasFile(file2_abs));
-  EXPECT_TRUE(c1.HasFile(dir2file));
-  EXPECT_TRUE(c1.HasFile(dir2innerfile));
-  EXPECT_EQ(c1.size(), 4);
-
-  // Only enumerate directories.
-  file_util::FileEnumerator f2(test_dir_, true,
-                               file_util::FileEnumerator::DIRECTORIES);
-  FindResultCollector c2(f2);
-  EXPECT_TRUE(c2.HasFile(dir1));
-  EXPECT_TRUE(c2.HasFile(dir2));
-  EXPECT_TRUE(c2.HasFile(dir2inner));
-  EXPECT_EQ(c2.size(), 3);
-
-  // Only enumerate directories non-recursively.
-  file_util::FileEnumerator f2_non_recursive(
-      test_dir_, false, file_util::FileEnumerator::DIRECTORIES);
-  FindResultCollector c2_non_recursive(f2_non_recursive);
-  EXPECT_TRUE(c2_non_recursive.HasFile(dir1));
-  EXPECT_TRUE(c2_non_recursive.HasFile(dir2));
-  EXPECT_EQ(c2_non_recursive.size(), 2);
-
-  // Enumerate files and directories.
-  file_util::FileEnumerator f3(test_dir_, true,
-      file_util::FileEnumerator::FILES_AND_DIRECTORIES);
-  FindResultCollector c3(f3);
-  EXPECT_TRUE(c3.HasFile(dir1));
-  EXPECT_TRUE(c3.HasFile(dir2));
-  EXPECT_TRUE(c3.HasFile(file1));
-  EXPECT_TRUE(c3.HasFile(file2_abs));
-  EXPECT_TRUE(c3.HasFile(dir2file));
-  EXPECT_TRUE(c3.HasFile(dir2inner));
-  EXPECT_TRUE(c3.HasFile(dir2innerfile));
-  EXPECT_EQ(c3.size(), 7);
-
-  // Non-recursive operation.
-  file_util::FileEnumerator f4(test_dir_, false,
-      file_util::FileEnumerator::FILES_AND_DIRECTORIES);
-  FindResultCollector c4(f4);
-  EXPECT_TRUE(c4.HasFile(dir2));
-  EXPECT_TRUE(c4.HasFile(dir2));
-  EXPECT_TRUE(c4.HasFile(file1));
-  EXPECT_TRUE(c4.HasFile(file2_abs));
-  EXPECT_EQ(c4.size(), 4);
-
-  // Enumerate with a pattern.
-  file_util::FileEnumerator f5(test_dir_, true,
-      file_util::FileEnumerator::FILES_AND_DIRECTORIES,
-      FILE_PATH_LITERAL("dir*"));
-  FindResultCollector c5(f5);
-  EXPECT_TRUE(c5.HasFile(dir1));
-  EXPECT_TRUE(c5.HasFile(dir2));
-  EXPECT_TRUE(c5.HasFile(dir2file));
-  EXPECT_TRUE(c5.HasFile(dir2inner));
-  EXPECT_TRUE(c5.HasFile(dir2innerfile));
-  EXPECT_EQ(c5.size(), 5);
-
-  // Make sure the destructor closes the find handle while in the middle of a
-  // query to allow TearDown to delete the directory.
-  file_util::FileEnumerator f6(test_dir_, true,
-      file_util::FileEnumerator::FILES_AND_DIRECTORIES);
-  EXPECT_FALSE(f6.Next().value().empty());  // Should have found something
-                                            // (we don't care what).
-}
-
-
-void PathComponents(const std::wstring& path,
-                    std::vector<std::wstring>* components) {
-  DCHECK(components != NULL);
-  if (components == NULL)
-    return;
-  std::wstring::size_type start = 0;
-  std::wstring::size_type end = path.find('/', start);
-
-  // Special case the "/" or "\" directory.  On Windows with a drive letter,
-  // this code path won't hit, but the right thing should still happen.
-  // "E:\foo" will turn into "E:","foo".
-  if (end == start) {
-    components->push_back(std::wstring(path, 0, 1));
-    start = end + 1;
-    end = path.find('/', start);
-  }
-  while (end != std::wstring::npos) {
-    std::wstring component = std::wstring(path, start, end - start);
-    components->push_back(component);
-    start = end + 1;
-    end = path.find('/', start);
-  }
-  std::wstring component = std::wstring(path, start);
-  components->push_back(component);
-}
-
-static const struct PathComponentsCase {
-  const FilePath::CharType* path;
-  const FilePath::CharType* result;
-} kPathComponents[] = {
-  {FILE_PATH_LITERAL("/foo/bar/baz/"), FILE_PATH_LITERAL("/|foo|bar|baz|")},
-  {FILE_PATH_LITERAL("/foo/bar/baz"), FILE_PATH_LITERAL("/|foo|bar|baz")},
-  {FILE_PATH_LITERAL("e:/foo"), FILE_PATH_LITERAL("e:|foo")},
-};
-
-TEST_F(FileUtilTest, PathComponentsTest) {
-  for (size_t i = 0; i < arraysize(kPathComponents); ++i) {
-    FilePath path(kPathComponents[i].path);
-    std::vector<FilePath::StringType> comps;
-    file_util::PathComponents(path, &comps);
-
-    FilePath::StringType result;
-    for (size_t j = 0; j < comps.size(); ++j) {
-      result.append(comps[j]);
-      if (j < comps.size() - 1)
-        result.append(FILE_PATH_LITERAL("|"), 1);
-    }
-    EXPECT_EQ(kPathComponents[i].result, result);
-  }
-}
-
-TEST_F(FileUtilTest, Contains) {
-  FilePath data_dir = test_dir_.Append(FILE_PATH_LITERAL("FilePathTest"));
-
-  // Create a fresh, empty copy of this directory.
-  if (file_util::PathExists(data_dir)) {
-    ASSERT_TRUE(file_util::Delete(data_dir, true));
-  }
-  ASSERT_TRUE(file_util::CreateDirectory(data_dir));
-
-  FilePath foo(data_dir.Append(FILE_PATH_LITERAL("foo")));
-  FilePath bar(foo.Append(FILE_PATH_LITERAL("bar.txt")));
-  FilePath baz(data_dir.Append(FILE_PATH_LITERAL("baz.txt")));
-  FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt")));
-
-  // Annoyingly, the directories must actually exist in order for realpath(),
-  // which Contains() relies on in posix, to work.
-  ASSERT_TRUE(file_util::CreateDirectory(foo));
-  std::string data("hello");
-  ASSERT_TRUE(file_util::WriteFile(bar, data.c_str(), data.length()));
-  ASSERT_TRUE(file_util::WriteFile(baz, data.c_str(), data.length()));
-  ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length()));
-
-  EXPECT_TRUE(file_util::ContainsPath(foo, bar));
-  EXPECT_FALSE(file_util::ContainsPath(foo, baz));
-  EXPECT_FALSE(file_util::ContainsPath(foo, foobar));
-  EXPECT_FALSE(file_util::ContainsPath(foo, foo));
-
-// Platform-specific concerns
-  FilePath foo_caps(data_dir.Append(FILE_PATH_LITERAL("FOO")));
-#if defined(OS_WIN)
-  EXPECT_TRUE(file_util::ContainsPath(foo,
-      foo_caps.Append(FILE_PATH_LITERAL("bar.txt"))));
-  EXPECT_TRUE(file_util::ContainsPath(foo,
-      FilePath(foo.value() + FILE_PATH_LITERAL("/bar.txt"))));
-#elif defined(OS_LINUX)
-  EXPECT_FALSE(file_util::ContainsPath(foo,
-      foo_caps.Append(FILE_PATH_LITERAL("bar.txt"))));
-#else
-  // We can't really do this test on osx since the case-sensitivity of the
-  // filesystem is configurable.
-#endif
-}
-
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/file_version_info_unittest.cc
+++ /dev/null
@@ -1,134 +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 "base/file_util.h"
-#include "base/path_service.h"
-#include "base/scoped_ptr.h"
-#include "base/file_version_info.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class FileVersionInfoTest : public testing::Test {
-};
-
-std::wstring GetTestDataPath() {
-  std::wstring path;
-  PathService::Get(base::DIR_SOURCE_ROOT, &path);
-  file_util::AppendToPath(&path, L"base");
-  file_util::AppendToPath(&path, L"data");
-  file_util::AppendToPath(&path, L"file_version_info_unittest");
-  return path;
-}
-
-}
-
-#ifdef OS_WIN
-TEST(FileVersionInfoTest, HardCodedProperties) {
-  const wchar_t* kDLLNames[] = {
-    L"FileVersionInfoTest1.dll"
-  };
-
-  const wchar_t* kExpectedValues[1][15] = {
-      // FileVersionInfoTest.dll
-      L"Goooooogle",                      // company_name
-      L"Google",                          // company_short_name
-      L"This is the product name",        // product_name
-      L"This is the product short name",  // product_short_name
-      L"The Internal Name",               // internal_name
-      L"4.3.2.1",                         // product_version
-      L"Private build property",          // private_build
-      L"Special build property",          // special_build
-      L"This is a particularly interesting comment",  // comments
-      L"This is the original filename",   // original_filename
-      L"This is my file description",     // file_description
-      L"1.2.3.4",                         // file_version
-      L"This is the legal copyright",     // legal_copyright
-      L"This is the legal trademarks",    // legal_trademarks
-      L"This is the last change",         // last_change
-
-  };
-
-  for (int i = 0; i < arraysize(kDLLNames); ++i) {
-    std::wstring dll_path = GetTestDataPath();
-    file_util::AppendToPath(&dll_path, kDLLNames[i]);
-
-    scoped_ptr<FileVersionInfo> version_info(
-        FileVersionInfo::CreateFileVersionInfo(dll_path));
-
-    int j = 0;
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->company_name());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->company_short_name());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->product_name());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->product_short_name());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->internal_name());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->product_version());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->private_build());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->special_build());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->comments());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->original_filename());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->file_description());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->file_version());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->legal_copyright());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->legal_trademarks());
-    EXPECT_EQ(kExpectedValues[i][j++], version_info->last_change());
-  }
-}
-#endif
-
-#ifdef OS_WIN
-TEST(FileVersionInfoTest, IsOfficialBuild) {
-  const wchar_t* kDLLNames[] = {
-    L"FileVersionInfoTest1.dll",
-    L"FileVersionInfoTest2.dll"
-  };
-
-  const bool kExpected[] = {
-    true,
-    false,
-  };
-
-  // Test consistency check.
-  ASSERT_EQ(arraysize(kDLLNames), arraysize(kExpected));
-
-  for (int i = 0; i < arraysize(kDLLNames); ++i) {
-    std::wstring dll_path = GetTestDataPath();
-    file_util::AppendToPath(&dll_path, kDLLNames[i]);
-
-    scoped_ptr<FileVersionInfo> version_info(
-        FileVersionInfo::CreateFileVersionInfo(dll_path));
-
-    EXPECT_EQ(kExpected[i], version_info->is_official_build());
-  }
-}
-#endif
-
-TEST(FileVersionInfoTest, CustomProperties) {
-  std::wstring dll_path = GetTestDataPath();
-  file_util::AppendToPath(&dll_path, L"FileVersionInfoTest1.dll");
-
-  scoped_ptr<FileVersionInfo> version_info(
-      FileVersionInfo::CreateFileVersionInfo(dll_path));
-
-  // Test few existing properties.
-  std::wstring str;
-#ifdef OS_WIN
-  EXPECT_TRUE(version_info->GetValue(L"Custom prop 1",  &str));
-  EXPECT_EQ(L"Un", str);
-  EXPECT_EQ(L"Un", version_info->GetStringValue(L"Custom prop 1"));
-
-  EXPECT_TRUE(version_info->GetValue(L"Custom prop 2",  &str));
-  EXPECT_EQ(L"Deux", str);
-  EXPECT_EQ(L"Deux", version_info->GetStringValue(L"Custom prop 2"));
-
-  EXPECT_TRUE(version_info->GetValue(L"Custom prop 3",  &str));
-  EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043", str);
-  EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043",
-            version_info->GetStringValue(L"Custom prop 3"));
-#endif
-
-  // Test an non-existing property.
-  EXPECT_FALSE(version_info->GetValue(L"Unknown property",  &str));
-  EXPECT_EQ(L"", version_info->GetStringValue(L"Unknown property"));
-}
--- a/ipc/chromium/src/base/histogram.h
+++ b/ipc/chromium/src/base/histogram.h
@@ -40,17 +40,16 @@
 #ifndef BASE_METRICS_HISTOGRAM_H_
 #define BASE_METRICS_HISTOGRAM_H_
 #pragma once
 
 #include <map>
 #include <string>
 #include <vector>
 
-#include "testing/gtest/include/gtest/gtest_prod.h"
 #include "base/time.h"
 #include "base/lock.h"
 
 class Pickle;
 
 namespace base {
 //------------------------------------------------------------------------------
 // Provide easy general purpose histogram in a macro, just like stats counters.
@@ -374,19 +373,16 @@ class Histogram {
     // histogram.  We use the natural log and compute ln(sample+1) so that
     // zeros are handled sanely.
     double log_sum_;      // sum of logs of samples.
     double log_sum_squares_; // sum of squares of logs of samples
 
    private:
     void Accumulate(Sample value, Count count, size_t index);
 
-    // Allow tests to corrupt our innards for testing purposes.
-    FRIEND_TEST(HistogramTest, CorruptSampleCounts);
-
     // To help identify memory corruption, we reduntantly save the number of
     // samples we've accumulated into all of our buckets.  We can compare this
     // count to the sum of the counts in all buckets, and detect problems.  Note
     // that due to races in histogram accumulation (if a histogram is indeed
     // updated on several threads simultaneously), the tallies might mismatch,
     // and also the snapshotting code may asynchronously get a mismatch (though
     // generally either race based mismatch cause is VERY rare).
     int64_t redundant_count_;
@@ -528,22 +524,16 @@ class Histogram {
 
   virtual uint32_t CalculateRangeChecksum() const;
 
   // Finally, provide the state that changes with the addition of each new
   // sample.
   SampleSet sample_;
 
  private:
-  // Allow tests to corrupt our innards for testing purposes.
-  FRIEND_TEST(HistogramTest, CorruptBucketBounds);
-  FRIEND_TEST(HistogramTest, CorruptSampleCounts);
-  FRIEND_TEST(HistogramTest, Crc32SampleHash);
-  FRIEND_TEST(HistogramTest, Crc32TableTest);
-
   friend class StatisticsRecorder;  // To allow it to delete duplicates.
 
   // Post constructor initialization.
   void Initialize();
 
   // Checksum function for accumulating range values into a checksum.
   static uint32_t Crc32(uint32_t sum, Sample range);
 
deleted file mode 100644
--- a/ipc/chromium/src/base/histogram_unittest.cc
+++ /dev/null
@@ -1,402 +0,0 @@
-// 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.
-
-// Test of Histogram class
-
-#include "base/metrics/histogram.h"
-#include "base/scoped_ptr.h"
-#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace base {
-namespace {
-
-class HistogramTest : public testing::Test {
-};
-
-// Check for basic syntax and use.
-TEST(HistogramTest, StartupShutdownTest) {
-  // Try basic construction
-  Histogram* histogram(Histogram::FactoryGet(
-      "TestHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), histogram);
-  Histogram* histogram1(Histogram::FactoryGet(
-      "Test1Histogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), histogram1);
-  EXPECT_NE(histogram, histogram1);
-
-
-  Histogram* linear_histogram(LinearHistogram::FactoryGet(
-      "TestLinearHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), linear_histogram);
-  Histogram* linear_histogram1(LinearHistogram::FactoryGet(
-      "Test1LinearHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), linear_histogram1);
-  EXPECT_NE(linear_histogram, linear_histogram1);
-
-  std::vector<int> custom_ranges;
-  custom_ranges.push_back(1);
-  custom_ranges.push_back(5);
-  custom_ranges.push_back(10);
-  custom_ranges.push_back(20);
-  custom_ranges.push_back(30);
-  Histogram* custom_histogram(CustomHistogram::FactoryGet(
-      "TestCustomHistogram", custom_ranges, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), custom_histogram);
-  Histogram* custom_histogram1(CustomHistogram::FactoryGet(
-      "Test1CustomHistogram", custom_ranges, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), custom_histogram1);
-
-  // Use standard macros (but with fixed samples)
-  HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1));
-  HISTOGRAM_COUNTS("Test3Histogram", 30);
-
-  DHISTOGRAM_TIMES("Test4Histogram", TimeDelta::FromDays(1));
-  DHISTOGRAM_COUNTS("Test5Histogram", 30);
-
-  HISTOGRAM_ENUMERATION("Test6Histogram", 129, 130);
-
-  // Try to construct samples.
-  Histogram::SampleSet sample1;
-  Histogram::SampleSet sample2;
-
-  // Use copy constructor of SampleSet
-  sample1 = sample2;
-  Histogram::SampleSet sample3(sample1);
-
-  // Finally test a statistics recorder, without really using it.
-  StatisticsRecorder recorder;
-}
-
-// Repeat with a recorder present to register with.
-TEST(HistogramTest, RecordedStartupTest) {
-  // Test a statistics recorder, by letting histograms register.
-  StatisticsRecorder recorder;  // This initializes the global state.
-
-  StatisticsRecorder::Histograms histograms;
-  EXPECT_EQ(0U, histograms.size());
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(0U, histograms.size());
-
-  // Try basic construction
-  Histogram* histogram(Histogram::FactoryGet(
-      "TestHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), histogram);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(1U, histograms.size());
-  Histogram* histogram1(Histogram::FactoryGet(
-      "Test1Histogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), histogram1);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(2U, histograms.size());
-
-  Histogram* linear_histogram(LinearHistogram::FactoryGet(
-      "TestLinearHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), linear_histogram);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(3U, histograms.size());
-
-  Histogram* linear_histogram1(LinearHistogram::FactoryGet(
-      "Test1LinearHistogram", 1, 1000, 10, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), linear_histogram1);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(4U, histograms.size());
-
-  std::vector<int> custom_ranges;
-  custom_ranges.push_back(1);
-  custom_ranges.push_back(5);
-  custom_ranges.push_back(10);
-  custom_ranges.push_back(20);
-  custom_ranges.push_back(30);
-  Histogram* custom_histogram(CustomHistogram::FactoryGet(
-      "TestCustomHistogram", custom_ranges, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), custom_histogram);
-  Histogram* custom_histogram1(CustomHistogram::FactoryGet(
-      "TestCustomHistogram", custom_ranges, Histogram::kNoFlags));
-  EXPECT_NE(reinterpret_cast<Histogram*>(NULL), custom_histogram1);
-
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(5U, histograms.size());
-
-  // Use standard macros (but with fixed samples)
-  HISTOGRAM_TIMES("Test2Histogram", TimeDelta::FromDays(1));
-  HISTOGRAM_COUNTS("Test3Histogram", 30);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(7U, histograms.size());
-
-  HISTOGRAM_ENUMERATION("TestEnumerationHistogram", 20, 200);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-  EXPECT_EQ(8U, histograms.size());
-
-  DHISTOGRAM_TIMES("Test4Histogram", TimeDelta::FromDays(1));
-  DHISTOGRAM_COUNTS("Test5Histogram", 30);
-  histograms.clear();
-  StatisticsRecorder::GetHistograms(&histograms);  // Load up lists
-#ifndef NDEBUG
-  EXPECT_EQ(10U, histograms.size());
-#else
-  EXPECT_EQ(8U, histograms.size());
-#endif
-}
-
-TEST(HistogramTest, RangeTest) {
-  StatisticsRecorder recorder;
-  StatisticsRecorder::Histograms histograms;
-
-  recorder.GetHistograms(&histograms);
-  EXPECT_EQ(0U, histograms.size());
-
-  Histogram* histogram(Histogram::FactoryGet(
-      "Histogram", 1, 64, 8, Histogram::kNoFlags));  // As per header file.
-  // Check that we got a nice exponential when there was enough rooom.
-  EXPECT_EQ(0, histogram->ranges(0));
-  int power_of_2 = 1;
-  for (int i = 1; i < 8; i++) {
-    EXPECT_EQ(power_of_2, histogram->ranges(i));
-    power_of_2 *= 2;
-  }
-  EXPECT_EQ(INT_MAX, histogram->ranges(8));
-
-  Histogram* short_histogram(Histogram::FactoryGet(
-      "Histogram Shortened", 1, 7, 8, Histogram::kNoFlags));
-  // Check that when the number of buckets is short, we get a linear histogram
-  // for lack of space to do otherwise.
-  for (int i = 0; i < 8; i++)
-    EXPECT_EQ(i, short_histogram->ranges(i));
-  EXPECT_EQ(INT_MAX, short_histogram->ranges(8));
-
-  Histogram* linear_histogram(LinearHistogram::FactoryGet(
-      "Linear", 1, 7, 8, Histogram::kNoFlags));
-  // We also get a nice linear set of bucket ranges when we ask for it
-  for (int i = 0; i < 8; i++)
-    EXPECT_EQ(i, linear_histogram->ranges(i));
-  EXPECT_EQ(INT_MAX, linear_histogram->ranges(8));
-
-  Histogram* linear_broad_histogram(LinearHistogram::FactoryGet(
-      "Linear widened", 2, 14, 8, Histogram::kNoFlags));
-  // ...but when the list has more space, then the ranges naturally spread out.
-  for (int i = 0; i < 8; i++)
-    EXPECT_EQ(2 * i, linear_broad_histogram->ranges(i));
-  EXPECT_EQ(INT_MAX, linear_broad_histogram->ranges(8));
-
-  Histogram* transitioning_histogram(Histogram::FactoryGet(
-      "LinearAndExponential", 1, 32, 15, Histogram::kNoFlags));
-  // When space is a little tight, we transition from linear to exponential.
-  EXPECT_EQ(0, transitioning_histogram->ranges(0));
-  EXPECT_EQ(1, transitioning_histogram->ranges(1));
-  EXPECT_EQ(2, transitioning_histogram->ranges(2));
-  EXPECT_EQ(3, transitioning_histogram->ranges(3));
-  EXPECT_EQ(4, transitioning_histogram->ranges(4));
-  EXPECT_EQ(5, transitioning_histogram->ranges(5));
-  EXPECT_EQ(6, transitioning_histogram->ranges(6));
-  EXPECT_EQ(7, transitioning_histogram->ranges(7));
-  EXPECT_EQ(9, transitioning_histogram->ranges(8));
-  EXPECT_EQ(11, transitioning_histogram->ranges(9));
-  EXPECT_EQ(14, transitioning_histogram->ranges(10));
-  EXPECT_EQ(17, transitioning_histogram->ranges(11));
-  EXPECT_EQ(21, transitioning_histogram->ranges(12));
-  EXPECT_EQ(26, transitioning_histogram->ranges(13));
-  EXPECT_EQ(32, transitioning_histogram->ranges(14));
-  EXPECT_EQ(INT_MAX, transitioning_histogram->ranges(15));
-
-  std::vector<int> custom_ranges;
-  custom_ranges.push_back(0);
-  custom_ranges.push_back(9);
-  custom_ranges.push_back(10);
-  custom_ranges.push_back(11);
-  custom_ranges.push_back(300);
-  Histogram* test_custom_histogram(CustomHistogram::FactoryGet(
-      "TestCustomRangeHistogram", custom_ranges, Histogram::kNoFlags));
-
-  EXPECT_EQ(custom_ranges[0], test_custom_histogram->ranges(0));
-  EXPECT_EQ(custom_ranges[1], test_custom_histogram->ranges(1));
-  EXPECT_EQ(custom_ranges[2], test_custom_histogram->ranges(2));
-  EXPECT_EQ(custom_ranges[3], test_custom_histogram->ranges(3));
-  EXPECT_EQ(custom_ranges[4], test_custom_histogram->ranges(4));
-
-  recorder.GetHistograms(&histograms);
-  EXPECT_EQ(6U, histograms.size());
-}
-
-TEST(HistogramTest, CustomRangeTest) {
-  StatisticsRecorder recorder;
-  StatisticsRecorder::Histograms histograms;
-
-  // Check that missing leading zero is handled by an auto-insertion.
-  std::vector<int> custom_ranges;
-  // Don't include a zero.
-  custom_ranges.push_back(9);
-  custom_ranges.push_back(10);
-  custom_ranges.push_back(11);
-  Histogram* test_custom_histogram(CustomHistogram::FactoryGet(
-      "TestCustomRangeHistogram", custom_ranges, Histogram::kNoFlags));
-
-  EXPECT_EQ(0, test_custom_histogram->ranges(0));  // Auto added
-  EXPECT_EQ(custom_ranges[0], test_custom_histogram->ranges(1));
-  EXPECT_EQ(custom_ranges[1], test_custom_histogram->ranges(2));
-  EXPECT_EQ(custom_ranges[2], test_custom_histogram->ranges(3));
-
-  // Check that unsorted data with dups is handled gracefully.
-  const int kSmall = 7;
-  const int kMid = 8;
-  const int kBig = 9;
-  custom_ranges.clear();
-  custom_ranges.push_back(kBig);
-  custom_ranges.push_back(kMid);
-  custom_ranges.push_back(kSmall);
-  custom_ranges.push_back(kSmall);
-  custom_ranges.push_back(kMid);
-  custom_ranges.push_back(0);  // Push an explicit zero.
-  custom_ranges.push_back(kBig);
-
-  Histogram* unsorted_histogram(CustomHistogram::FactoryGet(
-      "TestCustomUnsortedDupedHistogram", custom_ranges, Histogram::kNoFlags));
-  EXPECT_EQ(0, unsorted_histogram->ranges(0));
-  EXPECT_EQ(kSmall, unsorted_histogram->ranges(1));
-  EXPECT_EQ(kMid, unsorted_histogram->ranges(2));
-  EXPECT_EQ(kBig, unsorted_histogram->ranges(3));
-}
-
-
-// Make sure histogram handles out-of-bounds data gracefully.
-TEST(HistogramTest, BoundsTest) {
-  const size_t kBucketCount = 50;
-  Histogram* histogram(Histogram::FactoryGet(
-      "Bounded", 10, 100, kBucketCount, Histogram::kNoFlags));
-
-  // Put two samples "out of bounds" above and below.
-  histogram->Add(5);
-  histogram->Add(-50);
-
-  histogram->Add(100);
-  histogram->Add(10000);
-
-  // Verify they landed in the underflow, and overflow buckets.
-  Histogram::SampleSet sample;
-  histogram->SnapshotSample(&sample);
-  EXPECT_EQ(2, sample.counts(0));
-  EXPECT_EQ(0, sample.counts(1));
-  size_t array_size = histogram->bucket_count();
-  EXPECT_EQ(kBucketCount, array_size);
-  EXPECT_EQ(0, sample.counts(array_size - 2));
-  EXPECT_EQ(2, sample.counts(array_size - 1));
-}
-
-// Check to be sure samples land as expected is "correct" buckets.
-TEST(HistogramTest, BucketPlacementTest) {
-  Histogram* histogram(Histogram::FactoryGet(
-      "Histogram", 1, 64, 8, Histogram::kNoFlags));  // As per header file.
-
-  // Check that we got a nice exponential since there was enough rooom.
-  EXPECT_EQ(0, histogram->ranges(0));
-  int power_of_2 = 1;
-  for (int i = 1; i < 8; i++) {
-    EXPECT_EQ(power_of_2, histogram->ranges(i));
-    power_of_2 *= 2;
-  }
-  EXPECT_EQ(INT_MAX, histogram->ranges(8));
-
-  // Add i+1 samples to the i'th bucket.
-  histogram->Add(0);
-  power_of_2 = 1;
-  for (int i = 1; i < 8; i++) {
-    for (int j = 0; j <= i; j++)
-      histogram->Add(power_of_2);
-    power_of_2 *= 2;
-  }
-  // Leave overflow bucket empty.
-
-  // Check to see that the bucket counts reflect our additions.
-  Histogram::SampleSet sample;
-  histogram->SnapshotSample(&sample);
-  EXPECT_EQ(INT_MAX, histogram->ranges(8));
-  for (int i = 0; i < 8; i++)
-    EXPECT_EQ(i + 1, sample.counts(i));
-}
-
-}  // namespace
-
-//------------------------------------------------------------------------------
-// We can't be an an anonymous namespace while being friends, so we pop back
-// out to the base namespace here.  We need to be friends to corrupt the
-// internals of the histogram and/or sampleset.
-TEST(HistogramTest, CorruptSampleCounts) {
-  Histogram* histogram(Histogram::FactoryGet(
-      "Histogram", 1, 64, 8, Histogram::kNoFlags));  // As per header file.
-
-  EXPECT_EQ(0, histogram->sample_.redundant_count());
-  histogram->Add(20);  // Add some samples.
-  histogram->Add(40);
-  EXPECT_EQ(2, histogram->sample_.redundant_count());
-
-  Histogram::SampleSet snapshot;
-  histogram->SnapshotSample(&snapshot);
-  EXPECT_EQ(Histogram::NO_INCONSISTENCIES, 0);
-  EXPECT_EQ(0, histogram->FindCorruption(snapshot));  // No default corruption.
-  EXPECT_EQ(2, snapshot.redundant_count());
-
-  snapshot.counts_[3] += 100;  // Sample count won't match redundant count.
-  EXPECT_EQ(Histogram::COUNT_LOW_ERROR, histogram->FindCorruption(snapshot));
-  snapshot.counts_[2] -= 200;
-  EXPECT_EQ(Histogram::COUNT_HIGH_ERROR, histogram->FindCorruption(snapshot));
-
-  // But we can't spot a corruption if it is compensated for.
-  snapshot.counts_[1] += 100;
-  EXPECT_EQ(0, histogram->FindCorruption(snapshot));
-}
-
-TEST(HistogramTest, CorruptBucketBounds) {
-  Histogram* histogram(Histogram::FactoryGet(
-      "Histogram", 1, 64, 8, Histogram::kNoFlags));  // As per header file.
-
-  Histogram::SampleSet snapshot;
-  histogram->SnapshotSample(&snapshot);
-  EXPECT_EQ(Histogram::NO_INCONSISTENCIES, 0);
-  EXPECT_EQ(0, histogram->FindCorruption(snapshot));  // No default corruption.
-
-  std::swap(histogram->ranges_[1], histogram->ranges_[2]);
-  EXPECT_EQ(Histogram::BUCKET_ORDER_ERROR | Histogram::RANGE_CHECKSUM_ERROR,
-            histogram->FindCorruption(snapshot));
-
-  std::swap(histogram->ranges_[1], histogram->ranges_[2]);
-  EXPECT_EQ(0, histogram->FindCorruption(snapshot));
-
-  ++histogram->ranges_[3];
-  EXPECT_EQ(Histogram::RANGE_CHECKSUM_ERROR,
-            histogram->FindCorruption(snapshot));
-
-  // Show that two simple changes don't offset each other
-  --histogram->ranges_[4];
-  EXPECT_EQ(Histogram::RANGE_CHECKSUM_ERROR,
-            histogram->FindCorruption(snapshot));
-
-  // Repair histogram so that destructor won't DCHECK().
-  --histogram->ranges_[3];
-  ++histogram->ranges_[4];
-}
-
-// Table was generated similarly to sample code for CRC-32 given on:
-// http://www.w3.org/TR/PNG/#D-CRCAppendix.
-TEST(HistogramTest, Crc32TableTest) {
-  for (int i = 0; i < 256; ++i) {
-    uint32_t checksum = i;
-    for (int j = 0; j < 8; ++j) {
-      const uint32_t kReversedPolynomial = 0xedb88320L;
-      if (checksum & 1)
-        checksum = kReversedPolynomial ^ (checksum >> 1);
-      else
-        checksum >>= 1;
-    }
-    EXPECT_EQ(Histogram::kCrcTable[i], checksum);
-  }
-}
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/hmac_unittest.cc
+++ /dev/null
@@ -1,164 +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 <string>
-
-#include "base/hmac.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-static const int kDigestSize = 20;
-
-TEST(HMACTest, HmacSafeBrowsingResponseTest) {
-  const int kKeySize = 16;
-
-  // Client key.
-  const unsigned char kClientKey[kKeySize] =
-      { 0xbf, 0xf6, 0x83, 0x4b, 0x3e, 0xa3, 0x23, 0xdd,
-        0x96, 0x78, 0x70, 0x8e, 0xa1, 0x9d, 0x3b, 0x40 };
-
-  // Expected HMAC result using kMessage and kClientKey.
-  const unsigned char kReceivedHmac[kDigestSize] =
-      { 0xb9, 0x3c, 0xd6, 0xf0, 0x49, 0x47, 0xe2, 0x52,
-        0x59, 0x7a, 0xbd, 0x1f, 0x2b, 0x4c, 0x83, 0xad,
-        0x86, 0xd2, 0x48, 0x85 };
-
-  const char kMessage[] =
-"n:1896\ni:goog-malware-shavar\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shav"
-"ar_s_445-450\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_439-444\nu:s"
-".ytimg.com/safebrowsing/rd/goog-malware-shavar_s_437\nu:s.ytimg.com/safebrowsi"
-"ng/rd/goog-malware-shavar_s_436\nu:s.ytimg.com/safebrowsing/rd/goog-malware-sh"
-"avar_s_433-435\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_431\nu:s.y"
-"timg.com/safebrowsing/rd/goog-malware-shavar_s_430\nu:s.ytimg.com/safebrowsing"
-"/rd/goog-malware-shavar_s_429\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shav"
-"ar_s_428\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_426\nu:s.ytimg.c"
-"om/safebrowsing/rd/goog-malware-shavar_s_424\nu:s.ytimg.com/safebrowsing/rd/go"
-"og-malware-shavar_s_423\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_4"
-"22\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_420\nu:s.ytimg.com/saf"
-"ebrowsing/rd/goog-malware-shavar_s_419\nu:s.ytimg.com/safebrowsing/rd/goog-mal"
-"ware-shavar_s_414\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_409-411"
-"\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_405\nu:s.ytimg.com/safeb"
-"rowsing/rd/goog-malware-shavar_s_404\nu:s.ytimg.com/safebrowsing/rd/goog-malwa"
-"re-shavar_s_402\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_s_401\nu:s."
-"ytimg.com/safebrowsing/rd/goog-malware-shavar_a_973-978\nu:s.ytimg.com/safebro"
-"wsing/rd/goog-malware-shavar_a_937-972\nu:s.ytimg.com/safebrowsing/rd/goog-mal"
-"ware-shavar_a_931-936\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_a_925"
-"-930\nu:s.ytimg.com/safebrowsing/rd/goog-malware-shavar_a_919-924\ni:goog-phis"
-"h-shavar\nu:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_2633\nu:s.ytimg.co"
-"m/safebrowsing/rd/goog-phish-shavar_a_2632\nu:s.ytimg.com/safebrowsing/rd/goog"
-"-phish-shavar_a_2629-2631\nu:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_2"
-"626-2628\nu:s.ytimg.com/safebrowsing/rd/goog-phish-shavar_a_2625\n";
-
-  std::string message_data(kMessage);
-
-  base::HMAC hmac(base::HMAC::SHA1);
-  ASSERT_TRUE(hmac.Init(kClientKey, kKeySize));
-  unsigned char calculated_hmac[kDigestSize];
-
-  EXPECT_TRUE(hmac.Sign(message_data, calculated_hmac, kDigestSize));
-  EXPECT_EQ(memcmp(kReceivedHmac, calculated_hmac, kDigestSize), 0);
-}
-
-// Test cases from RFC 2202 section 3
-TEST(HMACTest, RFC2202TestCases) {
-  const struct {
-    const char *key;
-    const int key_len;
-    const char *data;
-    const int data_len;
-    const char *digest;
-  } cases[] = {
-    { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B"
-          "\x0B\x0B\x0B\x0B", 20,
-      "Hi There", 8,
-      "\xB6\x17\x31\x86\x55\x05\x72\x64\xE2\x8B\xC0\xB6\xFB\x37\x8C\x8E"
-          "\xF1\x46\xBE\x00" },
-    { "Jefe", 4,
-      "what do ya want for nothing?", 28,
-      "\xEF\xFC\xDF\x6A\xE5\xEB\x2F\xA2\xD2\x74\x16\xD5\xF1\x84\xDF\x9C"
-          "\x25\x9A\x7C\x79" },
-    { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA", 20,
-      "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
-          "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
-          "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
-          "\xDD\xDD", 50,
-      "\x12\x5D\x73\x42\xB9\xAC\x11\xCD\x91\xA3\x9A\xF4\x8A\xA1\x7B\x4F"
-          "\x63\xF1\x75\xD3" },
-    { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10"
-          "\x11\x12\x13\x14\x15\x16\x17\x18\x19", 25,
-      "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD"
-          "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD"
-          "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD"
-          "\xCD\xCD", 50,
-      "\x4C\x90\x07\xF4\x02\x62\x50\xC6\xBC\x84\x14\xF9\xBF\x50\xC8\x6C"
-          "\x2D\x72\x35\xDA" },
-    { "\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C"
-          "\x0C\x0C\x0C\x0C", 20,
-      "Test With Truncation", 20,
-      "\x4C\x1A\x03\x42\x4B\x55\xE0\x7F\xE7\xF2\x7B\xE1\xD5\x8B\xB9\x32"
-          "\x4A\x9A\x5A\x04" },
-    { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA",
-      80,
-      "Test Using Larger Than Block-Size Key - Hash Key First", 54,
-      "\xAA\x4A\xE5\xE1\x52\x72\xD0\x0E\x95\x70\x56\x37\xCE\x8A\x3B\x55"
-          "\xED\x40\x21\x12" },
-    { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-          "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA",
-      80,
-      "Test Using Larger Than Block-Size Key and Larger "
-          "Than One Block-Size Data", 73,
-      "\xE8\xE9\x9D\x0F\x45\x23\x7D\x78\x6D\x6B\xBA\xA7\x96\x5C\x78\x08"
-          "\xBB\xFF\x1A\x91" }
-  };
-
-  for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
-    base::HMAC hmac(base::HMAC::SHA1);
-    ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(cases[i].key),
-                          cases[i].key_len));
-    std::string data_string(cases[i].data, cases[i].data_len);
-    unsigned char digest[kDigestSize];
-    EXPECT_TRUE(hmac.Sign(data_string, digest, kDigestSize));
-    EXPECT_EQ(memcmp(cases[i].digest, digest, kDigestSize), 0);
-  }
-}
-
-TEST(HMACTest, HMACObjectReuse) {
-  const char *key =
-      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
-      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA";
-  const int key_len = 80;
-
-  const struct {
-    const char *data;
-    const int data_len;
-    const char *digest;
-  } cases[] = {
-    { "Test Using Larger Than Block-Size Key - Hash Key First", 54,
-      "\xAA\x4A\xE5\xE1\x52\x72\xD0\x0E\x95\x70\x56\x37\xCE\x8A\x3B\x55"
-          "\xED\x40\x21\x12" },
-    { "Test Using Larger Than Block-Size Key and Larger "
-          "Than One Block-Size Data", 73,
-      "\xE8\xE9\x9D\x0F\x45\x23\x7D\x78\x6D\x6B\xBA\xA7\x96\x5C\x78\x08"
-          "\xBB\xFF\x1A\x91" }
-  };
-
-  base::HMAC hmac(base::HMAC::SHA1);
-  ASSERT_TRUE(hmac.Init(reinterpret_cast<const unsigned char*>(key), key_len));
-  for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
-    std::string data_string(cases[i].data, cases[i].data_len);
-    unsigned char digest[kDigestSize];
-    EXPECT_TRUE(hmac.Sign(data_string, digest, kDigestSize));
-    EXPECT_EQ(memcmp(cases[i].digest, digest, kDigestSize), 0);
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/idletimer_unittest.cc
+++ /dev/null
@@ -1,240 +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 "base/idle_timer.h"
-#include "base/message_loop.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using base::Time;
-using base::TimeDelta;
-using base::IdleTimer;
-
-
-// If the timers fire too quickly, it can be tricky to make timer tests
-// reliable on all buildbots.  This constant sets a minimum timer delta where
-// we expect that we should be able to reliably count timers without problems
-// due to slight clock/scheduling variances.
-const int kSafeTestIntervalMs = 500;
-
-namespace {
-
-// We Mock the GetLastInputInfo function to return
-// the time stored here.
-static Time mock_timer_started;
-
-bool MockIdleTimeSource(int32_t *milliseconds_interval_since_last_event) {
-  TimeDelta delta = Time::Now() - mock_timer_started;
-  *milliseconds_interval_since_last_event =
-      static_cast<int32_t>(delta.InMilliseconds());
-  return true;
-}
-
-// TestIdle task fires after 100ms of idle time.
-class TestIdleTask : public IdleTimer {
- public:
-  TestIdleTask(bool repeat)
-      : IdleTimer(TimeDelta::FromMilliseconds(kSafeTestIntervalMs), repeat),
-        idle_counter_(0) {
-        set_idle_time_source(MockIdleTimeSource);
-  }
-
-  int get_idle_counter() { return idle_counter_; }
-
-  virtual void OnIdle() {
-    idle_counter_++;
-  }
-
- private:
-  int idle_counter_;
-};
-
-// A task to help us quit the test.
-class TestFinishedTask {
- public:
-  TestFinishedTask() {}
-  void Run() {
-    MessageLoop::current()->Quit();
-  }
-};
-
-// A timer which resets the idle clock.
-class ResetIdleTask {
- public:
-  ResetIdleTask() {}
-  void Run() {
-    mock_timer_started = Time::Now();
-  }
-};
-
-class IdleTimerTest : public testing::Test {
- private:
-  // IdleTimer requires a UI message loop on the current thread.
-  MessageLoopForUI message_loop_;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// NoRepeat tests:
-// A non-repeating idle timer will fire once on idle, and
-// then will not fire again unless it goes non-idle first.
-
-TEST_F(IdleTimerTest, NoRepeatIdle) {
-  // Create an IdleTimer, which should fire once after 500ms.
-  // Create a Quit timer which will fire after 1s.
-  // Verify that we fired exactly once.
-
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(false);
-
-  TestFinishedTask finish_task;
-  base::OneShotTimer<TestFinishedTask> timer;
-  timer.Start(TimeDelta::FromMilliseconds(2 * kSafeTestIntervalMs),
-      &finish_task, &TestFinishedTask::Run);
-
-  test_task.Start();
-  MessageLoop::current()->Run();
-
-  EXPECT_EQ(test_task.get_idle_counter(), 1);
-}
-
-TEST_F(IdleTimerTest, NoRepeatFlipIdleOnce) {
-  // Create an IdleTimer, which should fire once after 500ms.
-  // Create a Quit timer which will fire after 5s.
-  // Create a timer to reset once, idle after 2s.
-  // Verify that we fired exactly twice.
-
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(false);
-
-  TestFinishedTask finish_task;
-  ResetIdleTask reset_task;
-
-  base::OneShotTimer<TestFinishedTask> t1;
-  t1.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
-           &TestFinishedTask::Run);
-
-  base::OneShotTimer<ResetIdleTask> t2;
-  t2.Start(TimeDelta::FromMilliseconds(4 * kSafeTestIntervalMs), &reset_task,
-           &ResetIdleTask::Run);
-
-  test_task.Start();
-  MessageLoop::current()->Run();
-
-  EXPECT_EQ(test_task.get_idle_counter(), 2);
-}
-
-TEST_F(IdleTimerTest, NoRepeatNotIdle) {
-  // Create an IdleTimer, which should fire once after 500ms.
-  // Create a Quit timer which will fire after 5s.
-  // Create a timer to reset idle every 50ms.
-  // Verify that we never fired.
-
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(false);
-
-  TestFinishedTask finish_task;
-  ResetIdleTask reset_task;
-
-  base::OneShotTimer<TestFinishedTask> t;
-  t.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
-          &TestFinishedTask::Run);
-
-  base::RepeatingTimer<ResetIdleTask> reset_timer;
-  reset_timer.Start(TimeDelta::FromMilliseconds(50), &reset_task,
-                    &ResetIdleTask::Run);
-
-  test_task.Start();
-
-  MessageLoop::current()->Run();
-
-  reset_timer.Stop();
-
-  EXPECT_EQ(test_task.get_idle_counter(), 0);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Repeat tests:
-// A repeating idle timer will fire repeatedly on each interval, as long
-// as it has been idle.  So, if the machine remains idle, it will continue
-// firing over and over.
-
-TEST_F(IdleTimerTest, Repeat) {
-  // Create an IdleTimer, which should fire repeatedly after 500ms.
-  // Create a Quit timer which will fire after 1.5s.
-  // Verify that we fired 2-3 times.
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(true);
-
-  TestFinishedTask finish_task;
-
-  base::OneShotTimer<TestFinishedTask> t;
-  t.Start(TimeDelta::FromMilliseconds(kSafeTestIntervalMs * 3), &finish_task,
-          &TestFinishedTask::Run);
-
-  test_task.Start();
-  MessageLoop::current()->Run();
-
-  // In a perfect world, the idle_counter should be 2.  However,
-  // due to timer 'slop', accept 2 or 3.
-  EXPECT_GE(test_task.get_idle_counter(), 2);
-  EXPECT_LE(test_task.get_idle_counter(), 3);
-}
-
-TEST_F(IdleTimerTest, RepeatIdleReset) {
-  // Create an IdleTimer, which should fire repeatedly after 500ms.
-  // Create a Quit timer which will fire after 5s.
-  // Create a reset timer, which fires after 2500ms
-  // Verify that we fired 8-10 times.
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(true);
-
-  ResetIdleTask reset_task;
-  TestFinishedTask finish_task;
-
-  base::OneShotTimer<TestFinishedTask> t1;
-  t1.Start(TimeDelta::FromMilliseconds(10 * kSafeTestIntervalMs), &finish_task,
-           &TestFinishedTask::Run);
-
-  base::OneShotTimer<ResetIdleTask> t2;
-  t2.Start(TimeDelta::FromMilliseconds(5 * kSafeTestIntervalMs), &reset_task,
-           &ResetIdleTask::Run);
-
-  test_task.Start();
-  MessageLoop::current()->Run();
-
-  // In a perfect world, the idle_counter should be 9.  However,
-  // since timers aren't guaranteed to fire perfectly, this can
-  // be less.  Accept 8-10.
-  EXPECT_GE(test_task.get_idle_counter(), 8);
-  EXPECT_LE(test_task.get_idle_counter(), 10);
-}
-
-TEST_F(IdleTimerTest, RepeatNotIdle) {
-  // Create an IdleTimer, which should fire repeatedly after 500ms.
-  // Create a Quit timer which will fire after 4s.
-  // Create a timer to reset idle every 50ms.
-  // Verify that we never fired.
-
-  mock_timer_started = Time::Now();
-  TestIdleTask test_task(true);
-
-  TestFinishedTask finish_task;
-  ResetIdleTask reset_task;
-
-  base::OneShotTimer<TestFinishedTask> t;
-  t.Start(TimeDelta::FromMilliseconds(8 * kSafeTestIntervalMs), &finish_task,
-          &TestFinishedTask::Run);
-
-  base::RepeatingTimer<ResetIdleTask> reset_timer;
-  reset_timer.Start(TimeDelta::FromMilliseconds(50), &reset_task,
-                    &ResetIdleTask::Run);
-
-  test_task.Start();
-  MessageLoop::current()->Run();
-
-  reset_timer.Stop();
-
-  EXPECT_EQ(test_task.get_idle_counter(), 0);
-}
-
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/lazy_instance_unittest.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 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 "base/at_exit.h"
-#include "base/atomic_sequence_num.h"
-#include "base/lazy_instance.h"
-#include "base/simple_thread.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class ShadowingAtExitManager : public base::AtExitManager {
- public:
-  ShadowingAtExitManager() : AtExitManager(true) { }
-};
-
-base::AtomicSequenceNumber constructed_seq_(base::LINKER_INITIALIZED);
-base::AtomicSequenceNumber destructed_seq_(base::LINKER_INITIALIZED);
-
-class ConstructAndDestructLogger {
- public:
-  ConstructAndDestructLogger() {
-    constructed_seq_.GetNext();
-  }
-  ~ConstructAndDestructLogger() {
-    destructed_seq_.GetNext();
-  }
-};
-
-class SlowConstructor {
- public:
-  SlowConstructor() : some_int_(0) {
-    PlatformThread::Sleep(1000);  // Sleep for 1 second to try to cause a race.
-    ++constructed;
-    some_int_ = 12;
-  }
-  int some_int() const { return some_int_; }
-
-  static int constructed;
- private:
-  int some_int_;
-};
-
-int SlowConstructor::constructed = 0;
-
-class SlowDelegate : public base::DelegateSimpleThread::Delegate {
- public:
-  SlowDelegate(base::LazyInstance<SlowConstructor>* lazy) : lazy_(lazy) { }
-  virtual void Run() {
-    EXPECT_EQ(12, lazy_->Get().some_int());
-    EXPECT_EQ(12, lazy_->Pointer()->some_int());
-  }
-
- private:
-  base::LazyInstance<SlowConstructor>* lazy_;
-};
-
-}  // namespace
-
-static base::LazyInstance<ConstructAndDestructLogger> lazy_logger(
-    base::LINKER_INITIALIZED);
-
-TEST(LazyInstanceTest, Basic) {
-  {
-    ShadowingAtExitManager shadow;
-
-    EXPECT_EQ(0, constructed_seq_.GetNext());
-    EXPECT_EQ(0, destructed_seq_.GetNext());
-
-    lazy_logger.Get();
-    EXPECT_EQ(2, constructed_seq_.GetNext());
-    EXPECT_EQ(1, destructed_seq_.GetNext());
-
-    lazy_logger.Pointer();
-    EXPECT_EQ(3, constructed_seq_.GetNext());
-    EXPECT_EQ(2, destructed_seq_.GetNext());
-  }
-  EXPECT_EQ(4, constructed_seq_.GetNext());
-  EXPECT_EQ(4, destructed_seq_.GetNext());
-}
-
-static base::LazyInstance<SlowConstructor> lazy_slow(base::LINKER_INITIALIZED);
-
-TEST(LazyInstanceTest, ConstructorThreadSafety) {
-  {
-    ShadowingAtExitManager shadow;
-
-    SlowDelegate delegate(&lazy_slow);
-    EXPECT_EQ(0, SlowConstructor::constructed);
-
-    base::DelegateSimpleThreadPool pool("lazy_instance_cons", 5);
-    pool.AddWork(&delegate, 20);
-    EXPECT_EQ(0, SlowConstructor::constructed);
-
-    pool.Start();
-    pool.JoinAll();
-    EXPECT_EQ(1, SlowConstructor::constructed);
-  }
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/linked_ptr_unittest.cc
+++ /dev/null
@@ -1,110 +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 <string>
-#include <iostream>
-
-#include "base/linked_ptr.h"
-
-#include "base/string_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-int num = 0;
-
-std::string history;
-
-// Class which tracks allocation/deallocation
-struct A {
-  A(): mynum(num++) { history += StringPrintf("A%d ctor\n", mynum); }
-  virtual ~A() { history += StringPrintf("A%d dtor\n", mynum); }
-  virtual void Use() { history += StringPrintf("A%d use\n", mynum); }
-  int mynum;
-};
-
-// Subclass
-struct B: public A {
-  B() { history += StringPrintf("B%d ctor\n", mynum); }
-  ~B() { history += StringPrintf("B%d dtor\n", mynum); }
-  virtual void Use() { history += StringPrintf("B%d use\n", mynum); }
-};
-
-}  // namespace
-
-TEST(LinkedPtrTest, Test) {
-  {
-    linked_ptr<A> a0, a1, a2;
-    a0 = a0;
-    a1 = a2;
-    ASSERT_EQ(a0.get(), static_cast<A*>(NULL));
-    ASSERT_EQ(a1.get(), static_cast<A*>(NULL));
-    ASSERT_EQ(a2.get(), static_cast<A*>(NULL));
-    ASSERT_TRUE(a0 == NULL);
-    ASSERT_TRUE(a1 == NULL);
-    ASSERT_TRUE(a2 == NULL);
-
-    {
-      linked_ptr<A> a3(new A);
-      a0 = a3;
-      ASSERT_TRUE(a0 == a3);
-      ASSERT_TRUE(a0 != NULL);
-      ASSERT_TRUE(a0.get() == a3);
-      ASSERT_TRUE(a0 == a3.get());
-      linked_ptr<A> a4(a0);
-      a1 = a4;
-      linked_ptr<A> a5(new A);
-      ASSERT_TRUE(a5.get() != a3);
-      ASSERT_TRUE(a5 != a3.get());
-      a2 = a5;
-      linked_ptr<B> b0(new B);
-      linked_ptr<A> a6(b0);
-      ASSERT_TRUE(b0 == a6);
-      ASSERT_TRUE(a6 == b0);
-      ASSERT_TRUE(b0 != NULL);
-      a5 = b0;
-      a5 = b0;
-      a3->Use();
-      a4->Use();
-      a5->Use();
-      a6->Use();
-      b0->Use();
-      (*b0).Use();
-      b0.get()->Use();
-    }
-
-    a0->Use();
-    a1->Use();
-    a2->Use();
-
-    a1 = a2;
-    a2.reset(new A);
-    a0.reset();
-
-    linked_ptr<A> a7;
-  }
-
-  ASSERT_EQ(history,
-    "A0 ctor\n"
-    "A1 ctor\n"
-    "A2 ctor\n"
-    "B2 ctor\n"
-    "A0 use\n"
-    "A0 use\n"
-    "B2 use\n"
-    "B2 use\n"
-    "B2 use\n"
-    "B2 use\n"
-    "B2 use\n"
-    "B2 dtor\n"
-    "A2 dtor\n"
-    "A0 use\n"
-    "A0 use\n"
-    "A1 use\n"
-    "A3 ctor\n"
-    "A0 dtor\n"
-    "A3 dtor\n"
-    "A1 dtor\n"
-  );
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/mac_util_unittest.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 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 "base/mac_util.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
-
-typedef PlatformTest MacUtilTest;
-
-TEST_F(MacUtilTest, TestFSRef) {
-  FSRef ref;
-  std::string path("/System/Library");
-
-  ASSERT_TRUE(mac_util::FSRefFromPath(path, &ref));
-  EXPECT_EQ(path, mac_util::PathFromFSRef(ref));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/message_loop_unittest.cc
+++ /dev/null
@@ -1,1458 +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 "base/logging.h"
-#include "base/message_loop.h"
-#include "base/platform_thread.h"
-#include "base/ref_counted.h"
-#include "base/thread.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(OS_WIN)
-#include "base/message_pump_win.h"
-#include "base/scoped_handle.h"
-#endif
-#if defined(OS_POSIX)
-#include "base/message_pump_libevent.h"
-#endif
-
-using base::Thread;
-using base::Time;
-using base::TimeDelta;
-
-// TODO(darin): Platform-specific MessageLoop tests should be grouped together
-// to avoid chopping this file up with so many #ifdefs.
-
-namespace {
-
-class MessageLoopTest : public testing::Test {};
-
-class Foo : public base::RefCounted<Foo> {
- public:
-  Foo() : test_count_(0) {
-  }
-
-  void Test0() {
-    ++test_count_;
-  }
-
-  void Test1ConstRef(const std::string& a) {
-    ++test_count_;
-    result_.append(a);
-  }
-
-  void Test1Ptr(std::string* a) {
-    ++test_count_;
-    result_.append(*a);
-  }
-
-  void Test1Int(int a) {
-    test_count_ += a;
-  }
-
-  void Test2Ptr(std::string* a, std::string* b) {
-    ++test_count_;
-    result_.append(*a);
-    result_.append(*b);
-  }
-
-  void Test2Mixed(const std::string& a, std::string* b) {
-    ++test_count_;
-    result_.append(a);
-    result_.append(*b);
-  }
-
-  int test_count() const { return test_count_; }
-  const std::string& result() const { return result_; }
-
- private:
-  int test_count_;
-  std::string result_;
-};
-
-class QuitMsgLoop : public base::RefCounted<QuitMsgLoop> {
- public:
-  void QuitNow() {
-    MessageLoop::current()->Quit();
-  }
-};
-
-void RunTest_PostTask(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Add tests to message loop
-  scoped_refptr<Foo> foo = new Foo();
-  std::string a("a"), b("b"), c("c"), d("d");
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test0));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-    foo.get(), &Foo::Test1ConstRef, a));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test1Ptr, &b));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test1Int, 100));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test2Ptr, &a, &c));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-    foo.get(), &Foo::Test2Mixed, a, &d));
-
-  // After all tests, post a message that will shut down the message loop
-  scoped_refptr<QuitMsgLoop> quit = new QuitMsgLoop();
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      quit.get(), &QuitMsgLoop::QuitNow));
-
-  // Now kick things off
-  MessageLoop::current()->Run();
-
-  EXPECT_EQ(foo->test_count(), 105);
-  EXPECT_EQ(foo->result(), "abacad");
-}
-
-void RunTest_PostTask_SEH(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Add tests to message loop
-  scoped_refptr<Foo> foo = new Foo();
-  std::string a("a"), b("b"), c("c"), d("d");
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test0));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test1ConstRef, a));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test1Ptr, &b));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test1Int, 100));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test2Ptr, &a, &c));
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      foo.get(), &Foo::Test2Mixed, a, &d));
-
-  // After all tests, post a message that will shut down the message loop
-  scoped_refptr<QuitMsgLoop> quit = new QuitMsgLoop();
-  MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
-      quit.get(), &QuitMsgLoop::QuitNow));
-
-  // Now kick things off with the SEH block active.
-  MessageLoop::current()->set_exception_restoration(true);
-  MessageLoop::current()->Run();
-  MessageLoop::current()->set_exception_restoration(false);
-
-  EXPECT_EQ(foo->test_count(), 105);
-  EXPECT_EQ(foo->result(), "abacad");
-}
-
-// This class runs slowly to simulate a large amount of work being done.
-class SlowTask : public Task {
- public:
-  SlowTask(int pause_ms, int* quit_counter)
-      : pause_ms_(pause_ms), quit_counter_(quit_counter) {
-  }
-  virtual void Run() {
-    PlatformThread::Sleep(pause_ms_);
-    if (--(*quit_counter_) == 0)
-      MessageLoop::current()->Quit();
-  }
- private:
-  int pause_ms_;
-  int* quit_counter_;
-};
-
-// This class records the time when Run was called in a Time object, which is
-// useful for building a variety of MessageLoop tests.
-class RecordRunTimeTask : public SlowTask {
- public:
-  RecordRunTimeTask(Time* run_time, int* quit_counter)
-      : SlowTask(10, quit_counter), run_time_(run_time) {
-  }
-  virtual void Run() {
-    *run_time_ = Time::Now();
-    // Cause our Run function to take some time to execute.  As a result we can
-    // count on subsequent RecordRunTimeTask objects running at a future time,
-    // without worry about the resolution of our system clock being an issue.
-    SlowTask::Run();
-  }
- private:
-  Time* run_time_;
-};
-
-void RunTest_PostDelayedTask_Basic(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that PostDelayedTask results in a delayed task.
-
-  const int kDelayMS = 100;
-
-  int num_tasks = 1;
-  Time run_time;
-
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time, &num_tasks), kDelayMS);
-
-  Time time_before_run = Time::Now();
-  loop.Run();
-  Time time_after_run = Time::Now();
-
-  EXPECT_EQ(0, num_tasks);
-  EXPECT_LT(kDelayMS, (time_after_run - time_before_run).InMilliseconds());
-}
-
-void RunTest_PostDelayedTask_InDelayOrder(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that two tasks with different delays run in the right order.
-
-  int num_tasks = 2;
-  Time run_time1, run_time2;
-
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time1, &num_tasks), 200);
-  // If we get a large pause in execution (due to a context switch) here, this
-  // test could fail.
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time2, &num_tasks), 10);
-
-  loop.Run();
-  EXPECT_EQ(0, num_tasks);
-
-  EXPECT_TRUE(run_time2 < run_time1);
-}
-
-void RunTest_PostDelayedTask_InPostOrder(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that two tasks with the same delay run in the order in which they
-  // were posted.
-  //
-  // NOTE: This is actually an approximate test since the API only takes a
-  // "delay" parameter, so we are not exactly simulating two tasks that get
-  // posted at the exact same time.  It would be nice if the API allowed us to
-  // specify the desired run time.
-
-  const int kDelayMS = 100;
-
-  int num_tasks = 2;
-  Time run_time1, run_time2;
-
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time1, &num_tasks), kDelayMS);
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time2, &num_tasks), kDelayMS);
-
-  loop.Run();
-  EXPECT_EQ(0, num_tasks);
-
-  EXPECT_TRUE(run_time1 < run_time2);
-}
-
-void RunTest_PostDelayedTask_InPostOrder_2(
-    MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that a delayed task still runs after a normal tasks even if the
-  // normal tasks take a long time to run.
-
-  const int kPauseMS = 50;
-
-  int num_tasks = 2;
-  Time run_time;
-
-  loop.PostTask(
-      FROM_HERE, new SlowTask(kPauseMS, &num_tasks));
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time, &num_tasks), 10);
-
-  Time time_before_run = Time::Now();
-  loop.Run();
-  Time time_after_run = Time::Now();
-
-  EXPECT_EQ(0, num_tasks);
-
-  EXPECT_LT(kPauseMS, (time_after_run - time_before_run).InMilliseconds());
-}
-
-void RunTest_PostDelayedTask_InPostOrder_3(
-    MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that a delayed task still runs after a pile of normal tasks.  The key
-  // difference between this test and the previous one is that here we return
-  // the MessageLoop a lot so we give the MessageLoop plenty of opportunities
-  // to maybe run the delayed task.  It should know not to do so until the
-  // delayed task's delay has passed.
-
-  int num_tasks = 11;
-  Time run_time1, run_time2;
-
-  // Clutter the ML with tasks.
-  for (int i = 1; i < num_tasks; ++i)
-    loop.PostTask(FROM_HERE, new RecordRunTimeTask(&run_time1, &num_tasks));
-
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time2, &num_tasks), 1);
-
-  loop.Run();
-  EXPECT_EQ(0, num_tasks);
-
-  EXPECT_TRUE(run_time2 > run_time1);
-}
-
-void RunTest_PostDelayedTask_SharedTimer(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  // Test that the interval of the timer, used to run the next delayed task, is
-  // set to a value corresponding to when the next delayed task should run.
-
-  // By setting num_tasks to 1, we ensure that the first task to run causes the
-  // run loop to exit.
-  int num_tasks = 1;
-  Time run_time1, run_time2;
-
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time1, &num_tasks), 1000000);
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time2, &num_tasks), 10);
-
-  Time start_time = Time::Now();
-
-  loop.Run();
-  EXPECT_EQ(0, num_tasks);
-
-  // Ensure that we ran in far less time than the slower timer.
-  TimeDelta total_time = Time::Now() - start_time;
-  EXPECT_GT(5000, total_time.InMilliseconds());
-
-  // In case both timers somehow run at nearly the same time, sleep a little
-  // and then run all pending to force them both to have run.  This is just
-  // encouraging flakiness if there is any.
-  PlatformThread::Sleep(100);
-  loop.RunAllPending();
-
-  EXPECT_TRUE(run_time1.is_null());
-  EXPECT_FALSE(run_time2.is_null());
-}
-
-#if defined(OS_WIN)
-
-class SubPumpTask : public Task {
- public:
-  virtual void Run() {
-    MessageLoop::current()->SetNestableTasksAllowed(true);
-    MSG msg;
-    while (GetMessage(&msg, NULL, 0, 0)) {
-      TranslateMessage(&msg);
-      DispatchMessage(&msg);
-    }
-    MessageLoop::current()->Quit();
-  }
-};
-
-class SubPumpQuitTask : public Task {
- public:
-  SubPumpQuitTask() {
-  }
-  virtual void Run() {
-    PostQuitMessage(0);
-  }
-};
-
-void RunTest_PostDelayedTask_SharedTimer_SubPump() {
-  MessageLoop loop(MessageLoop::TYPE_UI);
-
-  // Test that the interval of the timer, used to run the next delayed task, is
-  // set to a value corresponding to when the next delayed task should run.
-
-  // By setting num_tasks to 1, we ensure that the first task to run causes the
-  // run loop to exit.
-  int num_tasks = 1;
-  Time run_time;
-
-  loop.PostTask(FROM_HERE, new SubPumpTask());
-
-  // This very delayed task should never run.
-  loop.PostDelayedTask(
-      FROM_HERE, new RecordRunTimeTask(&run_time, &num_tasks), 1000000);
-
-  // This slightly delayed task should run from within SubPumpTask::Run().
-  loop.PostDelayedTask(
-      FROM_HERE, new SubPumpQuitTask(), 10);
-
-  Time start_time = Time::Now();
-
-  loop.Run();
-  EXPECT_EQ(1, num_tasks);
-
-  // Ensure that we ran in far less time than the slower timer.
-  TimeDelta total_time = Time::Now() - start_time;
-  EXPECT_GT(5000, total_time.InMilliseconds());
-
-  // In case both timers somehow run at nearly the same time, sleep a little
-  // and then run all pending to force them both to have run.  This is just
-  // encouraging flakiness if there is any.
-  PlatformThread::Sleep(100);
-  loop.RunAllPending();
-
-  EXPECT_TRUE(run_time.is_null());
-}
-
-#endif  // defined(OS_WIN)
-
-class RecordDeletionTask : public Task {
- public:
-  RecordDeletionTask(Task* post_on_delete, bool* was_deleted)
-      : post_on_delete_(post_on_delete), was_deleted_(was_deleted) {
-  }
-  ~RecordDeletionTask() {
-    *was_deleted_ = true;
-    if (post_on_delete_)
-      MessageLoop::current()->PostTask(FROM_HERE, post_on_delete_);
-  }
-  virtual void Run() {}
- private:
-  Task* post_on_delete_;
-  bool* was_deleted_;
-};
-
-void RunTest_EnsureTaskDeletion(MessageLoop::Type message_loop_type) {
-  bool a_was_deleted = false;
-  bool b_was_deleted = false;
-  {
-    MessageLoop loop(message_loop_type);
-    loop.PostTask(
-        FROM_HERE, new RecordDeletionTask(NULL, &a_was_deleted));
-    loop.PostDelayedTask(
-        FROM_HERE, new RecordDeletionTask(NULL, &b_was_deleted), 1000);
-  }
-  EXPECT_TRUE(a_was_deleted);
-  EXPECT_TRUE(b_was_deleted);
-}
-
-void RunTest_EnsureTaskDeletion_Chain(MessageLoop::Type message_loop_type) {
-  bool a_was_deleted = false;
-  bool b_was_deleted = false;
-  bool c_was_deleted = false;
-  {
-    MessageLoop loop(message_loop_type);
-    RecordDeletionTask* a = new RecordDeletionTask(NULL, &a_was_deleted);
-    RecordDeletionTask* b = new RecordDeletionTask(a, &b_was_deleted);
-    RecordDeletionTask* c = new RecordDeletionTask(b, &c_was_deleted);
-    loop.PostTask(FROM_HERE, c);
-  }
-  EXPECT_TRUE(a_was_deleted);
-  EXPECT_TRUE(b_was_deleted);
-  EXPECT_TRUE(c_was_deleted);
-}
-
-class NestingTest : public Task {
- public:
-  explicit NestingTest(int* depth) : depth_(depth) {
-  }
-  void Run() {
-    if (*depth_ > 0) {
-      *depth_ -= 1;
-      MessageLoop::current()->PostTask(FROM_HERE, new NestingTest(depth_));
-
-      MessageLoop::current()->SetNestableTasksAllowed(true);
-      MessageLoop::current()->Run();
-    }
-    MessageLoop::current()->Quit();
-  }
- private:
-  int* depth_;
-};
-
-#if defined(OS_WIN)
-
-LONG WINAPI BadExceptionHandler(EXCEPTION_POINTERS *ex_info) {
-  ADD_FAILURE() << "bad exception handler";
-  ::ExitProcess(ex_info->ExceptionRecord->ExceptionCode);
-  return EXCEPTION_EXECUTE_HANDLER;
-}
-
-// This task throws an SEH exception: initially write to an invalid address.
-// If the right SEH filter is installed, it will fix the error.
-class CrasherTask : public Task {
- public:
-  // Ctor. If trash_SEH_handler is true, the task will override the unhandled
-  // exception handler with one sure to crash this test.
-  explicit CrasherTask(bool trash_SEH_handler)
-      : trash_SEH_handler_(trash_SEH_handler) {
-  }
-  void Run() {
-    PlatformThread::Sleep(1);
-    if (trash_SEH_handler_)
-      ::SetUnhandledExceptionFilter(&BadExceptionHandler);
-    // Generate a SEH fault. We do it in asm to make sure we know how to undo
-    // the damage.
-
-#if defined(_M_IX86)
-
-    __asm {
-      mov eax, dword ptr [CrasherTask::bad_array_]
-      mov byte ptr [eax], 66
-    }
-
-#elif defined(_M_X64)
-
-    bad_array_[0] = 66;
-
-#else
-#error "needs architecture support"
-#endif
-
-    MessageLoop::current()->Quit();
-  }
-  // Points the bad array to a valid memory location.
-  static void FixError() {
-    bad_array_ = &valid_store_;
-  }
-
- private:
-  bool trash_SEH_handler_;
-  static volatile char* bad_array_;
-  static char valid_store_;
-};
-
-volatile char* CrasherTask::bad_array_ = 0;
-char CrasherTask::valid_store_ = 0;
-
-// This SEH filter fixes the problem and retries execution. Fixing requires
-// that the last instruction: mov eax, [CrasherTask::bad_array_] to be retried
-// so we move the instruction pointer 5 bytes back.
-LONG WINAPI HandleCrasherTaskException(EXCEPTION_POINTERS *ex_info) {
-  if (ex_info->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION)
-    return EXCEPTION_EXECUTE_HANDLER;
-
-  CrasherTask::FixError();
-
-#if defined(_M_IX86)
-
-  ex_info->ContextRecord->Eip -= 5;
-
-#elif defined(_M_X64)
-
-  ex_info->ContextRecord->Rip -= 5;
-
-#endif
-
-  return EXCEPTION_CONTINUE_EXECUTION;
-}
-
-void RunTest_Crasher(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  if (::IsDebuggerPresent())
-    return;
-
-  LPTOP_LEVEL_EXCEPTION_FILTER old_SEH_filter =
-      ::SetUnhandledExceptionFilter(&HandleCrasherTaskException);
-
-  MessageLoop::current()->PostTask(FROM_HERE, new CrasherTask(false));
-  MessageLoop::current()->set_exception_restoration(true);
-  MessageLoop::current()->Run();
-  MessageLoop::current()->set_exception_restoration(false);
-
-  ::SetUnhandledExceptionFilter(old_SEH_filter);
-}
-
-void RunTest_CrasherNasty(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  if (::IsDebuggerPresent())
-    return;
-
-  LPTOP_LEVEL_EXCEPTION_FILTER old_SEH_filter =
-      ::SetUnhandledExceptionFilter(&HandleCrasherTaskException);
-
-  MessageLoop::current()->PostTask(FROM_HERE, new CrasherTask(true));
-  MessageLoop::current()->set_exception_restoration(true);
-  MessageLoop::current()->Run();
-  MessageLoop::current()->set_exception_restoration(false);
-
-  ::SetUnhandledExceptionFilter(old_SEH_filter);
-}
-
-#endif  // defined(OS_WIN)
-
-void RunTest_Nesting(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  int depth = 100;
-  MessageLoop::current()->PostTask(FROM_HERE, new NestingTest(&depth));
-  MessageLoop::current()->Run();
-  EXPECT_EQ(depth, 0);
-}
-
-const wchar_t* const kMessageBoxTitle = L"MessageLoop Unit Test";
-
-enum TaskType {
-  MESSAGEBOX,
-  ENDDIALOG,
-  RECURSIVE,
-  TIMEDMESSAGELOOP,
-  QUITMESSAGELOOP,
-  ORDERERD,
-  PUMPS,
-};
-
-// Saves the order in which the tasks executed.
-struct TaskItem {
-  TaskItem(TaskType t, int c, bool s)
-      : type(t),
-        cookie(c),
-        start(s) {
-  }
-
-  TaskType type;
-  int cookie;
-  bool start;
-
-  bool operator == (const TaskItem& other) const {
-    return type == other.type && cookie == other.cookie && start == other.start;
-  }
-};
-
-typedef std::vector<TaskItem> TaskList;
-
-std::ostream& operator <<(std::ostream& os, TaskType type) {
-  switch (type) {
-  case MESSAGEBOX:        os << "MESSAGEBOX"; break;
-  case ENDDIALOG:         os << "ENDDIALOG"; break;
-  case RECURSIVE:         os << "RECURSIVE"; break;
-  case TIMEDMESSAGELOOP:  os << "TIMEDMESSAGELOOP"; break;
-  case QUITMESSAGELOOP:   os << "QUITMESSAGELOOP"; break;
-  case ORDERERD:          os << "ORDERERD"; break;
-  case PUMPS:             os << "PUMPS"; break;
-  default:
-    NOTREACHED();
-    os << "Unknown TaskType";
-    break;
-  }
-  return os;
-}
-
-std::ostream& operator <<(std::ostream& os, const TaskItem& item) {
-  if (item.start)
-    return os << item.type << " " << item.cookie << " starts";
-  else
-    return os << item.type << " " << item.cookie << " ends";
-}
-
-// Saves the order the tasks ran.
-class OrderedTasks : public Task {
- public:
-  OrderedTasks(TaskList* order, int cookie)
-      : order_(order),
-        type_(ORDERERD),
-        cookie_(cookie) {
-  }
-  OrderedTasks(TaskList* order, TaskType type, int cookie)
-      : order_(order),
-        type_(type),
-        cookie_(cookie) {
-  }
-
-  void RunStart() {
-    TaskItem item(type_, cookie_, true);
-    DLOG(INFO) << item;
-    order_->push_back(item);
-  }
-  void RunEnd() {
-    TaskItem item(type_, cookie_, false);
-    DLOG(INFO) << item;
-    order_->push_back(item);
-  }
-
-  virtual void Run() {
-    RunStart();
-    RunEnd();
-  }
-
- protected:
-  TaskList* order() const {
-    return order_;
-  }
-
-  int cookie() const {
-    return cookie_;
-  }
-
- private:
-  TaskList* order_;
-  TaskType type_;
-  int cookie_;
-};
-
-#if defined(OS_WIN)
-
-// MessageLoop implicitly start a "modal message loop". Modal dialog boxes,
-// common controls (like OpenFile) and StartDoc printing function can cause
-// implicit message loops.
-class MessageBoxTask : public OrderedTasks {
- public:
-  MessageBoxTask(TaskList* order, int cookie, bool is_reentrant)
-      : OrderedTasks(order, MESSAGEBOX, cookie),
-        is_reentrant_(is_reentrant) {
-  }
-
-  virtual void Run() {
-    RunStart();
-    if (is_reentrant_)
-      MessageLoop::current()->SetNestableTasksAllowed(true);
-    MessageBox(NULL, L"Please wait...", kMessageBoxTitle, MB_OK);
-    RunEnd();
-  }
-
- private:
-  bool is_reentrant_;
-};
-
-// Will end the MessageBox.
-class EndDialogTask : public OrderedTasks {
- public:
-  EndDialogTask(TaskList* order, int cookie)
-      : OrderedTasks(order, ENDDIALOG, cookie) {
-  }
-
-  virtual void Run() {
-    RunStart();
-    HWND window = GetActiveWindow();
-    if (window != NULL) {
-      EXPECT_NE(EndDialog(window, IDCONTINUE), 0);
-      // Cheap way to signal that the window wasn't found if RunEnd() isn't
-      // called.
-      RunEnd();
-    }
-  }
-};
-
-#endif  // defined(OS_WIN)
-
-class RecursiveTask : public OrderedTasks {
- public:
-  RecursiveTask(int depth, TaskList* order, int cookie, bool is_reentrant)
-      : OrderedTasks(order, RECURSIVE, cookie),
-        depth_(depth),
-        is_reentrant_(is_reentrant) {
-  }
-
-  virtual void Run() {
-    RunStart();
-    if (depth_ > 0) {
-      if (is_reentrant_)
-        MessageLoop::current()->SetNestableTasksAllowed(true);
-      MessageLoop::current()->PostTask(FROM_HERE,
-          new RecursiveTask(depth_ - 1, order(), cookie(), is_reentrant_));
-    }
-    RunEnd();
-  }
-
- private:
-  int depth_;
-  bool is_reentrant_;
-};
-
-class QuitTask : public OrderedTasks {
- public:
-  QuitTask(TaskList* order, int cookie)
-      : OrderedTasks(order, QUITMESSAGELOOP, cookie) {
-  }
-
-  virtual void Run() {
-    RunStart();
-    MessageLoop::current()->Quit();
-    RunEnd();
-  }
-};
-
-#if defined(OS_WIN)
-
-class Recursive2Tasks : public Task {
- public:
-  Recursive2Tasks(MessageLoop* target,
-                  HANDLE event,
-                  bool expect_window,
-                  TaskList* order,
-                  bool is_reentrant)
-      : target_(target),
-        event_(event),
-        expect_window_(expect_window),
-        order_(order),
-        is_reentrant_(is_reentrant) {
-  }
-
-  virtual void Run() {
-    target_->PostTask(FROM_HERE,
-                      new RecursiveTask(2, order_, 1, is_reentrant_));
-    target_->PostTask(FROM_HERE,
-                      new MessageBoxTask(order_, 2, is_reentrant_));
-    target_->PostTask(FROM_HERE,
-                      new RecursiveTask(2, order_, 3, is_reentrant_));
-    // The trick here is that for recursive task processing, this task will be
-    // ran _inside_ the MessageBox message loop, dismissing the MessageBox
-    // without a chance.
-    // For non-recursive task processing, this will be executed _after_ the
-    // MessageBox will have been dismissed by the code below, where
-    // expect_window_ is true.
-    target_->PostTask(FROM_HERE, new EndDialogTask(order_, 4));
-    target_->PostTask(FROM_HERE, new QuitTask(order_, 5));
-
-    // Enforce that every tasks are sent before starting to run the main thread
-    // message loop.
-    ASSERT_TRUE(SetEvent(event_));
-
-    // Poll for the MessageBox. Don't do this at home! At the speed we do it,
-    // you will never realize one MessageBox was shown.
-    for (; expect_window_;) {
-      HWND window = FindWindow(L"#32770", kMessageBoxTitle);
-      if (window) {
-        // Dismiss it.
-        for (;;) {
-          HWND button = FindWindowEx(window, NULL, L"Button", NULL);
-          if (button != NULL) {
-            EXPECT_TRUE(0 == SendMessage(button, WM_LBUTTONDOWN, 0, 0));
-            EXPECT_TRUE(0 == SendMessage(button, WM_LBUTTONUP, 0, 0));
-            break;
-          }
-        }
-        break;
-      }
-    }
-  }
-
- private:
-  MessageLoop* target_;
-  HANDLE event_;
-  TaskList* order_;
-  bool expect_window_;
-  bool is_reentrant_;
-};
-
-#endif  // defined(OS_WIN)
-
-void RunTest_RecursiveDenial1(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  EXPECT_TRUE(MessageLoop::current()->NestableTasksAllowed());
-  TaskList order;
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new RecursiveTask(2, &order, 1, false));
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new RecursiveTask(2, &order, 2, false));
-  MessageLoop::current()->PostTask(FROM_HERE, new QuitTask(&order, 3));
-
-  MessageLoop::current()->Run();
-
-  // FIFO order.
-  ASSERT_EQ(14U, order.size());
-  EXPECT_EQ(order[ 0], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 2], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[ 3], TaskItem(RECURSIVE, 2, false));
-  EXPECT_EQ(order[ 4], TaskItem(QUITMESSAGELOOP, 3, true));
-  EXPECT_EQ(order[ 5], TaskItem(QUITMESSAGELOOP, 3, false));
-  EXPECT_EQ(order[ 6], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 7], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 8], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[ 9], TaskItem(RECURSIVE, 2, false));
-  EXPECT_EQ(order[10], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[11], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[12], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[13], TaskItem(RECURSIVE, 2, false));
-}
-
-void RunTest_RecursiveSupport1(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  TaskList order;
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new RecursiveTask(2, &order, 1, true));
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new RecursiveTask(2, &order, 2, true));
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new QuitTask(&order, 3));
-
-  MessageLoop::current()->Run();
-
-  // FIFO order.
-  ASSERT_EQ(14U, order.size());
-  EXPECT_EQ(order[ 0], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 2], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[ 3], TaskItem(RECURSIVE, 2, false));
-  EXPECT_EQ(order[ 4], TaskItem(QUITMESSAGELOOP, 3, true));
-  EXPECT_EQ(order[ 5], TaskItem(QUITMESSAGELOOP, 3, false));
-  EXPECT_EQ(order[ 6], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 7], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 8], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[ 9], TaskItem(RECURSIVE, 2, false));
-  EXPECT_EQ(order[10], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[11], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[12], TaskItem(RECURSIVE, 2, true));
-  EXPECT_EQ(order[13], TaskItem(RECURSIVE, 2, false));
-}
-
-#if defined(OS_WIN)
-// TODO(darin): These tests need to be ported since they test critical
-// message loop functionality.
-
-// A side effect of this test is the generation a beep. Sorry.
-void RunTest_RecursiveDenial2(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  Thread worker("RecursiveDenial2_worker");
-  Thread::Options options;
-  options.message_loop_type = message_loop_type;
-  ASSERT_EQ(true, worker.StartWithOptions(options));
-  TaskList order;
-  ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL));
-  worker.message_loop()->PostTask(FROM_HERE,
-                                  new Recursive2Tasks(MessageLoop::current(),
-                                                      event,
-                                                      true,
-                                                      &order,
-                                                      false));
-  // Let the other thread execute.
-  WaitForSingleObject(event, INFINITE);
-  MessageLoop::current()->Run();
-
-  ASSERT_EQ(order.size(), 17);
-  EXPECT_EQ(order[ 0], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 2], TaskItem(MESSAGEBOX, 2, true));
-  EXPECT_EQ(order[ 3], TaskItem(MESSAGEBOX, 2, false));
-  EXPECT_EQ(order[ 4], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[ 5], TaskItem(RECURSIVE, 3, false));
-  // When EndDialogTask is processed, the window is already dismissed, hence no
-  // "end" entry.
-  EXPECT_EQ(order[ 6], TaskItem(ENDDIALOG, 4, true));
-  EXPECT_EQ(order[ 7], TaskItem(QUITMESSAGELOOP, 5, true));
-  EXPECT_EQ(order[ 8], TaskItem(QUITMESSAGELOOP, 5, false));
-  EXPECT_EQ(order[ 9], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[10], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[11], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[12], TaskItem(RECURSIVE, 3, false));
-  EXPECT_EQ(order[13], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[14], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[15], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[16], TaskItem(RECURSIVE, 3, false));
-}
-
-// A side effect of this test is the generation a beep. Sorry.  This test also
-// needs to process windows messages on the current thread.
-void RunTest_RecursiveSupport2(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  Thread worker("RecursiveSupport2_worker");
-  Thread::Options options;
-  options.message_loop_type = message_loop_type;
-  ASSERT_EQ(true, worker.StartWithOptions(options));
-  TaskList order;
-  ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL));
-  worker.message_loop()->PostTask(FROM_HERE,
-                                  new Recursive2Tasks(MessageLoop::current(),
-                                                      event,
-                                                      false,
-                                                      &order,
-                                                      true));
-  // Let the other thread execute.
-  WaitForSingleObject(event, INFINITE);
-  MessageLoop::current()->Run();
-
-  ASSERT_EQ(order.size(), 18);
-  EXPECT_EQ(order[ 0], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[ 2], TaskItem(MESSAGEBOX, 2, true));
-  // Note that this executes in the MessageBox modal loop.
-  EXPECT_EQ(order[ 3], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[ 4], TaskItem(RECURSIVE, 3, false));
-  EXPECT_EQ(order[ 5], TaskItem(ENDDIALOG, 4, true));
-  EXPECT_EQ(order[ 6], TaskItem(ENDDIALOG, 4, false));
-  EXPECT_EQ(order[ 7], TaskItem(MESSAGEBOX, 2, false));
-  /* The order can subtly change here. The reason is that when RecursiveTask(1)
-     is called in the main thread, if it is faster than getting to the
-     PostTask(FROM_HERE, QuitTask) execution, the order of task execution can
-     change. We don't care anyway that the order isn't correct.
-  EXPECT_EQ(order[ 8], TaskItem(QUITMESSAGELOOP, 5, true));
-  EXPECT_EQ(order[ 9], TaskItem(QUITMESSAGELOOP, 5, false));
-  EXPECT_EQ(order[10], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[11], TaskItem(RECURSIVE, 1, false));
-  */
-  EXPECT_EQ(order[12], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[13], TaskItem(RECURSIVE, 3, false));
-  EXPECT_EQ(order[14], TaskItem(RECURSIVE, 1, true));
-  EXPECT_EQ(order[15], TaskItem(RECURSIVE, 1, false));
-  EXPECT_EQ(order[16], TaskItem(RECURSIVE, 3, true));
-  EXPECT_EQ(order[17], TaskItem(RECURSIVE, 3, false));
-}
-
-#endif  // defined(OS_WIN)
-
-class TaskThatPumps : public OrderedTasks {
- public:
-  TaskThatPumps(TaskList* order, int cookie)
-      : OrderedTasks(order, PUMPS, cookie) {
-  }
-
-  virtual void Run() {
-    RunStart();
-    bool old_state = MessageLoop::current()->NestableTasksAllowed();
-    MessageLoop::current()->SetNestableTasksAllowed(true);
-    MessageLoop::current()->RunAllPending();
-    MessageLoop::current()->SetNestableTasksAllowed(old_state);
-    RunEnd();
-  }
-};
-
-// Tests that non nestable tasks run in FIFO if there are no nested loops.
-void RunTest_NonNestableWithNoNesting(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  TaskList order;
-
-  Task* task = new OrderedTasks(&order, 1);
-  MessageLoop::current()->PostNonNestableTask(FROM_HERE, task);
-  MessageLoop::current()->PostTask(FROM_HERE, new OrderedTasks(&order, 2));
-  MessageLoop::current()->PostTask(FROM_HERE, new QuitTask(&order, 3));
-  MessageLoop::current()->Run();
-
-  // FIFO order.
-  ASSERT_EQ(6U, order.size());
-  EXPECT_EQ(order[ 0], TaskItem(ORDERERD, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(ORDERERD, 1, false));
-  EXPECT_EQ(order[ 2], TaskItem(ORDERERD, 2, true));
-  EXPECT_EQ(order[ 3], TaskItem(ORDERERD, 2, false));
-  EXPECT_EQ(order[ 4], TaskItem(QUITMESSAGELOOP, 3, true));
-  EXPECT_EQ(order[ 5], TaskItem(QUITMESSAGELOOP, 3, false));
-}
-
-// Tests that non nestable tasks don't run when there's code in the call stack.
-void RunTest_NonNestableInNestedLoop(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  TaskList order;
-
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   new TaskThatPumps(&order, 1));
-  Task* task = new OrderedTasks(&order, 2);
-  MessageLoop::current()->PostNonNestableTask(FROM_HERE, task);
-  MessageLoop::current()->PostTask(FROM_HERE, new OrderedTasks(&order, 3));
-  MessageLoop::current()->PostTask(FROM_HERE, new OrderedTasks(&order, 4));
-  Task* non_nestable_quit = new QuitTask(&order, 5);
-  MessageLoop::current()->PostNonNestableTask(FROM_HERE, non_nestable_quit);
-
-  MessageLoop::current()->Run();
-
-  // FIFO order.
-  ASSERT_EQ(10U, order.size());
-  EXPECT_EQ(order[ 0], TaskItem(PUMPS, 1, true));
-  EXPECT_EQ(order[ 1], TaskItem(ORDERERD, 3, true));
-  EXPECT_EQ(order[ 2], TaskItem(ORDERERD, 3, false));
-  EXPECT_EQ(order[ 3], TaskItem(ORDERERD, 4, true));
-  EXPECT_EQ(order[ 4], TaskItem(ORDERERD, 4, false));
-  EXPECT_EQ(order[ 5], TaskItem(PUMPS, 1, false));
-  EXPECT_EQ(order[ 6], TaskItem(ORDERERD, 2, true));
-  EXPECT_EQ(order[ 7], TaskItem(ORDERERD, 2, false));
-  EXPECT_EQ(order[ 8], TaskItem(QUITMESSAGELOOP, 5, true));
-  EXPECT_EQ(order[ 9], TaskItem(QUITMESSAGELOOP, 5, false));
-}
-
-#if defined(OS_WIN)
-
-class DispatcherImpl : public MessageLoopForUI::Dispatcher {
- public:
-  DispatcherImpl() : dispatch_count_(0) {}
-
-  virtual bool Dispatch(const MSG& msg) {
-    ::TranslateMessage(&msg);
-    ::DispatchMessage(&msg);
-    return (++dispatch_count_ != 2);
-  }
-
-  int dispatch_count_;
-};
-
-void RunTest_Dispatcher(MessageLoop::Type message_loop_type) {
-  MessageLoop loop(message_loop_type);
-
-  class MyTask : public Task {
-  public:
-    virtual void Run() {
-      PostMessage(NULL, WM_LBUTTONDOWN, 0, 0);
-      PostMessage(NULL, WM_LBUTTONUP, 'A', 0);
-    }
-  };
-  Task* task = new MyTask();
-  MessageLoop::current()->PostDelayedTask(FROM_HERE, task, 100);
-  DispatcherImpl dispatcher;
-  MessageLoopForUI::current()->Run(&dispatcher);
-  ASSERT_EQ(2, dispatcher.dispatch_count_);
-}
-
-class TestIOHandler : public MessageLoopForIO::IOHandler {
- public:
-  TestIOHandler(const wchar_t* name, HANDLE signal, bool wait);
-
-  virtual void OnIOCompleted(MessageLoopForIO::IOContext* context,
-                             DWORD bytes_transfered, DWORD error);
-
-  void Init();
-  void WaitForIO();
-  OVERLAPPED* context() { return &context_.overlapped; }
-  DWORD size() { return sizeof(buffer_); }
-
- private:
-  char buffer_[48];
-  MessageLoopForIO::IOContext context_;
-  HANDLE signal_;
-  ScopedHandle file_;
-  bool wait_;
-};
-
-TestIOHandler::TestIOHandler(const wchar_t* name, HANDLE signal, bool wait)
-    : signal_(signal), wait_(wait) {
-  memset(buffer_, 0, sizeof(buffer_));
-  memset(&context_, 0, sizeof(context_));
-  context_.handler = this;
-
-  file_.Set(CreateFile(name, GENERIC_READ, 0, NULL, OPEN_EXISTING,
-                       FILE_FLAG_OVERLAPPED, NULL));
-  EXPECT_TRUE(file_.IsValid());
-}
-
-void TestIOHandler::Init() {
-  MessageLoopForIO::current()->RegisterIOHandler(file_, this);
-
-  DWORD read;
-  EXPECT_FALSE(ReadFile(file_, buffer_, size(), &read, context()));
-  EXPECT_EQ(ERROR_IO_PENDING, GetLastError());
-  if (wait_)
-    WaitForIO();
-}
-
-void TestIOHandler::OnIOCompleted(MessageLoopForIO::IOContext* context,
-                                  DWORD bytes_transfered, DWORD error) {
-  ASSERT_TRUE(context == &context_);
-  ASSERT_TRUE(SetEvent(signal_));
-}
-
-void TestIOHandler::WaitForIO() {
-  EXPECT_TRUE(MessageLoopForIO::current()->WaitForIOCompletion(300, this));
-  EXPECT_TRUE(MessageLoopForIO::current()->WaitForIOCompletion(400, this));
-}
-
-class IOHandlerTask : public Task {
- public:
-  explicit IOHandlerTask(TestIOHandler* handler) : handler_(handler) {}
-  virtual void Run() {
-    handler_->Init();
-  }
-
- private:
-  TestIOHandler* handler_;
-};
-
-void RunTest_IOHandler() {
-  ScopedHandle callback_called(CreateEvent(NULL, TRUE, FALSE, NULL));
-  ASSERT_TRUE(callback_called.IsValid());
-
-  const wchar_t* kPipeName = L"\\\\.\\pipe\\iohandler_pipe";
-  ScopedHandle server(CreateNamedPipe(kPipeName, PIPE_ACCESS_OUTBOUND, 0, 1,
-                                      0, 0, 0, NULL));
-  ASSERT_TRUE(server.IsValid());
-
-  Thread thread("IOHandler test");
-  Thread::Options options;
-  options.message_loop_type = MessageLoop::TYPE_IO;
-  ASSERT_TRUE(thread.StartWithOptions(options));
-
-  MessageLoop* thread_loop = thread.message_loop();
-  ASSERT_TRUE(NULL != thread_loop);
-
-  TestIOHandler handler(kPipeName, callback_called, false);
-  IOHandlerTask* task = new IOHandlerTask(&handler);
-  thread_loop->PostTask(FROM_HERE, task);
-  Sleep(100);  // Make sure the thread runs and sleeps for lack of work.
-
-  const char buffer[] = "Hello there!";
-  DWORD written;
-  EXPECT_TRUE(WriteFile(server, buffer, sizeof(buffer), &written, NULL));
-
-  DWORD result = WaitForSingleObject(callback_called, 1000);
-  EXPECT_EQ(WAIT_OBJECT_0, result);
-
-  thread.Stop();
-}
-
-void RunTest_WaitForIO() {
-  ScopedHandle callback1_called(CreateEvent(NULL, TRUE, FALSE, NULL));
-  ScopedHandle callback2_called(CreateEvent(NULL, TRUE, FALSE, NULL));
-  ASSERT_TRUE(callback1_called.IsValid());
-  ASSERT_TRUE(callback2_called.IsValid());
-
-  const wchar_t* kPipeName1 = L"\\\\.\\pipe\\iohandler_pipe1";
-  const wchar_t* kPipeName2 = L"\\\\.\\pipe\\iohandler_pipe2";
-  ScopedHandle server1(CreateNamedPipe(kPipeName1, PIPE_ACCESS_OUTBOUND, 0, 1,
-                                       0, 0, 0, NULL));
-  ScopedHandle server2(CreateNamedPipe(kPipeName2, PIPE_ACCESS_OUTBOUND, 0, 1,
-                                       0, 0, 0, NULL));
-  ASSERT_TRUE(server1.IsValid());
-  ASSERT_TRUE(server2.IsValid());
-
-  Thread thread("IOHandler test");
-  Thread::Options options;
-  options.message_loop_type = MessageLoop::TYPE_IO;
-  ASSERT_TRUE(thread.StartWithOptions(options));
-
-  MessageLoop* thread_loop = thread.message_loop();
-  ASSERT_TRUE(NULL != thread_loop);
-
-  TestIOHandler handler1(kPipeName1, callback1_called, false);
-  TestIOHandler handler2(kPipeName2, callback2_called, true);
-  IOHandlerTask* task1 = new IOHandlerTask(&handler1);
-  IOHandlerTask* task2 = new IOHandlerTask(&handler2);
-  thread_loop->PostTask(FROM_HERE, task1);
-  Sleep(100);  // Make sure the thread runs and sleeps for lack of work.
-  thread_loop->PostTask(FROM_HERE, task2);
-  Sleep(100);
-
-  // At this time handler1 is waiting to be called, and the thread is waiting
-  // on the Init method of handler2, filtering only handler2 callbacks.
-
-  const char buffer[] = "Hello there!";
-  DWORD written;
-  EXPECT_TRUE(WriteFile(server1, buffer, sizeof(buffer), &written, NULL));
-  Sleep(200);
-  EXPECT_EQ(WAIT_TIMEOUT, WaitForSingleObject(callback1_called, 0)) <<
-      "handler1 has not been called";
-
-  EXPECT_TRUE(WriteFile(server2, buffer, sizeof(buffer), &written, NULL));
-
-  HANDLE objects[2] = { callback1_called.Get(), callback2_called.Get() };
-  DWORD result = WaitForMultipleObjects(2, objects, TRUE, 1000);
-  EXPECT_EQ(WAIT_OBJECT_0, result);
-
-  thread.Stop();
-}
-
-#endif  // defined(OS_WIN)
-
-}  // namespace
-
-//-----------------------------------------------------------------------------
-// Each test is run against each type of MessageLoop.  That way we are sure
-// that message loops work properly in all configurations.  Of course, in some
-// cases, a unit test may only be for a particular type of loop.
-
-TEST(MessageLoopTest, PostTask) {
-  RunTest_PostTask(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostTask(MessageLoop::TYPE_UI);
-  RunTest_PostTask(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostTask_SEH) {
-  RunTest_PostTask_SEH(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostTask_SEH(MessageLoop::TYPE_UI);
-  RunTest_PostTask_SEH(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_Basic) {
-  RunTest_PostDelayedTask_Basic(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_Basic(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_Basic(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_InDelayOrder) {
-  RunTest_PostDelayedTask_InDelayOrder(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_InDelayOrder(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_InDelayOrder(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_InPostOrder) {
-  RunTest_PostDelayedTask_InPostOrder(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_InPostOrder(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_InPostOrder(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_InPostOrder_2) {
-  RunTest_PostDelayedTask_InPostOrder_2(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_InPostOrder_2(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_InPostOrder_2(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_InPostOrder_3) {
-  RunTest_PostDelayedTask_InPostOrder_3(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_InPostOrder_3(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_InPostOrder_3(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, PostDelayedTask_SharedTimer) {
-  RunTest_PostDelayedTask_SharedTimer(MessageLoop::TYPE_DEFAULT);
-  RunTest_PostDelayedTask_SharedTimer(MessageLoop::TYPE_UI);
-  RunTest_PostDelayedTask_SharedTimer(MessageLoop::TYPE_IO);
-}
-
-#if defined(OS_WIN)
-TEST(MessageLoopTest, PostDelayedTask_SharedTimer_SubPump) {
-  RunTest_PostDelayedTask_SharedTimer_SubPump();
-}
-#endif
-
-// TODO(darin): re-enable these tests once MessageLoop supports them again.
-#if 0
-TEST(MessageLoopTest, EnsureTaskDeletion) {
-  RunTest_EnsureTaskDeletion(MessageLoop::TYPE_DEFAULT);
-  RunTest_EnsureTaskDeletion(MessageLoop::TYPE_UI);
-  RunTest_EnsureTaskDeletion(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, EnsureTaskDeletion_Chain) {
-  RunTest_EnsureTaskDeletion_Chain(MessageLoop::TYPE_DEFAULT);
-  RunTest_EnsureTaskDeletion_Chain(MessageLoop::TYPE_UI);
-  RunTest_EnsureTaskDeletion_Chain(MessageLoop::TYPE_IO);
-}
-#endif
-
-#if defined(OS_WIN)
-TEST(MessageLoopTest, Crasher) {
-  RunTest_Crasher(MessageLoop::TYPE_DEFAULT);
-  RunTest_Crasher(MessageLoop::TYPE_UI);
-  RunTest_Crasher(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, CrasherNasty) {
-  RunTest_CrasherNasty(MessageLoop::TYPE_DEFAULT);
-  RunTest_CrasherNasty(MessageLoop::TYPE_UI);
-  RunTest_CrasherNasty(MessageLoop::TYPE_IO);
-}
-#endif  // defined(OS_WIN)
-
-TEST(MessageLoopTest, Nesting) {
-  RunTest_Nesting(MessageLoop::TYPE_DEFAULT);
-  RunTest_Nesting(MessageLoop::TYPE_UI);
-  RunTest_Nesting(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, RecursiveDenial1) {
-  RunTest_RecursiveDenial1(MessageLoop::TYPE_DEFAULT);
-  RunTest_RecursiveDenial1(MessageLoop::TYPE_UI);
-  RunTest_RecursiveDenial1(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, RecursiveSupport1) {
-  RunTest_RecursiveSupport1(MessageLoop::TYPE_DEFAULT);
-  RunTest_RecursiveSupport1(MessageLoop::TYPE_UI);
-  RunTest_RecursiveSupport1(MessageLoop::TYPE_IO);
-}
-
-#if defined(OS_WIN)
-TEST(MessageLoopTest, RecursiveDenial2) {
-  RunTest_RecursiveDenial2(MessageLoop::TYPE_DEFAULT);
-  RunTest_RecursiveDenial2(MessageLoop::TYPE_UI);
-  RunTest_RecursiveDenial2(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, RecursiveSupport2) {
-  // This test requires a UI loop
-  RunTest_RecursiveSupport2(MessageLoop::TYPE_UI);
-}
-#endif  // defined(OS_WIN)
-
-TEST(MessageLoopTest, NonNestableWithNoNesting) {
-  RunTest_NonNestableWithNoNesting(MessageLoop::TYPE_DEFAULT);
-  RunTest_NonNestableWithNoNesting(MessageLoop::TYPE_UI);
-  RunTest_NonNestableWithNoNesting(MessageLoop::TYPE_IO);
-}
-
-TEST(MessageLoopTest, NonNestableInNestedLoop) {
-  RunTest_NonNestableInNestedLoop(MessageLoop::TYPE_DEFAULT);
-  RunTest_NonNestableInNestedLoop(MessageLoop::TYPE_UI);
-  RunTest_NonNestableInNestedLoop(MessageLoop::TYPE_IO);
-}
-
-#if defined(OS_WIN)
-TEST(MessageLoopTest, Dispatcher) {
-  // This test requires a UI loop
-  RunTest_Dispatcher(MessageLoop::TYPE_UI);
-}
-
-TEST(MessageLoopTest, IOHandler) {
-  RunTest_IOHandler();
-}
-
-TEST(MessageLoopTest, WaitForIO) {
-  RunTest_WaitForIO();
-}
-#endif  // defined(OS_WIN)
-
-#if defined(OS_POSIX)
-
-namespace {
-
-class QuitDelegate : public
-    base::MessagePumpLibevent::Watcher {
- public:
-  virtual void OnFileCanWriteWithoutBlocking(int fd) {
-    MessageLoop::current()->Quit();
-  }
-  virtual void OnFileCanReadWithoutBlocking(int fd) {
-    MessageLoop::current()->Quit();
-  }
-};
-
-}  // namespace
-
-TEST(MessageLoopTest, DISABLED_FileDescriptorWatcherOutlivesMessageLoop) {
-  // Simulate a MessageLoop that dies before an FileDescriptorWatcher.
-  // This could happen when people use the Singleton pattern or atexit.
-  // This is disabled for now because it fails (valgrind shows
-  // invalid reads), and it's not clear any code relies on this...
-  // TODO(dkegel): enable if it turns out we rely on this
-
-  // Create a file descriptor.  Doesn't need to be readable or writable,
-  // as we don't need to actually get any notifications.
-  // pipe() is just the easiest way to do it.
-  int pipefds[2];
-  int err = pipe(pipefds);
-  ASSERT_TRUE(err == 0);
-  int fd = pipefds[1];
-  {
-    // Arrange for controller to live longer than message loop.
-    base::MessagePumpLibevent::FileDescriptorWatcher controller;
-    {
-      MessageLoopForIO message_loop;
-
-      QuitDelegate delegate;
-      message_loop.WatchFileDescriptor(fd,
-          true, MessageLoopForIO::WATCH_WRITE, &controller, &delegate);
-      // and don't run the message loop, just destroy it.
-    }
-  }
-  close(pipefds[0]);
-  close(pipefds[1]);
-}
-
-TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) {
-  // Verify that it's ok to call StopWatchingFileDescriptor().
-  // (Errors only showed up in valgrind.)
-  int pipefds[2];
-  int err = pipe(pipefds);
-  ASSERT_TRUE(err == 0);
-  int fd = pipefds[1];
-  {
-    // Arrange for message loop to live longer than controller.
-    MessageLoopForIO message_loop;
-    {
-      base::MessagePumpLibevent::FileDescriptorWatcher controller;
-
-      QuitDelegate delegate;
-      message_loop.WatchFileDescriptor(fd,
-          true, MessageLoopForIO::WATCH_WRITE, &controller, &delegate);
-      controller.StopWatchingFileDescriptor();
-    }
-  }
-  close(pipefds[0]);
-  close(pipefds[1]);
-}
-
-#endif  // defined(OS_LINUX)
deleted file mode 100644
--- a/ipc/chromium/src/base/object_watcher_unittest.cc
+++ /dev/null
@@ -1,143 +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 <process.h>
-
-#include "base/message_loop.h"
-#include "base/object_watcher.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class QuitDelegate : public base::ObjectWatcher::Delegate {
- public:
-  virtual void OnObjectSignaled(HANDLE object) {
-    MessageLoop::current()->Quit();
-  }
-};
-
-class DecrementCountDelegate : public base::ObjectWatcher::Delegate {
- public:
-  DecrementCountDelegate(int* counter) : counter_(counter) {
-  }
-  virtual void OnObjectSignaled(HANDLE object) {
-    --(*counter_);
-  }
- private:
-  int* counter_;
-};
-
-}  // namespace
-
-void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
-  MessageLoop message_loop(message_loop_type);
-
-  base::ObjectWatcher watcher;
-  EXPECT_EQ(NULL, watcher.GetWatchedObject());
-
-  // A manual-reset event that is not yet signaled.
-  HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
-
-  QuitDelegate delegate;
-  bool ok = watcher.StartWatching(event, &delegate);
-  EXPECT_TRUE(ok);
-  EXPECT_EQ(event, watcher.GetWatchedObject());
-
-  SetEvent(event);
-
-  MessageLoop::current()->Run();
-
-  EXPECT_EQ(NULL, watcher.GetWatchedObject());
-  CloseHandle(event);
-}
-
-void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
-  MessageLoop message_loop(message_loop_type);
-
-  base::ObjectWatcher watcher;
-
-  // A manual-reset event that is not yet signaled.
-  HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
-
-  QuitDelegate delegate;
-  bool ok = watcher.StartWatching(event, &delegate);
-  EXPECT_TRUE(ok);
-
-  watcher.StopWatching();
-
-  CloseHandle(event);
-}
-
-
-void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) {
-  MessageLoop message_loop(message_loop_type);
-
-  base::ObjectWatcher watcher;
-
-  int counter = 1;
-  DecrementCountDelegate delegate(&counter);
-
-    // A manual-reset event that is not yet signaled.
-  HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
-
-  bool ok = watcher.StartWatching(event, &delegate);
-  EXPECT_TRUE(ok);
-
-  SetEvent(event);
-
-  // Let the background thread do its business
-  Sleep(30);
-
-  watcher.StopWatching();
-
-  MessageLoop::current()->RunAllPending();
-
-  // Our delegate should not have fired.
-  EXPECT_EQ(1, counter);
-
-  CloseHandle(event);
-}
-
-void RunTest_OutlivesMessageLoop(MessageLoop::Type message_loop_type) {
-  // Simulate a MessageLoop that dies before an ObjectWatcher.  This ordinarily
-  // doesn't happen when people use the Thread class, but it can happen when
-  // people use the Singleton pattern or atexit.
-  HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);  // not signaled
-  {
-    base::ObjectWatcher watcher;
-    {
-      MessageLoop message_loop(message_loop_type);
-
-      QuitDelegate delegate;
-      watcher.StartWatching(event, &delegate);
-    }
-  }
-  CloseHandle(event);
-}
-
-//-----------------------------------------------------------------------------
-
-TEST(ObjectWatcherTest, BasicSignal) {
-  RunTest_BasicSignal(MessageLoop::TYPE_DEFAULT);
-  RunTest_BasicSignal(MessageLoop::TYPE_IO);
-  RunTest_BasicSignal(MessageLoop::TYPE_UI);
-}
-
-TEST(ObjectWatcherTest, BasicCancel) {
-  RunTest_BasicCancel(MessageLoop::TYPE_DEFAULT);
-  RunTest_BasicCancel(MessageLoop::TYPE_IO);
-  RunTest_BasicCancel(MessageLoop::TYPE_UI);
-}
-
-TEST(ObjectWatcherTest, CancelAfterSet) {
-  RunTest_CancelAfterSet(MessageLoop::TYPE_DEFAULT);
-  RunTest_CancelAfterSet(MessageLoop::TYPE_IO);
-  RunTest_CancelAfterSet(MessageLoop::TYPE_UI);
-}
-
-TEST(ObjectWatcherTest, OutlivesMessageLoop) {
-  RunTest_OutlivesMessageLoop(MessageLoop::TYPE_DEFAULT);
-  RunTest_OutlivesMessageLoop(MessageLoop::TYPE_IO);
-  RunTest_OutlivesMessageLoop(MessageLoop::TYPE_UI);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/observer_list_unittest.cc
+++ /dev/null
@@ -1,307 +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 "base/message_loop.h"
-#include "base/observer_list.h"
-#include "base/observer_list_threadsafe.h"
-#include "base/platform_thread.h"
-#include "base/ref_counted.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using base;
-using base::Time;
-
-namespace {
-
-class ObserverListTest : public testing::Test {
-};
-
-class Foo {
- public:
-  virtual void Observe(int x) = 0;
-  virtual ~Foo() {}
-};
-
-class Adder : public Foo {
- public:
-  explicit Adder(int scaler) : total(0), scaler_(scaler) {}
-  virtual void Observe(int x) {
-    total += x * scaler_;
-  }
-  virtual ~Adder() { }
-  int total;
- private:
-  int scaler_;
-};
-
-class Disrupter : public Foo {
- public:
-  Disrupter(ObserverList<Foo>* list, Foo* doomed)
-      : list_(list), doomed_(doomed) { }
-  virtual ~Disrupter() { }
-  virtual void Observe(int x) {
-    list_->RemoveObserver(doomed_);
-  }
- private:
-  ObserverList<Foo>* list_;
-  Foo* doomed_;
-};
-
-class ThreadSafeDisrupter : public Foo {
- public:
-  ThreadSafeDisrupter(ObserverListThreadSafe<Foo>* list, Foo* doomed)
-      : list_(list), doomed_(doomed) { }
-  virtual ~ThreadSafeDisrupter() { }
-  virtual void Observe(int x) {
-    list_->RemoveObserver(doomed_);
-  }
- private:
-  ObserverListThreadSafe<Foo>* list_;
-  Foo* doomed_;
-};
-
-class AddInObserve : public Foo {
- public:
-  AddInObserve(ObserverList<Foo>* observer_list)
-      : added(false),
-        observer_list(observer_list),
-        adder(1) {
-  }
-  virtual void Observe(int x) {
-    if (!added) {
-      added = true;
-      observer_list->AddObserver(&adder);
-    }
-  }
-
-  bool added;
-  ObserverList<Foo>* observer_list;
-  Adder adder;
-};
-
-
-class ObserverListThreadSafeTest : public testing::Test {
-};
-
-static const int kThreadRunTime = 10000;  // ms to run the multi-threaded test.
-
-// A thread for use in the ThreadSafeObserver test
-// which will add and remove itself from the notification
-// list repeatedly.
-class AddRemoveThread : public PlatformThread::Delegate,
-                        public Foo {
- public:
-  AddRemoveThread(ObserverListThreadSafe<Foo>* list, bool notify)
-      : list_(list),
-        in_list_(false),
-        start_(Time::Now()),
-        count_observes_(0),
-        count_addtask_(0),
-        do_notifies_(notify) {
-    factory_ = new ScopedRunnableMethodFactory<AddRemoveThread>(this);
-  }
-
-  virtual ~AddRemoveThread() {
-    delete factory_;
-  }
-
-  void ThreadMain() {
-    loop_ = new MessageLoop();  // Fire up a message loop.
-    loop_->PostTask(FROM_HERE,
-      factory_->NewRunnableMethod(&AddRemoveThread::AddTask));
-    loop_->Run();
-    //LOG(ERROR) << "Loop 0x" << std::hex << loop_ << " done. " <<
-    //    count_observes_ << ", " << count_addtask_;
-    delete loop_;
-    loop_ = reinterpret_cast<MessageLoop*>(0xdeadbeef);
-    delete this;
-  }
-
-  // This task just keeps posting to itself in an attempt
-  // to race with the notifier.
-  void AddTask() {
-    count_addtask_++;
-
-    if ((Time::Now() - start_).InMilliseconds() > kThreadRunTime) {
-      LOG(INFO) << "DONE!";
-      return;
-    }
-
-    if (!in_list_) {
-      list_->AddObserver(this);
-      in_list_ = true;
-    }
-
-    if (do_notifies_) {
-      list_->Notify(&Foo::Observe, 10);
-    }
-
-    loop_->PostDelayedTask(FROM_HERE,
-      factory_->NewRunnableMethod(&AddRemoveThread::AddTask), 0);
-  }
-
-  void Quit() {
-    loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask());
-  }
-
-  virtual void Observe(int x) {
-    count_observes_++;
-
-    // If we're getting called after we removed ourselves from
-    // the list, that is very bad!
-    DCHECK(in_list_);
-
-    // This callback should fire on the appropriate thread
-    EXPECT_EQ(loop_, MessageLoop::current());
-
-    list_->RemoveObserver(this);
-    in_list_ = false;
-  }
-
- private:
-  ObserverListThreadSafe<Foo>* list_;
-  MessageLoop* loop_;
-  bool in_list_;        // Are we currently registered for notifications.
-                        // in_list_ is only used on |this| thread.
-  Time start_;          // The time we started the test.
-
-  int count_observes_;  // Number of times we observed.
-  int count_addtask_;   // Number of times thread AddTask was called
-  bool do_notifies_;    // Whether these threads should do notifications.
-
-  ScopedRunnableMethodFactory<AddRemoveThread>* factory_;
-};
-
-}  // namespace
-
-TEST(ObserverListTest, BasicTest) {
-  ObserverList<Foo> observer_list;
-  Adder a(1), b(-1), c(1), d(-1);
-  Disrupter evil(&observer_list, &c);
-
-  observer_list.AddObserver(&a);
-  observer_list.AddObserver(&b);
-
-  FOR_EACH_OBSERVER(Foo, observer_list, Observe(10));
-
-  observer_list.AddObserver(&evil);
-  observer_list.AddObserver(&c);
-  observer_list.AddObserver(&d);
-
-  FOR_EACH_OBSERVER(Foo, observer_list, Observe(10));
-
-  EXPECT_EQ(a.total, 20);
-  EXPECT_EQ(b.total, -20);
-  EXPECT_EQ(c.total, 0);
-  EXPECT_EQ(d.total, -10);
-}
-
-TEST(ObserverListThreadSafeTest, BasicTest) {
-  MessageLoop loop;
-
-  scoped_refptr<ObserverListThreadSafe<Foo> > observer_list(
-      new ObserverListThreadSafe<Foo>);
-  Adder a(1);
-  Adder b(-1);
-  Adder c(1);
-  Adder d(-1);
-  ThreadSafeDisrupter evil(observer_list.get(), &c);
-
-  observer_list->AddObserver(&a);
-  observer_list->AddObserver(&b);
-
-  observer_list->Notify(&Foo::Observe, 10);
-  loop.RunAllPending();
-
-  observer_list->AddObserver(&evil);
-  observer_list->AddObserver(&c);
-  observer_list->AddObserver(&d);
-
-  observer_list->Notify(&Foo::Observe, 10);
-  loop.RunAllPending();
-
-  EXPECT_EQ(a.total, 20);
-  EXPECT_EQ(b.total, -20);
-  EXPECT_EQ(c.total, 0);
-  EXPECT_EQ(d.total, -10);
-}
-
-
-// A test driver for a multi-threaded notification loop.  Runs a number
-// of observer threads, each of which constantly adds/removes itself
-// from the observer list.  Optionally, if cross_thread_notifies is set
-// to true, the observer threads will also trigger notifications to
-// all observers.
-static void ThreadSafeObserverHarness(int num_threads,
-                                      bool cross_thread_notifies) {
-  MessageLoop loop;
-
-  const int kMaxThreads = 15;
-  num_threads = num_threads > kMaxThreads ? kMaxThreads : num_threads;
-
-  scoped_refptr<ObserverListThreadSafe<Foo> > observer_list(
-      new ObserverListThreadSafe<Foo>);
-  Adder a(1);
-  Adder b(-1);
-  Adder c(1);
-  Adder d(-1);
-
-  observer_list->AddObserver(&a);
-  observer_list->AddObserver(&b);
-
-  AddRemoveThread* threaded_observer[kMaxThreads];
-  PlatformThreadHandle threads[kMaxThreads];
-  for (int index = 0; index < num_threads; index++) {
-    threaded_observer[index] = new AddRemoveThread(observer_list.get(), false);
-    EXPECT_TRUE(PlatformThread::Create(0,
-                threaded_observer[index], &threads[index]));
-  }
-
-  Time start = Time::Now();
-  while (true) {
-    if ((Time::Now() - start).InMilliseconds() > kThreadRunTime)
-      break;
-
-    observer_list->Notify(&Foo::Observe, 10);
-
-    loop.RunAllPending();
-  }
-
-  for (int index = 0; index < num_threads; index++) {
-    threaded_observer[index]->Quit();
-    PlatformThread::Join(threads[index]);
-  }
-}
-
-TEST(ObserverListThreadSafeTest, CrossThreadObserver) {
-  // Use 7 observer threads.  Notifications only come from
-  // the main thread.
-  ThreadSafeObserverHarness(7, false);
-}
-
-TEST(ObserverListThreadSafeTest, CrossThreadNotifications) {
-  // Use 3 observer threads.  Notifications will fire from
-  // the main thread and all 3 observer threads.
-  ThreadSafeObserverHarness(3, true);
-}
-
-TEST(ObserverListTest, Existing) {
-  ObserverList<Foo> observer_list(ObserverList<Foo>::NOTIFY_EXISTING_ONLY);
-  Adder a(1);
-  AddInObserve b(&observer_list);
-
-  observer_list.AddObserver(&a);
-  observer_list.AddObserver(&b);
-
-  FOR_EACH_OBSERVER(Foo, observer_list, Observe(1));
-
-  EXPECT_TRUE(b.added);
-  // B's adder should not have been notified because it was added during
-  // notificaiton.
-  EXPECT_EQ(0, b.adder.total);
-
-  // Notify again to make sure b's adder is notified.
-  FOR_EACH_OBSERVER(Foo, observer_list, Observe(1));
-  EXPECT_EQ(1, b.adder.total);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/path_service_unittest.cc
+++ /dev/null
@@ -1,62 +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 "base/path_service.h"
-
-#include "base/basictypes.h"
-#include "base/file_util.h"
-#include "base/file_path.h"
-#if defined(OS_WIN)
-#include "base/win_util.h"
-#endif
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/gtest/include/gtest/gtest-spi.h"
-#include "testing/platform_test.h"
-
-namespace {
-
-// Returns true if PathService::Get returns true and sets the path parameter
-// to non-empty for the given PathService::DirType enumeration value.
-bool ReturnsValidPath(int dir_type) {
-  FilePath path;
-  bool result = PathService::Get(dir_type, &path);
-  return result && !path.value().empty() && file_util::PathExists(path);
-}
-
-#if defined(OS_WIN)
-// Function to test DIR_LOCAL_APP_DATA_LOW on Windows XP. Make sure it fails.
-bool ReturnsInvalidPath(int dir_type) {
-  std::wstring path;
-  bool result = PathService::Get(base::DIR_LOCAL_APP_DATA_LOW, &path);
-  return !result && path.empty();
-}
-#endif
-
-}  // namespace
-
-// On the Mac this winds up using some autoreleased objects, so we need to
-// be a PlatformTest.
-typedef PlatformTest PathServiceTest;
-
-// Test that all PathService::Get calls return a value and a true result
-// in the development environment.  (This test was created because a few
-// later changes to Get broke the semantics of the function and yielded the
-// correct value while returning false.)
-TEST_F(PathServiceTest, Get) {
-  for (int key = base::DIR_CURRENT; key < base::PATH_END; ++key) {
-    EXPECT_PRED1(ReturnsValidPath, key);
-  }
-#ifdef OS_WIN
-  for (int key = base::PATH_WIN_START + 1; key < base::PATH_WIN_END; ++key) {
-    if (key == base::DIR_LOCAL_APP_DATA_LOW &&
-        win_util::GetWinVersion() < win_util::WINVERSION_VISTA) {
-      // DIR_LOCAL_APP_DATA_LOW is not supported prior Vista and is expected to
-      // fail.
-      EXPECT_TRUE(ReturnsInvalidPath(key)) << key;
-    } else {
-      EXPECT_TRUE(ReturnsValidPath(key)) << key;
-    }
-  }
-#endif
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/pe_image_unittest.cc
+++ /dev/null
@@ -1,205 +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.
-
-// This file contains unit tests for PEImage.
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "base/pe_image.h"
-#include "base/win_util.h"
-
-// Just counts the number of invocations.
-bool ExportsCallback(const PEImage &image,
-                     DWORD ordinal,
-                     DWORD hint,
-                     LPCSTR name,
-                     PVOID function,
-                     LPCSTR forward,
-                     PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// Just counts the number of invocations.
-bool ImportsCallback(const PEImage &image,
-                     LPCSTR module,
-                     DWORD ordinal,
-                     LPCSTR name,
-                     DWORD hint,
-                     PIMAGE_THUNK_DATA iat,
-                     PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// Just counts the number of invocations.
-bool SectionsCallback(const PEImage &image,
-                       PIMAGE_SECTION_HEADER header,
-                       PVOID section_start,
-                       DWORD section_size,
-                       PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// Just counts the number of invocations.
-bool RelocsCallback(const PEImage &image,
-                    WORD type,
-                    PVOID address,
-                    PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// Just counts the number of invocations.
-bool ImportChunksCallback(const PEImage &image,
-                          LPCSTR module,
-                          PIMAGE_THUNK_DATA name_table,
-                          PIMAGE_THUNK_DATA iat,
-                          PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// Just counts the number of invocations.
-bool DelayImportChunksCallback(const PEImage &image,
-                               PImgDelayDescr delay_descriptor,
-                               LPCSTR module,
-                               PIMAGE_THUNK_DATA name_table,
-                               PIMAGE_THUNK_DATA iat,
-                               PIMAGE_THUNK_DATA bound_iat,
-                               PIMAGE_THUNK_DATA unload_iat,
-                               PVOID cookie) {
-  int* count = reinterpret_cast<int*>(cookie);
-  (*count)++;
-  return true;
-}
-
-// We'll be using some known values for the tests.
-enum Value {
-  sections = 0,
-  imports_dlls,
-  delay_dlls,
-  exports,
-  imports,
-  delay_imports,
-  relocs
-};
-
-// Retrieves the expected value from advapi32.dll based on the OS.
-int GetExpectedValue(Value value, DWORD os) {
-  const int xp_delay_dlls = 2;
-  const int xp_exports = 675;
-  const int xp_imports = 422;
-  const int xp_delay_imports = 8;
-  const int xp_relocs = 9180;
-  const int vista_delay_dlls = 4;
-  const int vista_exports = 799;
-  const int vista_imports = 476;
-  const int vista_delay_imports = 24;
-  const int vista_relocs = 10188;
-  const int w2k_delay_dlls = 0;
-  const int w2k_exports = 566;
-  const int w2k_imports = 357;
-  const int w2k_delay_imports = 0;
-  const int w2k_relocs = 7388;
-
-  // Contains the expected value, for each enumerated property (Value), and the
-  // OS version: [Value][os_version]
-  const int expected[][3] = {
-    {4, 4, 4},
-    {3, 3, 3},
-    {w2k_delay_dlls, xp_delay_dlls, vista_delay_dlls},
-    {w2k_exports, xp_exports, vista_exports},
-    {w2k_imports, xp_imports, vista_imports},
-    {w2k_delay_imports, xp_delay_imports, vista_delay_imports},
-    {w2k_relocs, xp_relocs, vista_relocs}
-  };
-
-  if (value > relocs)
-    return 0;
-  if (50 == os)
-    os = 0;  // 5.0
-  else if (51 == os || 52 == os)
-    os = 1;
-  else if (os >= 60)
-    os = 2;  // 6.x
-  else
-    return 0;
-
-  return expected[value][os];
-}
-
-// Tests that we are able to enumerate stuff from a PE file, and that
-// the actual number of items found is within the expected range.
-TEST(PEImageTest, EnumeratesPE) {
-  // Windows Server 2003 is not supported as a test environment for this test.
-  if (win_util::GetWinVersion() == win_util::WINVERSION_SERVER_2003)
-    return;
-  HMODULE module = LoadLibrary(L"advapi32.dll");
-  ASSERT_TRUE(NULL != module);
-
-  PEImage pe(module);
-  int count = 0;
-  EXPECT_TRUE(pe.VerifyMagic());
-
-  DWORD os = pe.GetNTHeaders()->OptionalHeader.MajorOperatingSystemVersion;
-  os = os * 10 + pe.GetNTHeaders()->OptionalHeader.MinorOperatingSystemVersion;
-
-  pe.EnumSections(SectionsCallback, &count);
-  EXPECT_EQ(GetExpectedValue(sections, os), count);
-
-  count = 0;
-  pe.EnumImportChunks(ImportChunksCallback, &count);
-  EXPECT_EQ(GetExpectedValue(imports_dlls, os), count);
-
-  count = 0;
-  pe.EnumDelayImportChunks(DelayImportChunksCallback, &count);
-  EXPECT_EQ(GetExpectedValue(delay_dlls, os), count);
-
-  count = 0;
-  pe.EnumExports(ExportsCallback, &count);
-  EXPECT_GT(count, GetExpectedValue(exports, os) - 20);
-  EXPECT_LT(count, GetExpectedValue(exports, os) + 100);
-
-  count = 0;
-  pe.EnumAllImports(ImportsCallback, &count);
-  EXPECT_GT(count, GetExpectedValue(imports, os) - 20);
-  EXPECT_LT(count, GetExpectedValue(imports, os) + 100);
-
-  count = 0;
-  pe.EnumAllDelayImports(ImportsCallback, &count);
-  EXPECT_GT(count, GetExpectedValue(delay_imports, os) - 2);
-  EXPECT_LT(count, GetExpectedValue(delay_imports, os) + 8);
-
-  count = 0;
-  pe.EnumRelocs(RelocsCallback, &count);
-  EXPECT_GT(count, GetExpectedValue(relocs, os) - 150);
-  EXPECT_LT(count, GetExpectedValue(relocs, os) + 1500);
-
-  FreeLibrary(module);
-}
-
-// Tests that we can locate an specific exported symbol, by name and by ordinal.
-TEST(PEImageTest, RetrievesExports) {
-  HMODULE module = LoadLibrary(L"advapi32.dll");
-  ASSERT_TRUE(NULL != module);
-
-  PEImage pe(module);
-  WORD ordinal;
-
-  EXPECT_TRUE(pe.GetProcOrdinal("RegEnumKeyExW", &ordinal));
-
-  FARPROC address1 = pe.GetProcAddress("RegEnumKeyExW");
-  FARPROC address2 = pe.GetProcAddress(reinterpret_cast<char*>(ordinal));
-  EXPECT_TRUE(address1 != NULL);
-  EXPECT_TRUE(address2 != NULL);
-  EXPECT_TRUE(address1 == address2);
-
-  FreeLibrary(module);
-}
--- a/ipc/chromium/src/base/pickle.h
+++ b/ipc/chromium/src/base/pickle.h
@@ -5,17 +5,16 @@
 #ifndef BASE_PICKLE_H__
 #define BASE_PICKLE_H__
 
 #include <string>
 
 #include "base/basictypes.h"
 #include "base/logging.h"
 #include "base/string16.h"
-#include "testing/gtest/include/gtest/gtest_prod.h"
 
 // This class provides facilities for basic binary value packing and unpacking.
 //
 // The Pickle class supports appending primitive values (ints, strings, etc.)
 // to a pickle instance.  The Pickle instance grows its internal memory buffer
 // dynamically to hold the sequence of primitive values.   The internal memory
 // buffer is exposed as the "data" of the Pickle.  This "data" can be passed
 // to a Pickle object to initialize it for reading.
@@ -278,14 +277,11 @@ class Pickle {
   // The allocation granularity of the payload.
   static const int kPayloadUnit;
 
  private:
   Header* header_;
   uint32_t header_size_;
   uint32_t capacity_;
   uint32_t variable_buffer_offset_;
-  FRIEND_TEST(PickleTest, Resize);
-  FRIEND_TEST(PickleTest, FindNext);
-  FRIEND_TEST(PickleTest, IteratorHasRoom);
 };
 
 #endif  // BASE_PICKLE_H__
deleted file mode 100644
--- a/ipc/chromium/src/base/pickle_unittest.cc
+++ /dev/null
@@ -1,220 +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 <string>
-
-#include "base/basictypes.h"
-#include "base/pickle.h"
-#include "base/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-const int testint = 2093847192;
-const std::string teststr("Hello world"); // note non-aligned string length
-const std::wstring testwstr(L"Hello, world");
-const char testdata[] = "AAA\0BBB\0";
-const int testdatalen = arraysize(testdata) - 1;
-const bool testbool1 = false;
-const bool testbool2 = true;
-
-// checks that the result
-void VerifyResult(const Pickle& pickle) {
-  void* iter = NULL;
-
-  int outint;
-  EXPECT_TRUE(pickle.ReadInt(&iter, &outint));
-  EXPECT_EQ(testint, outint);
-
-  std::string outstr;
-  EXPECT_TRUE(pickle.ReadString(&iter, &outstr));
-  EXPECT_EQ(teststr, outstr);
-
-  std::wstring outwstr;
-  EXPECT_TRUE(pickle.ReadWString(&iter, &outwstr));
-  EXPECT_EQ(testwstr, outwstr);
-
-  bool outbool;
-  EXPECT_TRUE(pickle.ReadBool(&iter, &outbool));
-  EXPECT_EQ(testbool1, outbool);
-  EXPECT_TRUE(pickle.ReadBool(&iter, &outbool));
-  EXPECT_EQ(testbool2, outbool);
-
-  const char* outdata;
-  int outdatalen;
-  EXPECT_TRUE(pickle.ReadData(&iter, &outdata, &outdatalen));
-  EXPECT_EQ(testdatalen, outdatalen);
-  EXPECT_EQ(memcmp(testdata, outdata, outdatalen), 0);
-
-  EXPECT_TRUE(pickle.ReadData(&iter, &outdata, &outdatalen));
-  EXPECT_EQ(testdatalen, outdatalen);
-  EXPECT_EQ(memcmp(testdata, outdata, outdatalen), 0);
-
-  // reads past the end should fail
-  EXPECT_FALSE(pickle.ReadInt(&iter, &outint));
-}
-
-}  // namespace
-
-TEST(PickleTest, EncodeDecode) {
-  Pickle pickle;
-
-  EXPECT_TRUE(pickle.WriteInt(testint));
-  EXPECT_TRUE(pickle.WriteString(teststr));
-  EXPECT_TRUE(pickle.WriteWString(testwstr));
-  EXPECT_TRUE(pickle.WriteBool(testbool1));
-  EXPECT_TRUE(pickle.WriteBool(testbool2));
-  EXPECT_TRUE(pickle.WriteData(testdata, testdatalen));
-
-  // Over allocate BeginWriteData so we can test TrimWriteData.
-  char* dest = pickle.BeginWriteData(testdatalen + 100);
-  EXPECT_TRUE(dest);
-  memcpy(dest, testdata, testdatalen);
-
-  pickle.TrimWriteData(testdatalen);
-
-  VerifyResult(pickle);
-
-  // test copy constructor
-  Pickle pickle2(pickle);
-  VerifyResult(pickle2);
-
-  // test operator=
-  Pickle pickle3;
-  pickle3 = pickle;
-  VerifyResult(pickle3);
-}
-
-TEST(PickleTest, ZeroLenStr) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteString(""));
-
-  void* iter = NULL;
-  std::string outstr;
-  EXPECT_TRUE(pickle.ReadString(&iter, &outstr));
-  EXPECT_EQ("", outstr);
-}
-
-TEST(PickleTest, ZeroLenWStr) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteWString(L""));
-
-  void* iter = NULL;
-  std::string outstr;
-  EXPECT_TRUE(pickle.ReadString(&iter, &outstr));
-  EXPECT_EQ("", outstr);
-}
-
-TEST(PickleTest, BadLenStr) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteInt(-2));
-
-  void* iter = NULL;
-  std::string outstr;
-  EXPECT_FALSE(pickle.ReadString(&iter, &outstr));
-}
-
-TEST(PickleTest, BadLenWStr) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteInt(-1));
-
-  void* iter = NULL;
-  std::wstring woutstr;
-  EXPECT_FALSE(pickle.ReadWString(&iter, &woutstr));
-}
-
-TEST(PickleTest, FindNext) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteInt(1));
-  EXPECT_TRUE(pickle.WriteString("Domo"));
-
-  const char* start = reinterpret_cast<const char*>(pickle.data());
-  const char* end = start + pickle.size();
-
-  EXPECT_TRUE(end == Pickle::FindNext(pickle.header_size_, start, end));
-  EXPECT_TRUE(NULL == Pickle::FindNext(pickle.header_size_, start, end - 1));
-  EXPECT_TRUE(end == Pickle::FindNext(pickle.header_size_, start, end + 1));
-}
-
-TEST(PickleTest, IteratorHasRoom) {
-  Pickle pickle;
-  EXPECT_TRUE(pickle.WriteInt(1));
-  EXPECT_TRUE(pickle.WriteInt(2));
-
-  const void* iter = 0;
-  EXPECT_FALSE(pickle.IteratorHasRoomFor(iter, 1));
-  iter = pickle.payload();
-  EXPECT_TRUE(pickle.IteratorHasRoomFor(iter, 0));
-  EXPECT_TRUE(pickle.IteratorHasRoomFor(iter, 1));
-  EXPECT_FALSE(pickle.IteratorHasRoomFor(iter, -1));
-  EXPECT_TRUE(pickle.IteratorHasRoomFor(iter, sizeof(int) * 2));
-  EXPECT_FALSE(pickle.IteratorHasRoomFor(iter, (sizeof(int) * 2) + 1));
-}
-
-TEST(PickleTest, Resize) {
-  size_t unit = Pickle::kPayloadUnit;
-  scoped_array<char> data(new char[unit]);
-  char* data_ptr = data.get();
-  for (size_t i = 0; i < unit; i++)
-    data_ptr[i] = 'G';
-
-  // construct a message that will be exactly the size of one payload unit,
-  // note that any data will have a 4-byte header indicating the size
-  const size_t payload_size_after_header = unit - sizeof(uint32_t);
-  Pickle pickle;
-  pickle.WriteData(data_ptr,
-      static_cast<int>(payload_size_after_header - sizeof(uint32_t)));
-  size_t cur_payload = payload_size_after_header;
-
-  // note: we assume 'unit' is a power of 2
-  EXPECT_EQ(unit, pickle.capacity());
-  EXPECT_EQ(pickle.payload_size(), payload_size_after_header);
-
-  // fill out a full page (noting data header)
-  pickle.WriteData(data_ptr, static_cast<int>(unit - sizeof(uint32_t)));
-  cur_payload += unit;
-  EXPECT_EQ(unit * 2, pickle.capacity());
-  EXPECT_EQ(cur_payload, pickle.payload_size());
-
-  // one more byte should double the capacity
-  pickle.WriteData(data_ptr, 1);
-  cur_payload += 5;
-  EXPECT_EQ(unit * 4, pickle.capacity());
-  EXPECT_EQ(cur_payload, pickle.payload_size());
-}
-
-namespace {
-
-struct CustomHeader : Pickle::Header {
-  int blah;
-};
-
-}  // namespace
-
-TEST(PickleTest, HeaderPadding) {
-  const uint32_t kMagic = 0x12345678;
-
-  Pickle pickle(sizeof(CustomHeader));
-  pickle.WriteInt(kMagic);
-
-  // this should not overwrite the 'int' payload
-  pickle.headerT<CustomHeader>()->blah = 10;
-
-  void* iter = NULL;
-  int result;
-  ASSERT_TRUE(pickle.ReadInt(&iter, &result));
-
-  EXPECT_EQ(static_cast<uint32_t>(result), kMagic);
-}
-
-TEST(PickleTest, EqualsOperator) {
-  Pickle source;
-  source.WriteInt(1);
-
-  Pickle copy_refs_source_buffer(static_cast<const char*>(source.data()),
-                                 source.size());
-  Pickle copy;
-  copy = copy_refs_source_buffer;
-  ASSERT_EQ(source.size(), copy.size());
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/pr_time_unittest.cc
+++ /dev/null
@@ -1,270 +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 <time.h>
-
-#include "base/third_party/nspr/prtime.h"
-#include "base/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using base::Time;
-using namespace nspr;
-
-namespace {
-
-// time_t representation of 15th Oct 2007 12:45:00 PDT
-PRTime comparison_time_pdt = 1192477500 * Time::kMicrosecondsPerSecond;
-
-// Specialized test fixture allowing time strings without timezones to be
-// tested by comparing them to a known time in the local zone.
-class PRTimeTest : public testing::Test {
- protected:
-  virtual void SetUp() {
-    // Use mktime to get a time_t, and turn it into a PRTime by converting
-    // seconds to microseconds.  Use 15th Oct 2007 12:45:00 local.  This
-    // must be a time guaranteed to be outside of a DST fallback hour in
-    // any timezone.
-    struct tm local_comparison_tm = {
-      0,            // second
-      45,           // minute
-      12,           // hour
-      15,           // day of month
-      10 - 1,       // month
-      2007 - 1900,  // year
-      0,            // day of week (ignored, output only)
-      0,            // day of year (ignored, output only)
-      -1            // DST in effect, -1 tells mktime to figure it out
-    };
-    comparison_time_local_ = mktime(&local_comparison_tm) *
-                             Time::kMicrosecondsPerSecond;
-    ASSERT_GT(comparison_time_local_, 0);
-  }
-
-  PRTime comparison_time_local_;
-};
-
-// Tests the PR_ParseTimeString nspr helper function for
-// a variety of time strings.
-TEST_F(PRTimeTest, ParseTimeTest1) {
-  time_t current_time = 0;
-  time(&current_time);
-
-  const int BUFFER_SIZE = 64;
-  struct tm local_time = {0};
-  char time_buf[BUFFER_SIZE] = {0};
-#if defined(OS_WIN)
-  localtime_s(&local_time, &current_time);
-  asctime_s(time_buf, arraysize(time_buf), &local_time);
-#elif defined(OS_POSIX)
-  localtime_r(&current_time, &local_time);
-  asctime_r(&local_time, time_buf);
-#endif
-
-  PRTime current_time64 = static_cast<PRTime>(current_time) * PR_USEC_PER_SEC;
-
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString(time_buf, PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(current_time64, parsed_time);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest2) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("Mon, 15 Oct 2007 19:45:00 GMT",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_pdt);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest3) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("15 Oct 07 12:45:00", PR_FALSE,
-                                       &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_local_);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest4) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("15 Oct 07 19:45 GMT", PR_FALSE,
-                                       &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_pdt);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest5) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("Mon Oct 15 12:45 PDT 2007",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_pdt);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest6) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("Monday, Oct 15, 2007 12:45 PM",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_local_);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest7) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("10/15/07 12:45:00 PM", PR_FALSE,
-                                       &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_local_);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest8) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("15-OCT-2007 12:45pm", PR_FALSE,
-                                       &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_local_);
-}
-
-TEST_F(PRTimeTest, ParseTimeTest9) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("16 Oct 2007 4:45-JST (Tuesday)",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(parsed_time, comparison_time_pdt);
-}
-
-// This tests the Time::FromString wrapper over PR_ParseTimeString
-TEST_F(PRTimeTest, ParseTimeTest10) {
-  Time parsed_time;
-  bool result = Time::FromString(L"15/10/07 12:45", &parsed_time);
-  EXPECT_EQ(true, result);
-
-  time_t computed_time = parsed_time.ToTimeT();
-  time_t time_to_compare = comparison_time_local_ /
-                           Time::kMicrosecondsPerSecond;
-  EXPECT_EQ(computed_time, time_to_compare);
-}
-
-// This tests the Time::FromString wrapper over PR_ParseTimeString
-TEST_F(PRTimeTest, ParseTimeTest11) {
-  Time parsed_time;
-  bool result = Time::FromString(L"Mon, 15 Oct 2007 19:45:00 GMT",
-                                 &parsed_time);
-  EXPECT_EQ(true, result);
-
-  time_t computed_time = parsed_time.ToTimeT();
-  time_t time_to_compare = comparison_time_pdt / Time::kMicrosecondsPerSecond;
-  EXPECT_EQ(computed_time, time_to_compare);
-}
-
-// Test some of edge cases around epoch, etc.
-TEST_F(PRTimeTest, ParseTimeTestEpoch0) {
-  Time parsed_time;
-
-  // time_t == epoch == 0
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 01:00:00 +0100 1970",
-                                   &parsed_time));
-  EXPECT_EQ(0, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 00:00:00 GMT 1970",
-                                   &parsed_time));
-  EXPECT_EQ(0, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEpoch1) {
-  Time parsed_time;
-
-  // time_t == 1 second after epoch == 1
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 01:00:01 +0100 1970",
-                                   &parsed_time));
-  EXPECT_EQ(1, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 00:00:01 GMT 1970",
-                                   &parsed_time));
-  EXPECT_EQ(1, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEpoch2) {
-  Time parsed_time;
-
-  // time_t == 2 seconds after epoch == 2
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 01:00:02 +0100 1970",
-                                   &parsed_time));
-  EXPECT_EQ(2, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 00:00:02 GMT 1970",
-                                   &parsed_time));
-  EXPECT_EQ(2, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEpochNeg1) {
-  Time parsed_time;
-
-  // time_t == 1 second before epoch == -1
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 00:59:59 +0100 1970",
-                                   &parsed_time));
-  EXPECT_EQ(-1, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Wed Dec 31 23:59:59 GMT 1969",
-                                   &parsed_time));
-  EXPECT_EQ(-1, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEpochNeg2) {
-  Time parsed_time;
-
-  // time_t == 2 seconds before epoch == -2
-  EXPECT_EQ(true, Time::FromString(L"Thu Jan 01 00:59:58 +0100 1970",
-                                   &parsed_time));
-  EXPECT_EQ(-2, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Wed Dec 31 23:59:58 GMT 1969",
-                                   &parsed_time));
-  EXPECT_EQ(-2, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEpoch1960) {
-  Time parsed_time;
-
-  // time_t before Epoch, in 1960
-  EXPECT_EQ(true, Time::FromString(L"Wed Jun 29 19:40:01 +0100 1960",
-                                   &parsed_time));
-  EXPECT_EQ(-299999999, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Wed Jun 29 18:40:01 GMT 1960",
-                                   &parsed_time));
-  EXPECT_EQ(-299999999, parsed_time.ToTimeT());
-  EXPECT_EQ(true, Time::FromString(L"Wed Jun 29 17:40:01 GMT 1960",
-                                   &parsed_time));
-  EXPECT_EQ(-300003599, parsed_time.ToTimeT());
-}
-
-TEST_F(PRTimeTest, ParseTimeTestEmpty) {
-  Time parsed_time;
-  EXPECT_FALSE(Time::FromString(L"", &parsed_time));
-}
-
-// This test should not crash when compiled with Visual C++ 2005 (see
-// http://crbug.com/4387).
-TEST_F(PRTimeTest, ParseTimeTestOutOfRange) {
-  PRTime parsed_time = 0;
-  // Note the lack of timezone in the time string.  The year has to be 3001.
-  // The date has to be after 23:59:59, December 31, 3000, US Pacific Time, so
-  // we use January 2, 3001 to make sure it's after the magic maximum in any
-  // timezone.
-  PRStatus result = PR_ParseTimeString("Sun Jan  2 00:00:00 3001",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-}
-
-TEST_F(PRTimeTest, ParseTimeTestNotNormalized1) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("Mon Oct 15 12:44:60 PDT 2007",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(comparison_time_pdt, parsed_time);
-}
-
-TEST_F(PRTimeTest, ParseTimeTestNotNormalized2) {
-  PRTime parsed_time = 0;
-  PRStatus result = PR_ParseTimeString("Sun Oct 14 36:45 PDT 2007",
-                                       PR_FALSE, &parsed_time);
-  EXPECT_EQ(PR_SUCCESS, result);
-  EXPECT_EQ(comparison_time_pdt, parsed_time);
-}
-
-}  // namespace
deleted file mode 100644
--- a/ipc/chromium/src/base/process_util_unittest.cc
+++ /dev/null
@@ -1,274 +0,0 @@
-// Copyright (c) 2009 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.
-
-#define _CRT_SECURE_NO_WARNINGS
-
-#include "base/command_line.h"
-#include "base/eintr_wrapper.h"
-#include "base/file_path.h"
-#include "base/multiprocess_test.h"
-#include "base/path_service.h"
-#include "base/platform_thread.h"
-#include "base/process_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(OS_LINUX)
-#include <dlfcn.h>
-#endif
-#if defined(OS_POSIX)
-#include <fcntl.h>
-#include <sys/socket.h>
-#endif
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
-
-namespace base {
-
-class ProcessUtilTest : public MultiProcessTest {
-};
-
-MULTIPROCESS_TEST_MAIN(SimpleChildProcess) {
-  return 0;
-}
-
-TEST_F(ProcessUtilTest, SpawnChild) {
-  ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess");
-
-  ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
-  EXPECT_TRUE(WaitForSingleProcess(handle, 5000));
-  base::CloseProcessHandle(handle);
-}
-
-MULTIPROCESS_TEST_MAIN(SlowChildProcess) {
-  // Sleep until file "SlowChildProcess.die" is created.
-  FILE *fp;
-  do {
-    PlatformThread::Sleep(100);
-    fp = fopen("SlowChildProcess.die", "r");
-  } while (!fp);
-  fclose(fp);
-  remove("SlowChildProcess.die");
-  exit(0);
-  return 0;
-}
-
-TEST_F(ProcessUtilTest, KillSlowChild) {
-  remove("SlowChildProcess.die");
-  ProcessHandle handle = this->SpawnChild(L"SlowChildProcess");
-  ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
-  FILE *fp = fopen("SlowChildProcess.die", "w");
-  fclose(fp);
-  EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000));
-  base::CloseProcessHandle(handle);
-}
-
-// TODO(estade): if possible, port these 2 tests.
-#if defined(OS_WIN)
-TEST_F(ProcessUtilTest, EnableLFH) {
-  ASSERT_TRUE(EnableLowFragmentationHeap());
-  if (IsDebuggerPresent()) {
-    // Under these conditions, LFH can't be enabled. There's no point to test
-    // anything.
-    const char* no_debug_env = getenv("_NO_DEBUG_HEAP");
-    if (!no_debug_env || strcmp(no_debug_env, "1"))
-      return;
-  }
-  HANDLE heaps[1024] = { 0 };
-  unsigned number_heaps = GetProcessHeaps(1024, heaps);
-  EXPECT_GT(number_heaps, 0u);
-  for (unsigned i = 0; i < number_heaps; ++i) {
-    ULONG flag = 0;
-    SIZE_T length;
-    ASSERT_NE(0, HeapQueryInformation(heaps[i],
-                                      HeapCompatibilityInformation,
-                                      &flag,
-                                      sizeof(flag),
-                                      &length));
-    // If flag is 0, the heap is a standard heap that does not support
-    // look-asides. If flag is 1, the heap supports look-asides. If flag is 2,
-    // the heap is a low-fragmentation heap (LFH). Note that look-asides are not
-    // supported on the LFH.
-
-    // We don't have any documented way of querying the HEAP_NO_SERIALIZE flag.
-    EXPECT_LE(flag, 2u);
-    EXPECT_NE(flag, 1u);
-  }
-}
-
-TEST_F(ProcessUtilTest, CalcFreeMemory) {
-  ProcessMetrics* metrics =
-      ProcessMetrics::CreateProcessMetrics(::GetCurrentProcess());
-  ASSERT_TRUE(NULL != metrics);
-
-  // Typical values here is ~1900 for total and ~1000 for largest. Obviously
-  // it depends in what other tests have done to this process.
-  FreeMBytes free_mem1 = {0};
-  EXPECT_TRUE(metrics->CalculateFreeMemory(&free_mem1));
-  EXPECT_LT(10u, free_mem1.total);
-  EXPECT_LT(10u, free_mem1.largest);
-  EXPECT_GT(2048u, free_mem1.total);
-  EXPECT_GT(2048u, free_mem1.largest);
-  EXPECT_GE(free_mem1.total, free_mem1.largest);
-  EXPECT_TRUE(NULL != free_mem1.largest_ptr);
-
-  // Allocate 20M and check again. It should have gone down.
-  const int kAllocMB = 20;
-  char* alloc = new char[kAllocMB * 1024 * 1024];
-  EXPECT_TRUE(NULL != alloc);
-
-  size_t expected_total = free_mem1.total - kAllocMB;
-  size_t expected_largest = free_mem1.largest;
-
-  FreeMBytes free_mem2 = {0};
-  EXPECT_TRUE(metrics->CalculateFreeMemory(&free_mem2));
-  EXPECT_GE(free_mem2.total, free_mem2.largest);
-  EXPECT_GE(expected_total, free_mem2.total);
-  EXPECT_GE(expected_largest, free_mem2.largest);
-  EXPECT_TRUE(NULL != free_mem2.largest_ptr);
-
-  delete[] alloc;
-  delete metrics;
-}
-
-TEST_F(ProcessUtilTest, GetAppOutput) {
-  // Let's create a decently long message.
-  std::string message;
-  for (int i = 0; i < 1025; i++) {  // 1025 so it does not end on a kilo-byte
-                                    // boundary.
-    message += "Hello!";
-  }
-
-  FilePath python_runtime;
-  ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &python_runtime));
-  python_runtime = python_runtime.Append(FILE_PATH_LITERAL("third_party"))
-                                 .Append(FILE_PATH_LITERAL("python_24"))
-                                 .Append(FILE_PATH_LITERAL("python.exe"));
-
-  // You have to put every parameter between quotes, otherwise this won't work,
-  // don't ask me why.
-  std::wstring cmd_line = L"\"" + python_runtime.value() + L"\" " +
-      L"\"-c\" \"import sys; sys.stdout.write('" + ASCIIToWide(message) +
-      L"');\"";
-  std::string output;
-  ASSERT_TRUE(base::GetAppOutput(cmd_line, &output));
-  EXPECT_EQ(message, output);
-
-  // Let's make sure stderr is ignored.
-  cmd_line = L"\"" + python_runtime.value() + L"\" " +
-      L"\"-c\" \"import sys; sys.stderr.write('Hello!');\"";
-  output.clear();
-  ASSERT_TRUE(base::GetAppOutput(cmd_line, &output));
-  EXPECT_EQ("", output);
-}
-#endif  // defined(OS_WIN)
-
-#if defined(OS_POSIX)
-// Returns the maximum number of files that a process can have open.
-// Returns 0 on error.
-int GetMaxFilesOpenInProcess() {
-  struct rlimit rlim;
-  if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
-    return 0;
-  }
-
-  // rlim_t is a uint64_t - clip to maxint. We do this since FD #s are ints
-  // which are all 32 bits on the supported platforms.
-  rlim_t max_int = static_cast<rlim_t>(std::numeric_limits<int32_t>::max());
-  if (rlim.rlim_cur > max_int) {
-    return max_int;
-  }
-
-  return rlim.rlim_cur;
-}
-
-const int kChildPipe = 20;  // FD # for write end of pipe in child process.
-MULTIPROCESS_TEST_MAIN(ProcessUtilsLeakFDChildProcess) {
-  // This child process counts the number of open FDs, it then writes that
-  // number out to a pipe connected to the parent.
-  int num_open_files = 0;
-  int write_pipe = kChildPipe;
-  int max_files = GetMaxFilesOpenInProcess();
-  for (int i = STDERR_FILENO + 1; i < max_files; i++) {
-    if (i != kChildPipe) {
-      if (HANDLE_EINTR(close(i)) != -1) {
-        LOG(WARNING) << "Leaked FD " << i;
-        num_open_files += 1;
-      }
-    }
-  }
-
-  // InitLogging always opens a file at startup.
-  int expected_num_open_fds = 1;
-#if defined(OS_LINUX)
-  // On Linux, '/etc/localtime' is opened before the test's main() enters.
-  expected_num_open_fds += 1;
-#endif  // defined(OS_LINUX)
-  num_open_files -= expected_num_open_fds;
-
-  int written = HANDLE_EINTR(write(write_pipe, &num_open_files,
-                                   sizeof(num_open_files)));
-  DCHECK_EQ(static_cast<size_t>(written), sizeof(num_open_files));
-  HANDLE_EINTR(close(write_pipe));
-
-  return 0;
-}
-
-TEST_F(ProcessUtilTest, FDRemapping) {
-  // Open some files to check they don't get leaked to the child process.
-  int fds[2];
-  if (pipe(fds) < 0)
-    NOTREACHED();
-  int pipe_read_fd = fds[0];
-  int pipe_write_fd = fds[1];
-
-  // open some dummy fds to make sure they don't propogate over to the
-  // child process.
-  int dev_null = open("/dev/null", O_RDONLY);
-  int sockets[2];
-  socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
-
-  file_handle_mapping_vector fd_mapping_vec;
-  fd_mapping_vec.push_back(std::pair<int,int>(pipe_write_fd, kChildPipe));
-  ProcessHandle handle = this->SpawnChild(L"ProcessUtilsLeakFDChildProcess",
-                                          fd_mapping_vec,
-                                          false);
-  ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
-  HANDLE_EINTR(close(pipe_write_fd));
-
-  // Read number of open files in client process from pipe;
-  int num_open_files = -1;
-  ssize_t bytes_read =
-      HANDLE_EINTR(read(pipe_read_fd, &num_open_files, sizeof(num_open_files)));
-  ASSERT_EQ(bytes_read, static_cast<ssize_t>(sizeof(num_open_files)));
-
-  // Make sure 0 fds are leaked to the client.
-  ASSERT_EQ(0, num_open_files);
-
-  EXPECT_TRUE(WaitForSingleProcess(handle, 1000));
-  base::CloseProcessHandle(handle);
-  HANDLE_EINTR(close(fds[0]));
-  HANDLE_EINTR(close(sockets[0]));
-  HANDLE_EINTR(close(sockets[1]));
-  HANDLE_EINTR(close(dev_null));
-}
-
-TEST_F(ProcessUtilTest, GetAppOutput) {
-  std::string output;
-  EXPECT_TRUE(GetAppOutput(CommandLine(L"true"), &output));
-  EXPECT_STREQ("", output.c_str());
-
-  EXPECT_FALSE(GetAppOutput(CommandLine(L"false"), &output));
-
-  std::vector<std::string> argv;
-  argv.push_back("/bin/echo");
-  argv.push_back("-n");
-  argv.push_back("foobar42");
-  EXPECT_TRUE(GetAppOutput(CommandLine(argv), &output));
-  EXPECT_STREQ("foobar42", output.c_str());
-}
-
-#endif  // defined(OS_POSIX)
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/rand_util_unittest.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 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 "base/rand_util.h"
-
-#include <limits>
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-const int kIntMin = std::numeric_limits<int>::min();
-const int kIntMax = std::numeric_limits<int>::max();
-
-}  // namespace
-
-TEST(RandUtilTest, SameMinAndMax) {
-  EXPECT_EQ(base::RandInt(0, 0), 0);
-  EXPECT_EQ(base::RandInt(kIntMin, kIntMin), kIntMin);
-  EXPECT_EQ(base::RandInt(kIntMax, kIntMax), kIntMax);
-}
-
-TEST(RandUtilTest, RandDouble) {
- // Force 64-bit precision, making sure we're not in a 80-bit FPU register.
- volatile double number = base::RandDouble();
- EXPECT_GT(1.0, number);
- EXPECT_LE(0.0, number);
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/ref_counted_unittest.cc
+++ /dev/null
@@ -1,33 +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 "base/ref_counted.h"
-
-namespace {
-
-class SelfAssign : public base::RefCounted<SelfAssign> {
-};
-
-class CheckDerivedMemberAccess : public scoped_refptr<SelfAssign> {
- public:
-  CheckDerivedMemberAccess() {
-    // This shouldn't compile if we don't have access to the member variable.
-    SelfAssign** pptr = &ptr_;
-    EXPECT_EQ(*pptr, ptr_);
-  }
-};
-
-}  // end namespace
-
-TEST(RefCountedUnitTest, TestSelfAssignment) {
-  SelfAssign* p = new SelfAssign;
-  scoped_refptr<SelfAssign> var = p;
-  var = var;
-  EXPECT_EQ(var.get(), p);
-}
-
-TEST(RefCountedUnitTest, ScopedRefPtrMemberAccess) {
-  CheckDerivedMemberAccess check;
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_bstr_win_unittest.cc
+++ /dev/null
@@ -1,93 +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 "base/scoped_bstr_win.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-static const wchar_t kTestString1[] = L"123";
-static const wchar_t kTestString2[] = L"456789";
-uint32_t test1_len = arraysize(kTestString1) - 1;
-uint32_t test2_len = arraysize(kTestString2) - 1;
-
-void DumbBstrTests() {
-  ScopedBstr b;
-  EXPECT_TRUE(b == NULL);
-  EXPECT_TRUE(b.Length() == 0);
-  EXPECT_TRUE(b.ByteLength() == 0);
-  b.Reset(NULL);
-  EXPECT_TRUE(b == NULL);
-  EXPECT_TRUE(b.Release() == NULL);
-  ScopedBstr b2;
-  b.Swap(b2);
-  EXPECT_TRUE(b2 == NULL);
-}
-
-void GiveMeABstr(BSTR* ret) {
-  *ret = SysAllocString(kTestString1);
-}
-
-void BasicBstrTests() {
-  ScopedBstr b1(kTestString1);
-  EXPECT_TRUE(b1.Length() == test1_len);
-  EXPECT_TRUE(b1.ByteLength() == test1_len * sizeof(kTestString1[0]));
-
-  ScopedBstr b2;
-  b1.Swap(b2);
-  EXPECT_TRUE(b2.Length() == test1_len);
-  EXPECT_TRUE(b1.Length() == 0);
-  EXPECT_TRUE(lstrcmpW(b2, kTestString1) == 0);
-  BSTR tmp = b2.Release();
-  EXPECT_TRUE(tmp != NULL);
-  EXPECT_TRUE(lstrcmpW(tmp, kTestString1) == 0);
-  EXPECT_TRUE(b2 == NULL);
-  SysFreeString(tmp);
-
-  GiveMeABstr(b2.Receive());
-  EXPECT_TRUE(b2 != NULL);
-  b2.Reset();
-  EXPECT_TRUE(b2.AllocateBytes(100) != NULL);
-  EXPECT_TRUE(b2.ByteLength() == 100);
-  EXPECT_TRUE(b2.Length() == 100 / sizeof(kTestString1[0]));
-  lstrcpyW(static_cast<BSTR>(b2), kTestString1);
-  EXPECT_TRUE(lstrlen(b2) == test1_len);
-  EXPECT_TRUE(b2.Length() == 100 / sizeof(kTestString1[0]));
-  b2.SetByteLen(lstrlen(b2) * sizeof(kTestString2[0]));
-  EXPECT_TRUE(lstrlen(b2) == b2.Length());
-
-  EXPECT_TRUE(b1.Allocate(kTestString2) != NULL);
-  EXPECT_TRUE(b1.Length() == test2_len);
-  b1.SetByteLen((test2_len - 1) * sizeof(kTestString2[0]));
-  EXPECT_TRUE(b1.Length() == test2_len - 1);
-}
-
-}  // namespace
-
-TEST(ScopedBstrTest, ScopedBstr) {
-  DumbBstrTests();
-  BasicBstrTests();
-}
-
-#define kSourceStr L"this is a string"
-#define kSourceStrEmpty L""
-
-TEST(StackBstrTest, StackBstr) {
-  ScopedBstr system_bstr(kSourceStr);
-  StackBstrVar(kSourceStr, stack_bstr);
-  EXPECT_EQ(VarBstrCmp(system_bstr, stack_bstr, LOCALE_USER_DEFAULT, 0),
-            VARCMP_EQ);
-
-  StackBstrVar(kSourceStrEmpty, empty);
-  uint32_t l1 = SysStringLen(stack_bstr);
-  uint32_t l2 = SysStringLen(StackBstr(kSourceStr));
-  uint32_t l3 = SysStringLen(system_bstr);
-  EXPECT_TRUE(l1 == l2);
-  EXPECT_TRUE(l2 == l3);
-  EXPECT_TRUE(SysStringLen(empty) == 0);
-
-  const wchar_t one_more_test[] = L"this is my const string";
-  EXPECT_EQ(SysStringLen(StackBstr(one_more_test)),
-            lstrlenW(one_more_test));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_comptr_win_unittest.cc
+++ /dev/null
@@ -1,52 +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 <shlobj.h>
-
-#include "base/scoped_comptr_win.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(ScopedComPtrTest, ScopedComPtr) {
-  EXPECT_TRUE(memcmp(&ScopedComPtr<IUnknown>::iid(), &IID_IUnknown,
-                     sizeof(IID)) == 0);
-
-  EXPECT_TRUE(SUCCEEDED(::CoInitialize(NULL)));
-
-  {
-    ScopedComPtr<IUnknown> unk;
-    EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink)));
-    ScopedComPtr<IUnknown> unk2;
-    unk2.Attach(unk.Detach());
-    EXPECT_TRUE(unk == NULL);
-    EXPECT_TRUE(unk2 != NULL);
-
-    ScopedComPtr<IMalloc> mem_alloc;
-    EXPECT_TRUE(SUCCEEDED(CoGetMalloc(1, mem_alloc.Receive())));
-
-    // test ScopedComPtr& constructor
-    ScopedComPtr<IMalloc> copy1(mem_alloc);
-    EXPECT_TRUE(copy1.IsSameObject(mem_alloc));
-    EXPECT_FALSE(copy1.IsSameObject(unk2));  // unk2 is valid but different
-    EXPECT_FALSE(copy1.IsSameObject(unk));  // unk is NULL
-
-    IMalloc* naked_copy = copy1.Detach();
-    copy1 = naked_copy;  // Test the =(T*) operator.
-    naked_copy->Release();
-
-    copy1.Release();
-    EXPECT_FALSE(copy1.IsSameObject(unk2));  // unk2 is valid, copy1 is not
-
-    // test Interface* constructor
-    ScopedComPtr<IMalloc> copy2(static_cast<IMalloc*>(mem_alloc));
-    EXPECT_TRUE(copy2.IsSameObject(mem_alloc));
-
-    EXPECT_TRUE(SUCCEEDED(unk.QueryFrom(mem_alloc)));
-    EXPECT_TRUE(unk != NULL);
-    unk.Release();
-    EXPECT_TRUE(unk == NULL);
-    EXPECT_TRUE(unk.IsSameObject(copy1));  // both are NULL
-  }
-
-  ::CoUninitialize();
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_ptr_unittest.cc
+++ /dev/null
@@ -1,169 +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 "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class ConDecLogger {
- public:
-  ConDecLogger() : ptr_(NULL) { }
-  explicit ConDecLogger(int* ptr) { set_ptr(ptr); }
-  ~ConDecLogger() { --*ptr_; }
-
-  void set_ptr(int* ptr) { ptr_ = ptr; ++*ptr_; }
-
-  int SomeMeth(int x) { return x; }
-
- private:
-  int* ptr_;
-  DISALLOW_COPY_AND_ASSIGN(ConDecLogger);
-};
-
-}  // namespace
-
-TEST(ScopedPtrTest, ScopedPtr) {
-  int constructed = 0;
-
-  {
-    scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
-    EXPECT_EQ(1, constructed);
-    EXPECT_TRUE(scoper.get());
-
-    EXPECT_EQ(10, scoper->SomeMeth(10));
-    EXPECT_EQ(10, scoper.get()->SomeMeth(10));
-    EXPECT_EQ(10, (*scoper).SomeMeth(10));
-  }
-  EXPECT_EQ(0, constructed);
-
-  // Test reset() and release()
-  {
-    scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
-    EXPECT_EQ(1, constructed);
-    EXPECT_TRUE(scoper.get());
-
-    scoper.reset(new ConDecLogger(&constructed));
-    EXPECT_EQ(1, constructed);
-    EXPECT_TRUE(scoper.get());
-
-    scoper.reset();
-    EXPECT_EQ(0, constructed);
-    EXPECT_FALSE(scoper.get());
-
-    scoper.reset(new ConDecLogger(&constructed));
-    EXPECT_EQ(1, constructed);
-    EXPECT_TRUE(scoper.get());
-
-    ConDecLogger* take = scoper.release();
-    EXPECT_EQ(1, constructed);
-    EXPECT_FALSE(scoper.get());
-    delete take;
-    EXPECT_EQ(0, constructed);
-
-    scoper.reset(new ConDecLogger(&constructed));
-    EXPECT_EQ(1, constructed);
-    EXPECT_TRUE(scoper.get());
-  }
-  EXPECT_EQ(0, constructed);
-
-  // Test swap(), == and !=
-  {
-    scoped_ptr<ConDecLogger> scoper1;
-    scoped_ptr<ConDecLogger> scoper2;
-    EXPECT_TRUE(scoper1 == scoper2.get());
-    EXPECT_FALSE(scoper1 != scoper2.get());
-
-    ConDecLogger* logger = new ConDecLogger(&constructed);
-    scoper1.reset(logger);
-    EXPECT_EQ(logger, scoper1.get());
-    EXPECT_FALSE(scoper2.get());
-    EXPECT_FALSE(scoper1 == scoper2.get());
-    EXPECT_TRUE(scoper1 != scoper2.get());
-
-    scoper2.swap(scoper1);
-    EXPECT_EQ(logger, scoper2.get());
-    EXPECT_FALSE(scoper1.get());
-    EXPECT_FALSE(scoper1 == scoper2.get());
-    EXPECT_TRUE(scoper1 != scoper2.get());
-  }
-  EXPECT_EQ(0, constructed);
-}
-
-TEST(ScopedPtrTest, ScopedArray) {
-  static const int kNumLoggers = 12;
-
-  int constructed = 0;
-
-  {
-    scoped_array<ConDecLogger> scoper(new ConDecLogger[kNumLoggers]);
-    EXPECT_TRUE(scoper.get());
-    EXPECT_EQ(&scoper[0], scoper.get());
-    for (int i = 0; i < kNumLoggers; ++i) {
-      scoper[i].set_ptr(&constructed);
-    }
-    EXPECT_EQ(12, constructed);
-
-    EXPECT_EQ(10, scoper.get()->SomeMeth(10));
-    EXPECT_EQ(10, scoper[2].SomeMeth(10));
-  }
-  EXPECT_EQ(0, constructed);
-
-  // Test reset() and release()
-  {
-    scoped_array<ConDecLogger> scoper;
-    EXPECT_FALSE(scoper.get());
-    scoper.release();
-    EXPECT_FALSE(scoper.get());
-    scoper.reset();
-    EXPECT_FALSE(scoper.get());
-
-    scoper.reset(new ConDecLogger[kNumLoggers]);
-    for (int i = 0; i < kNumLoggers; ++i) {
-      scoper[i].set_ptr(&constructed);
-    }
-    EXPECT_EQ(12, constructed);
-    scoper.reset();
-    EXPECT_EQ(0, constructed);
-
-    scoper.reset(new ConDecLogger[kNumLoggers]);
-    for (int i = 0; i < kNumLoggers; ++i) {
-      scoper[i].set_ptr(&constructed);
-    }
-    EXPECT_EQ(12, constructed);
-    ConDecLogger* ptr = scoper.release();
-    EXPECT_EQ(12, constructed);
-    delete[] ptr;
-    EXPECT_EQ(0, constructed);
-  }
-  EXPECT_EQ(0, constructed);
-
-  // Test swap(), == and !=
-  {
-    scoped_array<ConDecLogger> scoper1;
-    scoped_array<ConDecLogger> scoper2;
-    EXPECT_TRUE(scoper1 == scoper2.get());
-    EXPECT_FALSE(scoper1 != scoper2.get());
-
-    ConDecLogger* loggers = new ConDecLogger[kNumLoggers];
-    for (int i = 0; i < kNumLoggers; ++i) {
-      loggers[i].set_ptr(&constructed);
-    }
-    scoper1.reset(loggers);
-    EXPECT_EQ(loggers, scoper1.get());
-    EXPECT_FALSE(scoper2.get());
-    EXPECT_FALSE(scoper1 == scoper2.get());
-    EXPECT_TRUE(scoper1 != scoper2.get());
-
-    scoper2.swap(scoper1);
-    EXPECT_EQ(loggers, scoper2.get());
-    EXPECT_FALSE(scoper1.get());
-    EXPECT_FALSE(scoper1 == scoper2.get());
-    EXPECT_TRUE(scoper1 != scoper2.get());
-  }
-  EXPECT_EQ(0, constructed);
-}
-
-// TODO scoped_ptr_malloc
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_temp_dir_unittest.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2009 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/file_util.h"
-#include "base/scoped_temp_dir.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(ScopedTempDir, FullPath) {
-  FilePath test_path;
-  file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_temp_dir"),
-                                    &test_path);
-
-  // Against an existing dir, it should get destroyed when leaving scope.
-  EXPECT_TRUE(file_util::DirectoryExists(test_path));
-  {
-    ScopedTempDir dir;
-    EXPECT_TRUE(dir.Set(test_path));
-    EXPECT_TRUE(dir.IsValid());
-  }
-  EXPECT_FALSE(file_util::DirectoryExists(test_path));
-
-  {
-    ScopedTempDir dir;
-    dir.Set(test_path);
-    // Now the dir doesn't exist, so ensure that it gets created.
-    EXPECT_TRUE(file_util::DirectoryExists(test_path));
-    // When we call Release(), it shouldn't get destroyed when leaving scope.
-    FilePath path = dir.Take();
-    EXPECT_EQ(path.value(), test_path.value());
-    EXPECT_FALSE(dir.IsValid());
-  }
-  EXPECT_TRUE(file_util::DirectoryExists(test_path));
-
-  // Clean up.
-  {
-    ScopedTempDir dir;
-    dir.Set(test_path);
-  }
-  EXPECT_FALSE(file_util::DirectoryExists(test_path));
-}
-
-TEST(ScopedTempDir, TempDir) {
-  // In this case, just verify that a directory was created and that it's a
-  // child of TempDir.
-  FilePath test_path;
-  {
-    ScopedTempDir dir;
-    EXPECT_TRUE(dir.CreateUniqueTempDir());
-    test_path = dir.path();
-    EXPECT_TRUE(file_util::DirectoryExists(test_path));
-    FilePath tmp_dir;
-    EXPECT_TRUE(file_util::GetTempDir(&tmp_dir));
-    EXPECT_TRUE(test_path.value().find(tmp_dir.value()) != std::string::npos);
-  }
-  EXPECT_FALSE(file_util::DirectoryExists(test_path));
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/scoped_variant_win_unittest.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) 2009 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/scoped_variant_win.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-static const wchar_t kTestString1[] = L"Used to create BSTRs";
-static const wchar_t kTestString2[] = L"Also used to create BSTRs";
-
-void GiveMeAVariant(VARIANT* ret) {
-  EXPECT_TRUE(ret != NULL);
-  ret->vt = VT_BSTR;
-  V_BSTR(ret) = ::SysAllocString(kTestString1);
-}
-
-// A dummy IDispatch implementation (if you can call it that).
-// The class does nothing intelligent really.  Only increments a counter
-// when AddRef is called and decrements it when Release is called.
-class FakeComObject : public IDispatch {
- public:
-  FakeComObject() : ref_(0) {
-  }
-
-  STDMETHOD_(DWORD, AddRef)() {
-    ref_++;
-    return ref_;
-  }
-
-  STDMETHOD_(DWORD, Release)() {
-    ref_--;
-    return ref_;
-  }
-
-  STDMETHOD(QueryInterface)(REFIID, void**) {
-    return E_NOTIMPL;
-  }
-
-  STDMETHOD(GetTypeInfoCount)(UINT*) {
-    return E_NOTIMPL;
-  }
-
-  STDMETHOD(GetTypeInfo)(UINT, LCID, ITypeInfo**) {
-    return E_NOTIMPL;
-  }
-
-  STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, UINT, LCID, DISPID*) {
-    return E_NOTIMPL;
-  }
-
-  STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*,
-                    EXCEPINFO*, UINT*) {
-    return E_NOTIMPL;
-  }
-
-  // A way to check the internal reference count of the class.
-  int ref_count() const {
-    return ref_;
-  }
-
- protected:
-  int ref_;
-};
-
-}  // namespace
-
-TEST(ScopedVariantTest, ScopedVariant) {
-  ScopedVariant var;
-  EXPECT_TRUE(var.type() == VT_EMPTY);
-  // V_BSTR(&var) = NULL;  <- NOTE: Assignment like that is not supported
-
-  ScopedVariant var_bstr(L"VT_BSTR");
-  EXPECT_EQ(VT_BSTR, V_VT(&var_bstr));
-  EXPECT_TRUE(V_BSTR(&var_bstr) != NULL);  // can't use EXPECT_NE for BSTR
-  var_bstr.Reset();
-  EXPECT_NE(VT_BSTR, V_VT(&var_bstr));
-  var_bstr.Set(kTestString2);
-  EXPECT_EQ(VT_BSTR, V_VT(&var_bstr));
-
-  VARIANT tmp = var_bstr.Release();
-  EXPECT_EQ(VT_EMPTY, V_VT(&var_bstr));
-  EXPECT_EQ(VT_BSTR, V_VT(&tmp));
-  EXPECT_EQ(0, lstrcmp(V_BSTR(&tmp), kTestString2));
-
-  var.Reset(tmp);
-  EXPECT_EQ(VT_BSTR, V_VT(&var));
-  EXPECT_EQ(0, lstrcmpW(V_BSTR(&var), kTestString2));
-
-  var_bstr.Swap(var);
-  EXPECT_EQ(VT_EMPTY, V_VT(&var));
-  EXPECT_EQ(VT_BSTR, V_VT(&var_bstr));
-  EXPECT_EQ(0, lstrcmpW(V_BSTR(&var_bstr), kTestString2));
-  var_bstr.Reset();
-
-  // Test the Compare and Copy routines.
-  GiveMeAVariant(var_bstr.Receive());
-  ScopedVariant var_bstr2(V_BSTR(&var_bstr));
-  EXPECT_EQ(0, var_bstr.Compare(var_bstr2));
-  var_bstr2.Reset();
-  EXPECT_NE(0, var_bstr.Compare(var_bstr2));
-  var_bstr2.Reset(var_bstr.Copy());
-  EXPECT_EQ(0, var_bstr.Compare(var_bstr2));
-  var_bstr2.Reset();
-  var_bstr2.Set(V_BSTR(&var_bstr));
-  EXPECT_EQ(0, var_bstr.Compare(var_bstr2));
-  var_bstr2.Reset();
-  var_bstr.Reset();
-
-  // Test for the SetDate setter.
-  SYSTEMTIME sys_time;
-  ::GetSystemTime(&sys_time);
-  DATE date;
-  ::SystemTimeToVariantTime(&sys_time, &date);
-  var.Reset();
-  var.SetDate(date);
-  EXPECT_EQ(VT_DATE, var.type());
-  EXPECT_EQ(date, V_DATE(&var));
-
-  // Simple setter tests.  These do not require resetting the variant
-  // after each test since the variant type is not "leakable" (i.e. doesn't
-  // need to be freed explicitly).
-
-  // We need static cast here since char defaults to int (!?).
-  var.Set(static_cast<int8_t>('v'));
-  EXPECT_EQ(VT_I1, var.type());
-  EXPECT_EQ('v', V_I1(&var));
-
-  var.Set(static_cast<short>(123));
-  EXPECT_EQ(VT_I2, var.type());
-  EXPECT_EQ(123, V_I2(&var));
-
-  var.Set(static_cast<int32_t>(123));
-  EXPECT_EQ(VT_I4, var.type());
-  EXPECT_EQ(123, V_I4(&var));
-
-  var.Set(static_cast<int64_t>(123));
-  EXPECT_EQ(VT_I8, var.type());
-  EXPECT_EQ(123, V_I8(&var));
-
-  var.Set(static_cast<uint8_t>(123));
-  EXPECT_EQ(VT_UI1, var.type());
-  EXPECT_EQ(123, V_UI1(&var));
-
-  var.Set(static_cast<unsigned short>(123));
-  EXPECT_EQ(VT_UI2, var.type());
-  EXPECT_EQ(123, V_UI2(&var));
-
-  var.Set(static_cast<uint32_t>(123));
-  EXPECT_EQ(VT_UI4, var.type());
-  EXPECT_EQ(123, V_UI4(&var));
-
-  var.Set(static_cast<uint64_t>(123));
-  EXPECT_EQ(VT_UI8, var.type());
-  EXPECT_EQ(123, V_UI8(&var));
-
-  var.Set(123.123f);
-  EXPECT_EQ(VT_R4, var.type());
-  EXPECT_EQ(123.123f, V_R4(&var));
-
-  var.Set(static_cast<double>(123.123));
-  EXPECT_EQ(VT_R8, var.type());
-  EXPECT_EQ(123.123, V_R8(&var));
-
-  var.Set(true);
-  EXPECT_EQ(VT_BOOL, var.type());
-  EXPECT_EQ(VARIANT_TRUE, V_BOOL(&var));
-  var.Set(false);
-  EXPECT_EQ(VT_BOOL, var.type());
-  EXPECT_EQ(VARIANT_FALSE, V_BOOL(&var));
-
-  // Com interface tests
-
-  var.Set(static_cast<IDispatch*>(NULL));
-  EXPECT_EQ(VT_DISPATCH, var.type());
-  EXPECT_EQ(NULL, V_DISPATCH(&var));
-  var.Reset();
-
-  var.Set(static_cast<IUnknown*>(NULL));
-  EXPECT_EQ(VT_UNKNOWN, var.type());
-  EXPECT_EQ(NULL, V_UNKNOWN(&var));
-  var.Reset();
-
-  FakeComObject faker;
-  EXPECT_EQ(0, faker.ref_count());
-  var.Set(static_cast<IDispatch*>(&faker));
-  EXPECT_EQ(VT_DISPATCH, var.type());
-  EXPECT_EQ(&faker, V_DISPATCH(&var));
-  EXPECT_EQ(1, faker.ref_count());
-  var.Reset();
-  EXPECT_EQ(0, faker.ref_count());
-
-  var.Set(static_cast<IUnknown*>(&faker));
-  EXPECT_EQ(VT_UNKNOWN, var.type());
-  EXPECT_EQ(&faker, V_UNKNOWN(&var));
-  EXPECT_EQ(1, faker.ref_count());
-  var.Reset();
-  EXPECT_EQ(0, faker.ref_count());
-
-  {
-    ScopedVariant disp_var(&faker);
-    EXPECT_EQ(VT_DISPATCH, disp_var.type());
-    EXPECT_EQ(&faker, V_DISPATCH(&disp_var));
-    EXPECT_EQ(1, faker.ref_count());
-  }
-  EXPECT_EQ(0, faker.ref_count());
-
-  {
-    ScopedVariant ref1(&faker);
-    EXPECT_EQ(1, faker.ref_count());
-    ScopedVariant ref2(static_cast<const VARIANT&>(ref1));
-    EXPECT_EQ(2, faker.ref_count());
-    ScopedVariant ref3;
-    ref3 = static_cast<const VARIANT&>(ref2);
-    EXPECT_EQ(3, faker.ref_count());
-  }
-  EXPECT_EQ(0, faker.ref_count());
-
-  {
-    ScopedVariant unk_var(static_cast<IUnknown*>(&faker));
-    EXPECT_EQ(VT_UNKNOWN, unk_var.type());
-    EXPECT_EQ(&faker, V_UNKNOWN(&unk_var));
-    EXPECT_EQ(1, faker.ref_count());
-  }
-  EXPECT_EQ(0, faker.ref_count());
-
-  VARIANT raw;
-  raw.vt = VT_UNKNOWN;
-  raw.punkVal = &faker;
-  EXPECT_EQ(0, faker.ref_count());
-  var.Set(raw);
-  EXPECT_EQ(1, faker.ref_count());
-  var.Reset();
-  EXPECT_EQ(0, faker.ref_count());
-
-  {
-    ScopedVariant number(123);
-    EXPECT_EQ(VT_I4, number.type());
-    EXPECT_EQ(123, V_I4(&number));
-  }
-
-  // SAFEARRAY tests
-  var.Set(static_cast<SAFEARRAY*>(NULL));
-  EXPECT_EQ(VT_EMPTY, var.type());
-
-  SAFEARRAY* sa = ::SafeArrayCreateVector(VT_UI1, 0, 100);
-  ASSERT_TRUE(sa != NULL);
-
-  var.Set(sa);
-#ifndef OFFICIAL_BUILD
-  EXPECT_TRUE(ScopedVariant::IsLeakableVarType(var.type()));
-#endif
-  EXPECT_EQ(VT_ARRAY | VT_UI1, var.type());
-  EXPECT_EQ(sa, V_ARRAY(&var));
-  // The array is destroyed in the destructor of var.
-}
deleted file mode 100644
--- a/ipc/chromium/src/base/shared_memory_unittest.cc
+++ /dev/null
@@ -1,346 +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 "base/basictypes.h"
-#include "base/multiprocess_test.h"
-#include "base/platform_thread.h"
-#include "base/scoped_nsautorelease_pool.h"
-#include "base/shared_memory.h"
-#include "base/scoped_ptr.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-static const int kNumThreads = 5;
-static const int kNumTasks = 5;
-
-namespace base {
-
-namespace {
-
-// Each thread will open the shared memory.  Each thread will take a different 4
-// byte int pointer, and keep changing it, with some small pauses in between.
-// Verify that each thread's value in the shared memory is always correct.
-class MultipleThreadMain : public PlatformThread::Delegate {
- public:
-  explicit MultipleThreadMain(int16_t id) : id_(id) {}
-  ~MultipleThreadMain() {}
-
-  static void CleanUp() {
-    SharedMemory memory;
-    memory.Delete(s_test_name_);
-  }
-
-  // PlatformThread::Delegate interface.
-  void ThreadMain() {
-    ScopedNSAutoreleasePool pool;  // noop if not OSX
-    const int kDataSize = 1024;
-    SharedMemory memory;
-    bool rv = memory.Create(s_test_name_, false, true, kDataSize);
-    EXPECT_TRUE(rv);
-    rv = memory.Map(kDataSize);
-    EXPECT_TRUE(rv);
-    int *ptr = static_cast<int*>(memory.memory()) + id_;
-    EXPECT_EQ(*ptr, 0);
-
-    for (int idx = 0; idx < 100; idx++) {
-      *ptr = idx;
-      PlatformThread::Sleep(1);  // Short wait.
-      EXPECT_EQ(*ptr, idx);
-    }
-
-    memory.Close();
-  }
-
- private:
-  int16_t id_;
-
-  static const wchar_t* const s_test_name_;
-
-  DISALLOW_COPY_AND_ASSIGN(MultipleThreadMain);
-};
-
-const wchar_t* const MultipleThreadMain::s_test_name_ =
-    L"SharedMemoryOpenThreadTest";
-
-// TODO(port):
-// This test requires the ability to pass file descriptors between processes.
-// We haven't done that yet in Chrome for POSIX.
-#if defined(OS_WIN)
-// Each thread will open the shared memory.  Each thread will take the memory,
-// and keep changing it while trying to lock it, with some small pauses in
-// between. Verify that each thread's value in the shared memory is always
-// correct.
-class MultipleLockThread : public PlatformThread::Delegate {
- public:
-  explicit MultipleLockThread(int id) : id_(id) {}
-  ~MultipleLockThread() {}
-
-  // PlatformThread::Delegate interface.
-  void ThreadMain() {
-    const int kDataSize = sizeof(int);
-    SharedMemoryHandle handle = NULL;
-    {
-      SharedMemory memory1;
-      EXPECT_TRUE(memory1.Create(L"SharedMemoryMultipleLockThreadTest",
-                                 false, true, kDataSize));
-      EXPECT_TRUE(memory1.ShareToProcess(GetCurrentProcess(), &handle));
-      // TODO(paulg): Implement this once we have a posix version of
-      // SharedMemory::ShareToProcess.
-      EXPECT_TRUE(true);
-    }
-
-    SharedMemory memory2(handle, false);
-    EXPECT_TRUE(memory2.Map(kDataSize));
-    volatile int* const ptr = static_cast<int*>(memory2.memory());
-
-    for (int idx = 0; idx < 20; idx++) {
-      memory2.Lock();
-      int i = (id_ << 16) + idx;
-      *ptr = i;
-      PlatformThread::Sleep(1);  // Short wait.
-      EXPECT_EQ(*ptr, i);
-      memory2.Unlock();
-    }
-
-    memory2.Close();
-  }
-
- private:
-  int id_;
-
-  DISALLOW_COPY_AND_ASSIGN(MultipleLockThread);
-};
-#endif
-
-}  // namespace
-
-TEST(SharedMemoryTest, OpenClose) {
-  const int kDataSize = 1024;
-  std::wstring test_name = L"SharedMemoryOpenCloseTest";
-
-  // Open two handles to a memory segment, confirm that they are mapped
-  // separately yet point to the same space.
-  SharedMemory memory1;
-  bool rv = memory1.Delete(test_name);
-  EXPECT_TRUE(rv);
-  rv = memory1.Delete(test_name);
-  EXPECT_TRUE(rv);
-  rv = memory1.Open(test_name, false);
-  EXPECT_FALSE(rv);
-  rv = memory1.Create(test_name, false, false, kDataSize);
-  EXPECT_TRUE(rv);
-  rv = memory1.Map(kDataSize);
-  EXPECT_TRUE(rv);
-  SharedMemory memory2;
-  rv = memory2.Open(test_name, false);
-  EXPECT_TRUE(rv);
-  rv = memory2.Map(kDataSize);
-  EXPECT_TRUE(rv);
-  EXPECT_NE(memory1.memory(), memory2.memory());  // Compare the pointers.
-
-  // Make sure we don't segfault. (it actually happened!)
-  ASSERT_NE(memory1.memory(), static_cast<void*>(NULL));
-  ASSERT_NE(memory2.memory(), static_cast<void*>(NULL));
-
-  // Write data to the first memory segment, verify contents of second.
-  memset(memory1.memory(), '1', kDataSize);
-  EXPECT_EQ(memcmp(memory1.memory(), memory2.memory(), kDataSize), 0);
-
-  // Close the first memory segment, and verify the second has the right data.
-  memory1.Close();
-  char *start_ptr = static_cast<char *>(memory2.memory());
-  char *end_ptr = start_ptr + kDataSize;
-  for (char* ptr = start_ptr; ptr < end_ptr; ptr++)
-    EXPECT_EQ(*ptr, '1');
-
-  // Close the second memory segment.
-  memory2.Close();
-
-  rv = memory1.Delete(test_name);
-  EXPECT_TRUE(rv);
-  rv = memory2.Delete(test_name);
-  EXPECT_TRUE(rv);
-}
-
-// Create a set of N threads to each open a shared memory segment and write to
-// it. Verify that they are always reading/writing consistent data.
-TEST(SharedMemoryTest, MultipleThreads) {
-  MultipleThreadMain::CleanUp();
-  // On POSIX we have a problem when 2 threads try to create the shmem
-  // (a file) at exactly the same time, since create both creates the
-  // file and zerofills it.  We solve the problem for this unit test
-  // (make it not flaky) by starting with 1 thread, then
-  // intentionally don't clean up its shmem before running with
-  // kNumThreads.
-
-  int threadcounts[] = { 1, kNumThreads };
-  for (size_t i = 0; i < sizeof(threadcounts) / sizeof(threadcounts); i++) {
-    int numthreads = threadcounts[i];
-    scoped_array<PlatformThreadHandle> thread_handles;
-    scoped_array<MultipleThreadMain*> thread_delegates;
-
-    thread_handles.reset(new PlatformThreadHandle[numthreads]);
-    thread_delegates.reset(new MultipleThreadMain*[numthreads]);
-
-    // Spawn the threads.
-    for (int16_t index = 0; index < numthreads; index++) {
-      PlatformThreadHandle pth;
-      thread_delegates[index] = new MultipleThreadMain(index);
-      EXPECT_TRUE(PlatformThread::Create(0, thread_delegates[index], &pth));
-      thread_handles[index] = pth;
-    }
-
-    // Wait for the threads to finish.
-    for (int index = 0; index < numthreads; index++) {
-      PlatformThread::Join(thread_handles[index]);
-      delete thread_delegates[index];
-    }
-  }
-  MultipleThreadMain::CleanUp();
-}
-
-// TODO(port): this test requires the MultipleLockThread class
-// (defined above), which requires the ability to pass file
-// descriptors between processes.  We haven't done that yet in Chrome
-// for POSIX.
-#if defined(OS_WIN)
-// Create a set of threads to each open a shared memory segment and write to it
-// with the lock held. Verify that they are always reading/writing consistent
-// data.
-TEST(SharedMemoryTest, Lock) {
-  PlatformThreadHandle thread_handles[kNumThreads];
-  MultipleLockThread* thread_delegates[kNumThreads];
-
-  // Spawn the threads.
-  for (int index = 0; index < kNumThreads; ++index) {
-    PlatformThreadHandle pth;
-    thread_delegates[index] = new MultipleLockThread(index);
-    EXPECT_TRUE(PlatformThread::Create(0, thread_delegates[index], &pth));
-    thread_handles[index] = pth;
-  }
-
-  // Wait for the threads to finish.
-  for (int index = 0; index < kNumThreads; ++index) {
-    PlatformThread::Join(thread_handles[index]);
-    delete thread_delegates[index];
-  }
-}
-#endif
-
-// Allocate private (unique) shared memory with an empty string for a
-// name.  Make sure several of them don't point to the same thing as
-// we might expect if the names are equal.
-TEST(SharedMemoryTest, AnonymousPrivate) {
-  int i, j;
-  int count = 4;
-  bool rv;
-  const int kDataSize = 8192;
-
-  scoped_array<SharedMemory> memories(new SharedMemory[count]);
-  scoped_array<int*> pointers(new int*[count]);
-  ASSERT_TRUE(memories.get());
-  ASSERT_TRUE(pointers.get());
-
-  for (i = 0; i < count; i++) {
-    rv = memories[i].Create(L"", false, true, kDataSize);
-    EXPECT_TRUE(rv);
-    rv = memories[i].Map(kDataSize);
-    EXPECT_TRUE(rv);
-    int *ptr = static_cast<int*>(memories[i].memory());
-    EXPECT_TRUE(ptr);
-    pointers[i] = ptr;
-  }
-
-  for (i = 0; i < count; i++) {
-    // zero out the first int in each except for i; for that one, make it 100.
-    for (j = 0; j < count; j++) {
-      if (i == j)
-        pointers[j][0] = 100;
-      else
-        pointers[j][0] = 0;
-    }
-    // make sure there is no bleeding of the 100 into the other pointers
-    for (j = 0; j < count; j++) {
-      if (i == j)
-        EXPECT_EQ(100, pointers[j][0]);
-      else
-        EXPECT_EQ(0, pointers[j][0]);
-    }
-  }
-
-  for (int i = 0; i < count; i++) {
-    memories[i].Close();
-  }
-
-}
-
-
-// On POSIX it is especially important we test shmem across processes,
-// not just across threads.  But the test is enabled on all platforms.
-class SharedMemoryProcessTest : public MultiProcessTest {
- public:
-
-  static void CleanUp() {
-    SharedMemory memory;
-    memory.Delete(s_test_name_);
-  }
-
-  static int TaskTestMain() {
-    int errors = 0;
-    ScopedNSAutoreleasePool pool;  // noop if not OSX
-    const int kDataSize = 1024;
-    SharedMemory memory;
-    bool rv = memory.Create(s_test_name_, false, true, kDataSize);
-    EXPECT_TRUE(rv);
-    if (rv != true)
-      errors++;
-    rv = memory.Map(kDataSize);
-    EXPECT_TRUE(rv);
-    if (rv != true)
-      errors++;
-    int *ptr = static_cast<int*>(memory.memory());
-
-    for (int idx = 0; idx < 20; idx++) {
-      memory.Lock();
-      int i = (1 << 16) + idx;
-      *ptr = i;
-      PlatformThread::Sleep(10);  // Short wait.
-      if (*ptr != i)
-        errors++;
-      memory.Unlock();
-    }
-
-    memory.Close();
-    return errors;
-  }
-
- private:
-  static const wchar_t* const s_test_name_;
-};
-
-const wchar_t* const SharedMemoryProcessTest::s_test_name_ = L"MPMem";
-
-
-TEST_F(SharedMemoryProcessTest, Tasks) {
-  SharedMemoryProcessTest::CleanUp();
-
-  base::ProcessHandle handles[kNumTasks];
-  for (int index = 0; index < kNumTasks; ++index) {
-    handles[index] = SpawnChild(L"SharedMemoryTestMain");
-  }
-
-  int exit_code = 0;
-  for (int index = 0; index < kNumTasks; ++index) {
-    EXPECT_TRUE(base::WaitForExitCode(handles[index], &exit_code));
-    EXPECT_TRUE(exit_code == 0);
-  }
-
-  SharedMemoryProcessTest::CleanUp();
-}
-
-MULTIPROCESS_TEST_MAIN(SharedMemoryTestMain) {
-  return SharedMemoryProcessTest::TaskTestMain();
-}
-
-
-}  // namespace base
deleted file mode 100644
--- a/ipc/chromium/src/base/simple_thread_unittest.cc
+++ /dev/null
@@ -1,167 +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 "base/atomic_sequence_num.h"
-#include "base/lock.h"
-#include "base/simple_thread.h"
-#include "base/string_util.h"
-#include "base/waitable_event.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class SetIntRunner : public base::DelegateSimpleThread::Delegate {
- public:
-  SetIntRunner(int* ptr, int val) : ptr_(ptr), val_(val) { }
-  ~SetIntRunner() { }
-
-  virtual void Run() {
-    *ptr_ = val_;
-  }
-
- private:
-  int* ptr_;
-  int val_;
-};
-
-class WaitEventRunner : public base::DelegateSimpleThread::Delegate {
- public:
-  WaitEventRunner(base::WaitableEvent* event) : event_(event) { }
-  ~WaitEventRunner() { }
-
-  virtual void Run() {<