diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 8a4d80e4b3..0000000000
--- a/.gitmodules
+++ /dev/null
@@ -1,28 +0,0 @@
-[submodule "base"]
- path = base
- url = https://chromium.googlesource.com/chromium/src/base.git
-[submodule "build"]
- path = build
- url = https://chromium.googlesource.com/chromium/src/build.git
- ignore = untracked
-[submodule "testing/gmock"]
- path = testing/gmock
- url = https://chromium.googlesource.com/external/googlemock.git
-[submodule "testing/gtest"]
- path = testing/gtest
- url = https://chromium.googlesource.com/external/googletest.git
-[submodule "third_party/gold"]
- path = third_party/gold
- url = https://chromium.googlesource.com/chromium/deps/gold.git
-[submodule "third_party/icu"]
- path = third_party/icu
- url = https://chromium.googlesource.com/chromium/deps/icu46.git
-[submodule "third_party/openssl"]
- path = third_party/openssl
- url = https://chromium.googlesource.com/chromium/deps/openssl.git
-[submodule "tools/gyp"]
- path = tools/gyp
- url = https://chromium.googlesource.com/external/gyp.git
-[submodule "tools/valgrind"]
- path = tools/valgrind
- url = https://chromium.googlesource.com/chromium/src/tools/valgrind.git
diff --git a/base b/base
deleted file mode 160000
index 44f2983223..0000000000
--- a/base
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 44f298322368aff31c5a697a2659bd52a5175541
diff --git a/build b/build
deleted file mode 160000
index 3f959aa138..0000000000
--- a/build
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 3f959aa1388b6308e66cae89adee01ae135f1c04
diff --git a/testing/OWNERS b/testing/OWNERS
deleted file mode 100644
index 72e8ffc0db..0000000000
--- a/testing/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/testing/PRESUBMIT.py b/testing/PRESUBMIT.py
deleted file mode 100644
index 90e524f455..0000000000
--- a/testing/PRESUBMIT.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2012 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.
-
-"""Top-level presubmit script for testing.
-
-See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
-details on the presubmit API built into gcl.
-"""
-
-
-def CommonChecks(input_api, output_api):
- output = []
- blacklist = [r'gmock.*', r'gtest.*']
- output.extend(input_api.canned_checks.RunPylint(
- input_api, output_api, black_list=blacklist))
- return output
-
-
-def CheckChangeOnUpload(input_api, output_api):
- return CommonChecks(input_api, output_api)
-
-
-def CheckChangeOnCommit(input_api, output_api):
- return CommonChecks(input_api, output_api)
diff --git a/testing/android/AndroidManifest.xml b/testing/android/AndroidManifest.xml
deleted file mode 100644
index 73a0c14881..0000000000
--- a/testing/android/AndroidManifest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/android/OWNERS b/testing/android/OWNERS
deleted file mode 100644
index 87d5d22497..0000000000
--- a/testing/android/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-bulach@chromium.org
-yfriedman@chromium.org
diff --git a/testing/android/README.chromium b/testing/android/README.chromium
deleted file mode 100644
index c00255a43a..0000000000
--- a/testing/android/README.chromium
+++ /dev/null
@@ -1,2 +0,0 @@
-apk-based runner for Chromium unit test bundles. This is a simple wrapper APK
-that should include a single gtest native library.
diff --git a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java
deleted file mode 100644
index 6486a14f3c..0000000000
--- a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 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.
-
-package org.chromium.native_test;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.Handler;
-import android.util.Log;
-
-import org.chromium.base.ChromiumActivity;
-import org.chromium.base.PathUtils;
-import org.chromium.base.PowerMonitor;
-
-// TODO(cjhopman): This should not refer to content. NativeLibraries should be moved to base.
-import org.chromium.content.app.NativeLibraries;
-
-import java.io.File;
-
-// Android's NativeActivity is mostly useful for pure-native code.
-// Our tests need to go up to our own java classes, which is not possible using
-// the native activity class loader.
-public class ChromeNativeTestActivity extends ChromiumActivity {
- private static final String TAG = "ChromeNativeTestActivity";
- private static final String EXTRA_RUN_IN_SUB_THREAD = "RunInSubThread";
- // We post a delayed task to run tests so that we do not block onCreate().
- private static final long RUN_TESTS_DELAY_IN_MS = 300;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // Needed by path_utils_unittest.cc
- PathUtils.setPrivateDataDirectorySuffix("chrome");
-
- // Needed by system_monitor_unittest.cc
- PowerMonitor.createForTests(this);
-
- loadLibraries();
- Bundle extras = this.getIntent().getExtras();
- if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) {
- // Create a new thread and run tests on it.
- new Thread() {
- @Override
- public void run() {
- runTests();
- }
- }.start();
- } else {
- // Post a task to run the tests. This allows us to not block
- // onCreate and still run tests on the main thread.
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- runTests();
- }
- }, RUN_TESTS_DELAY_IN_MS);
- }
- }
-
- private void runTests() {
- // This directory is used by build/android/pylib/test_package_apk.py.
- nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext());
- }
-
- // Signal a failure of the native test loader to python scripts
- // which run tests. For example, we look for
- // RUNNER_FAILED build/android/test_package.py.
- private void nativeTestFailed() {
- Log.e(TAG, "[ RUNNER_FAILED ] could not load native library");
- }
-
- private void loadLibraries() {
- for (String library: NativeLibraries.libraries) {
- Log.i(TAG, "loading: " + library);
- System.loadLibrary(library);
- Log.i(TAG, "loaded: " + library);
- }
- }
-
- private native void nativeRunTests(String filesDir, Context appContext);
-}
diff --git a/testing/android/native_test.gyp b/testing/android/native_test.gyp
deleted file mode 100644
index 4a3cc4d8fa..0000000000
--- a/testing/android/native_test.gyp
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2012 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.
-
-{
- 'conditions': [
- ['OS=="android"', {
- 'targets': [
- {
- 'target_name': 'native_test_native_code',
- 'message': 'building native pieces of native test package',
- 'type': 'static_library',
- 'sources': [
- 'native_test_launcher.cc',
- ],
- 'direct_dependent_settings': {
- 'ldflags!': [
- # JNI_OnLoad is implemented in a .a and we need to
- # re-export in the .so.
- '-Wl,--exclude-libs=ALL',
- ],
- },
- 'dependencies': [
- '../../base/base.gyp:base',
- '../../base/base.gyp:test_support_base',
- '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- '../gtest.gyp:gtest',
- 'native_test_jni_headers',
- 'native_test_util',
- ],
- },
- {
- 'target_name': 'native_test_jni_headers',
- 'type': 'none',
- 'sources': [
- 'java/src/org/chromium/native_test/ChromeNativeTestActivity.java'
- ],
- 'variables': {
- 'jni_gen_package': 'testing',
- },
- 'includes': [ '../../build/jni_generator.gypi' ],
- # So generated jni headers can be found by targets that
- # depend on this.
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(SHARED_INTERMEDIATE_DIR)',
- ],
- },
- },
- {
- 'target_name': 'native_test_util',
- 'type': 'static_library',
- 'sources': [
- 'native_test_util.cc',
- 'native_test_util.h',
- ],
- 'dependencies': [
- '../../base/base.gyp:base',
- ],
- },
- ],
- }]
- ],
-}
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc
deleted file mode 100644
index e39eb2bdcc..0000000000
--- a/testing/android/native_test_launcher.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (c) 2012 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 class sets up the environment for running the native tests inside an
-// android application. It outputs (to a fifo) markers identifying the
-// START/PASSED/CRASH of the test suite, FAILURE/SUCCESS of individual tests,
-// etc.
-// These markers are read by the test runner script to generate test results.
-// It installs signal handlers to detect crashes.
-
-#include
-#include
-
-#include "base/android/base_jni_registrar.h"
-#include "base/android/fifo_utils.h"
-#include "base/android/jni_android.h"
-#include "base/android/jni_string.h"
-#include "base/android/scoped_java_ref.h"
-#include "base/at_exit.h"
-#include "base/base_switches.h"
-#include "base/command_line.h"
-#include "base/file_util.h"
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "base/strings/stringprintf.h"
-#include "gtest/gtest.h"
-#include "testing/android/native_test_util.h"
-#include "testing/jni/ChromeNativeTestActivity_jni.h"
-
-using testing::native_test_util::ArgsToArgv;
-using testing::native_test_util::ParseArgsFromCommandLineFile;
-using testing::native_test_util::ScopedMainEntryLogger;
-
-// The main function of the program to be wrapped as a test apk.
-extern int main(int argc, char** argv);
-
-namespace {
-
-// These two command line flags are supported for DumpRenderTree, which needs
-// three fifos rather than a combined one: one for stderr, stdin and stdout.
-const char kSeparateStderrFifo[] = "separate-stderr-fifo";
-const char kCreateStdinFifo[] = "create-stdin-fifo";
-
-// The test runner script writes the command line file in
-// "/data/local/tmp".
-static const char kCommandLineFilePath[] =
- "/data/local/tmp/chrome-native-tests-command-line";
-
-const char kLogTag[] = "chromium";
-const char kCrashedMarker[] = "[ CRASHED ]\n";
-
-// The list of signals which are considered to be crashes.
-const int kExceptionSignals[] = {
- SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, -1
-};
-
-struct sigaction g_old_sa[NSIG];
-
-// This function runs in a compromised context. It should not allocate memory.
-void SignalHandler(int sig, siginfo_t* info, void* reserved) {
- // Output the crash marker.
- write(STDOUT_FILENO, kCrashedMarker, sizeof(kCrashedMarker));
- g_old_sa[sig].sa_sigaction(sig, info, reserved);
-}
-
-// TODO(nileshagrawal): now that we're using FIFO, test scripts can detect EOF.
-// Remove the signal handlers.
-void InstallHandlers() {
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
-
- sa.sa_sigaction = SignalHandler;
- sa.sa_flags = SA_SIGINFO;
-
- for (unsigned int i = 0; kExceptionSignals[i] != -1; ++i) {
- sigaction(kExceptionSignals[i], &sa, &g_old_sa[kExceptionSignals[i]]);
- }
-}
-
-// Writes printf() style string to Android's logger where |priority| is one of
-// the levels defined in .
-void AndroidLog(int priority, const char* format, ...) {
- va_list args;
- va_start(args, format);
- __android_log_vprint(priority, kLogTag, format, args);
- va_end(args);
-}
-
-// Ensures that the fifo at |path| is created by deleting whatever is at |path|
-// prior to (re)creating the fifo, otherwise logs the error and terminates the
-// program.
-void EnsureCreateFIFO(const base::FilePath& path) {
- unlink(path.value().c_str());
- if (base::android::CreateFIFO(path, 0666))
- return;
-
- AndroidLog(ANDROID_LOG_ERROR, "Failed to create fifo %s: %s\n",
- path.value().c_str(), strerror(errno));
- exit(EXIT_FAILURE);
-}
-
-// Ensures that |stream| is redirected to |path|, otherwise logs the error and
-// terminates the program.
-void EnsureRedirectStream(FILE* stream,
- const base::FilePath& path,
- const char* mode) {
- if (base::android::RedirectStream(stream, path, mode))
- return;
-
- AndroidLog(ANDROID_LOG_ERROR, "Failed to redirect stream to file: %s: %s\n",
- path.value().c_str(), strerror(errno));
- exit(EXIT_FAILURE);
-}
-
-} // namespace
-
-// This method is called on a separate java thread so that we won't trigger
-// an ANR.
-static void RunTests(JNIEnv* env,
- jobject obj,
- jstring jfiles_dir,
- jobject app_context) {
- base::AtExitManager exit_manager;
-
- // Command line initialized basically, will be fully initialized later.
- static const char* const kInitialArgv[] = { "ChromeTestActivity" };
- CommandLine::Init(arraysize(kInitialArgv), kInitialArgv);
-
- // Set the application context in base.
- base::android::ScopedJavaLocalRef scoped_context(
- env, env->NewLocalRef(app_context));
- base::android::InitApplicationContext(scoped_context);
- base::android::RegisterJni(env);
-
- std::vector args;
- ParseArgsFromCommandLineFile(kCommandLineFilePath, &args);
-
- std::vector argv;
- int argc = ArgsToArgv(args, &argv);
-
- // Fully initialize command line with arguments.
- CommandLine::ForCurrentProcess()->AppendArguments(
- CommandLine(argc, &argv[0]), false);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- base::FilePath files_dir(
- base::android::ConvertJavaStringToUTF8(env, jfiles_dir));
-
- // A few options, such "--gtest_list_tests", will just use printf directly
- // Always redirect stdout to a known file.
- base::FilePath fifo_path(files_dir.Append(base::FilePath("test.fifo")));
- EnsureCreateFIFO(fifo_path);
-
- base::FilePath stderr_fifo_path, stdin_fifo_path;
-
- // DumpRenderTree needs a separate fifo for the stderr output. For all
- // other tests, insert stderr content to the same fifo we use for stdout.
- if (command_line.HasSwitch(kSeparateStderrFifo)) {
- stderr_fifo_path = files_dir.Append(base::FilePath("stderr.fifo"));
- EnsureCreateFIFO(stderr_fifo_path);
- }
-
- // DumpRenderTree uses stdin to receive input about which test to run.
- if (command_line.HasSwitch(kCreateStdinFifo)) {
- stdin_fifo_path = files_dir.Append(base::FilePath("stdin.fifo"));
- EnsureCreateFIFO(stdin_fifo_path);
- }
-
- // Only redirect the streams after all fifos have been created.
- EnsureRedirectStream(stdout, fifo_path, "w");
- if (!stdin_fifo_path.empty())
- EnsureRedirectStream(stdin, stdin_fifo_path, "r");
- if (!stderr_fifo_path.empty())
- EnsureRedirectStream(stderr, stderr_fifo_path, "w");
- else
- dup2(STDOUT_FILENO, STDERR_FILENO);
-
- if (command_line.HasSwitch(switches::kWaitForDebugger)) {
- AndroidLog(ANDROID_LOG_VERBOSE,
- "Native test waiting for GDB because flag %s was supplied",
- switches::kWaitForDebugger);
- base::debug::WaitForDebugger(24 * 60 * 60, false);
- }
-
- ScopedMainEntryLogger scoped_main_entry_logger;
- main(argc, &argv[0]);
-}
-
-// This is called by the VM when the shared library is first loaded.
-JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
- // Install signal handlers to detect crashes.
- InstallHandlers();
-
- base::android::InitVM(vm);
- JNIEnv* env = base::android::AttachCurrentThread();
- if (!RegisterNativesImpl(env)) {
- return -1;
- }
-
- return JNI_VERSION_1_4;
-}
diff --git a/testing/android/native_test_util.cc b/testing/android/native_test_util.cc
deleted file mode 100644
index c0ea7b0fef..0000000000
--- a/testing/android/native_test_util.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "testing/android/native_test_util.h"
-
-#include "base/file_util.h"
-#include "base/files/file_path.h"
-#include "base/strings/string_tokenizer.h"
-#include "base/strings/string_util.h"
-
-namespace {
-
-void ParseArgsFromString(const std::string& command_line,
- std::vector* args) {
- base::StringTokenizer tokenizer(command_line, kWhitespaceASCII);
- tokenizer.set_quote_chars("\"");
- while (tokenizer.GetNext()) {
- std::string token;
- RemoveChars(tokenizer.token(), "\"", &token);
- args->push_back(token);
- }
-}
-
-} // namespace
-
-namespace testing {
-namespace native_test_util {
-
-void ParseArgsFromCommandLineFile(
- const char* path, std::vector* args) {
- base::FilePath command_line(path);
- std::string command_line_string;
- if (file_util::ReadFileToString(command_line, &command_line_string)) {
- ParseArgsFromString(command_line_string, args);
- }
-}
-
-int ArgsToArgv(const std::vector& args,
- std::vector* argv) {
- // We need to pass in a non-const char**.
- int argc = args.size();
-
- argv->resize(argc + 1);
- for (int i = 0; i < argc; ++i) {
- (*argv)[i] = const_cast(args[i].c_str());
- }
- (*argv)[argc] = NULL; // argv must be NULL terminated.
-
- return argc;
-}
-
-} // namespace native_test_util
-} // namespace testing
diff --git a/testing/android/native_test_util.h b/testing/android/native_test_util.h
deleted file mode 100644
index a7567392b1..0000000000
--- a/testing/android/native_test_util.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TESTING_ANDROID_NATIVE_TEST_UTIL_
-#define TESTING_ANDROID_NATIVE_TEST_UTIL_
-
-#include
-#include
-#include
-
-// Helper methods for setting up environment for running gtest tests
-// inside an APK.
-namespace testing {
-namespace native_test_util {
-
-class ScopedMainEntryLogger {
- public:
- ScopedMainEntryLogger() {
- printf(">>ScopedMainEntryLogger\n");
- }
-
- ~ScopedMainEntryLogger() {
- printf("<* args);
-int ArgsToArgv(const std::vector& args, std::vector* argv);
-
-} // namespace native_test_util
-} // namespace testing
-
-#endif // TESTING_ANDROID_NATIVE_TEST_UTIL_
diff --git a/testing/generate_gmock_mutant.py b/testing/generate_gmock_mutant.py
deleted file mode 100755
index 6d814f0829..0000000000
--- a/testing/generate_gmock_mutant.py
+++ /dev/null
@@ -1,457 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import string
-import sys
-
-HEADER = """\
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file automatically generated by testing/generate_gmock_mutant.py.
-// DO NOT EDIT.
-
-#ifndef TESTING_GMOCK_MUTANT_H_
-#define TESTING_GMOCK_MUTANT_H_
-
-// The intention of this file is to make possible using GMock actions in
-// all of its syntactic beauty. Classes and helper functions can be used as
-// more generic variants of Task and Callback classes (see base/task.h)
-// Mutant supports both pre-bound arguments (like Task) and call-time
-// arguments (like Callback) - hence the name. :-)
-//
-// DispatchToMethod/Function supports two sets of arguments: pre-bound (P) and
-// call-time (C). The arguments as well as the return type are templatized.
-// DispatchToMethod/Function will also try to call the selected method or
-// function even if provided pre-bound arguments does not match exactly with
-// the function signature hence the X1, X2 ... XN parameters in CreateFunctor.
-// DispatchToMethod will try to invoke method that may not belong to the
-// object's class itself but to the object's class base class.
-//
-// Additionally you can bind the object at calltime by binding a pointer to
-// pointer to the object at creation time - before including this file you
-// have to #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING.
-//
-// TODO(stoyan): It's yet not clear to me should we use T& and T&* instead
-// of T* and T** when we invoke CreateFunctor to match the EXPECT_CALL style.
-//
-//
-// Sample usage with gMock:
-//
-// struct Mock : public ObjectDelegate {
-// MOCK_METHOD2(string, OnRequest(int n, const string& request));
-// MOCK_METHOD1(void, OnQuit(int exit_code));
-// MOCK_METHOD2(void, LogMessage(int level, const string& message));
-//
-// string HandleFlowers(const string& reply, int n, const string& request) {
-// string result = SStringPrintf("In request of %d %s ", n, request);
-// for (int i = 0; i < n; ++i) result.append(reply)
-// return result;
-// }
-//
-// void DoLogMessage(int level, const string& message) {
-// }
-//
-// void QuitMessageLoop(int seconds) {
-// MessageLoop* loop = MessageLoop::current();
-// loop->PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(),
-// 1000 * seconds);
-// }
-// };
-//
-// Mock mock;
-// // Will invoke mock.HandleFlowers("orchids", n, request)
-// // "orchids" is a pre-bound argument, and and are call-time
-// // arguments - they are not known until the OnRequest mock is invoked.
-// EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower"))
-// .Times(1)
-// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers,
-// string("orchids"))));
-//
-//
-// // No pre-bound arguments, two call-time arguments passed
-// // directly to DoLogMessage
-// EXPECT_CALL(mock, OnLogMessage(_, _))
-// .Times(AnyNumber())
-// .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage));
-//
-//
-// // In this case we have a single pre-bound argument - 3. We ignore
-// // all of the arguments of OnQuit.
-// EXCEPT_CALL(mock, OnQuit(_))
-// .Times(1)
-// .WillOnce(InvokeWithoutArgs(CreateFunctor(
-// &mock, &Mock::QuitMessageLoop, 3)));
-//
-// MessageLoop loop;
-// loop.Run();
-//
-//
-// // Here is another example of how we can set an action that invokes
-// // method of an object that is not yet created.
-// struct Mock : public ObjectDelegate {
-// MOCK_METHOD1(void, DemiurgeCreated(Demiurge*));
-// MOCK_METHOD2(void, OnRequest(int count, const string&));
-//
-// void StoreDemiurge(Demiurge* w) {
-// demiurge_ = w;
-// }
-//
-// Demiurge* demiurge;
-// }
-//
-// EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1)
-// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge)));
-//
-// EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick")))
-// .Times(AnyNumber())
-// .WillAlways(WithArgs<0>(Invoke(
-// CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters))));
-//
-
-#include "base/memory/linked_ptr.h"
-#include "base/tuple.h" // for Tuple
-
-namespace testing {"""
-
-MUTANT = """\
-
-// Interface that is exposed to the consumer, that does the actual calling
-// of the method.
-template
-class MutantRunner {
- public:
- virtual R RunWithParams(const Params& params) = 0;
- virtual ~MutantRunner() {}
-};
-
-// Mutant holds pre-bound arguments (like Task). Like Callback
-// allows call-time arguments. You bind a pointer to the object
-// at creation time.
-template
-class Mutant : public MutantRunner {
- public:
- Mutant(T* obj, Method method, const PreBound& pb)
- : obj_(obj), method_(method), pb_(pb) {
- }
-
- // MutantRunner implementation
- virtual R RunWithParams(const Params& params) {
- return DispatchToMethod(this->obj_, this->method_, pb_, params);
- }
-
- T* obj_;
- Method method_;
- PreBound pb_;
-};
-
-template
-class MutantFunction : public MutantRunner {
- public:
- MutantFunction(Function function, const PreBound& pb)
- : function_(function), pb_(pb) {
- }
-
- // MutantRunner implementation
- virtual R RunWithParams(const Params& params) {
- return DispatchToFunction(function_, pb_, params);
- }
-
- Function function_;
- PreBound pb_;
-};
-
-#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
-// MutantLateBind is like Mutant, but you bind a pointer to a pointer
-// to the object. This way you can create actions for an object
-// that is not yet created (has only storage for a pointer to it).
-template
-class MutantLateObjectBind : public MutantRunner {
- public:
- MutantLateObjectBind(T** obj, Method method, const PreBound& pb)
- : obj_(obj), method_(method), pb_(pb) {
- }
-
- // MutantRunner implementation.
- virtual R RunWithParams(const Params& params) {
- EXPECT_THAT(*this->obj_, testing::NotNull());
- if (NULL == *this->obj_)
- return R();
- return DispatchToMethod( *this->obj_, this->method_, pb_, params);
- }
-
- T** obj_;
- Method method_;
- PreBound pb_;
-};
-#endif
-
-// Simple MutantRunner<> wrapper acting as a functor.
-// Redirects operator() to MutantRunner::Run()
-template
-struct MutantFunctor {
- explicit MutantFunctor(MutantRunner* cb) : impl_(cb) {
- }
-
- ~MutantFunctor() {
- }
-
- inline R operator()() {
- return impl_->RunWithParams(Tuple0());
- }
-
- template
- inline R operator()(const Arg1& a) {
- return impl_->RunWithParams(Params(a));
- }
-
- template
- inline R operator()(const Arg1& a, const Arg2& b) {
- return impl_->RunWithParams(Params(a, b));
- }
-
- template
- inline R operator()(const Arg1& a, const Arg2& b, const Arg3& c) {
- return impl_->RunWithParams(Params(a, b, c));
- }
-
- template
- inline R operator()(const Arg1& a, const Arg2& b, const Arg3& c,
- const Arg4& d) {
- return impl_->RunWithParams(Params(a, b, c, d));
- }
-
- private:
- // We need copy constructor since MutantFunctor is copied few times
- // inside GMock machinery, hence no DISALLOW_EVIL_CONTRUCTORS
- MutantFunctor();
- linked_ptr > impl_;
-};
-"""
-
-FOOTER = """\
-} // namespace testing
-
-#endif // TESTING_GMOCK_MUTANT_H_"""
-
-# Templates for DispatchToMethod/DispatchToFunction functions.
-# template_params - typename P1, typename P2.. typename C1..
-# prebound - TupleN
-# calltime - TupleN
-# args - p.a, p.b.., c.a, c.b..
-DISPATCH_TO_METHOD_TEMPLATE = """\
-template
-inline R DispatchToMethod(T* obj, Method method,
- const %(prebound)s& p,
- const %(calltime)s& c) {
- return (obj->*method)(%(args)s);
-}
-"""
-
-DISPATCH_TO_FUNCTION_TEMPLATE = """\
-template
-inline R DispatchToFunction(Function function,
- const %(prebound)s& p,
- const %(calltime)s& c) {
- return (*function)(%(args)s);
-}
-"""
-
-# Templates for CreateFunctor functions.
-# template_params - typename P1, typename P2.. typename C1.. typename X1..
-# prebound - TupleN
-# calltime - TupleN
-# params - X1,.. , A1, ..
-# args - const P1& p1 ..
-# call_args - p1, p2, p3..
-CREATE_METHOD_FUNCTOR_TEMPLATE = """\
-template
-inline MutantFunctor
-CreateFunctor(T* obj, R (U::*method)(%(params)s), %(args)s) {
- MutantRunner* t =
- new Mutant
- (obj, method, MakeTuple(%(call_args)s));
- return MutantFunctor(t);
-}
-"""
-
-CREATE_FUNCTION_FUNCTOR_TEMPLATE = """\
-template
-inline MutantFunctor
-CreateFunctor(R (*function)(%(params)s), %(args)s) {
- MutantRunner* t =
- new MutantFunction
- (function, MakeTuple(%(call_args)s));
- return MutantFunctor(t);
-}
-"""
-
-def SplitLine(line, width):
- """Splits a single line at comma, at most |width| characters long."""
- if len(line) < width:
- return (line, None)
- n = 1 + line[:width].rfind(",")
- if n == 0: # If comma cannot be found give up and return the entire line.
- return (line, None)
- # Assume there is a space after the comma
- assert line[n] == " "
- return (line[:n], line[n + 1:])
-
-
-def Wrap(s, width, subsequent_offset=4):
- """Wraps a single line |s| at commas so every line is at most |width|
- characters long.
- """
- w = []
- spaces = " " * subsequent_offset
- while s:
- (f, s) = SplitLine(s, width)
- w.append(f)
- if s:
- s = spaces + s
- return "\n".join(w)
-
-
-def Clean(s):
- """Cleans artifacts from generated C++ code.
-
- Our simple string formatting/concatenation may introduce extra commas.
- """
- s = s.replace("<>", "")
- s = s.replace(", >", ">")
- s = s.replace(", )", ")")
- s = s.replace(">>", "> >")
- return s
-
-
-def ExpandPattern(pattern, it):
- """Return list of expanded pattern strings.
-
- Each string is created by replacing all '%' in |pattern| with element of |it|.
- """
- return [pattern.replace("%", x) for x in it]
-
-
-def Gen(pattern, n):
- """Expands pattern replacing '%' with sequential integers.
-
- Expanded patterns will be joined with comma separator.
- GenAlphs("X%", 3) will return "X1, X2, X3".
- """
- it = string.hexdigits[1:n + 1]
- return ", ".join(ExpandPattern(pattern, it))
-
-
-def GenAlpha(pattern, n):
- """Expands pattern replacing '%' with sequential small ASCII letters.
-
- Expanded patterns will be joined with comma separator.
- GenAlphs("X%", 3) will return "Xa, Xb, Xc".
- """
- it = string.ascii_lowercase[0:n]
- return ", ".join(ExpandPattern(pattern, it))
-
-
-def Merge(a):
- return ", ".join(filter(len, a))
-
-
-def GenTuple(pattern, n):
- return Clean("Tuple%d<%s>" % (n, Gen(pattern, n)))
-
-
-def FixCode(s):
- lines = Clean(s).splitlines()
- # Wrap sometimes very long 1st and 3rd line at 80th column.
- lines[0] = Wrap(lines[0], 80, 10)
- lines[2] = Wrap(lines[2], 80, 4)
- return "\n".join(lines)
-
-
-def GenerateDispatch(prebound, calltime):
- print "\n// %d - %d" % (prebound, calltime)
- args = {
- "template_params": Merge([Gen("typename P%", prebound),
- Gen("typename C%", calltime)]),
- "prebound": GenTuple("P%", prebound),
- "calltime": GenTuple("C%", calltime),
- "args": Merge([GenAlpha("p.%", prebound), GenAlpha("c.%", calltime)]),
- }
-
- print FixCode(DISPATCH_TO_METHOD_TEMPLATE % args)
- print FixCode(DISPATCH_TO_FUNCTION_TEMPLATE % args)
-
-
-def GenerateCreateFunctor(prebound, calltime):
- print "// %d - %d" % (prebound, calltime)
- args = {
- "calltime": GenTuple("A%", calltime),
- "prebound": GenTuple("P%", prebound),
- "params": Merge([Gen("X%", prebound), Gen("A%", calltime)]),
- "args": Gen("const P%& p%", prebound),
- "call_args": Gen("p%", prebound),
- "template_params": Merge([Gen("typename P%", prebound),
- Gen("typename A%", calltime),
- Gen("typename X%", prebound)])
- }
-
- mutant = FixCode(CREATE_METHOD_FUNCTOR_TEMPLATE % args)
- print mutant
-
- # Slightly different version for free function call.
- print "\n", FixCode(CREATE_FUNCTION_FUNCTOR_TEMPLATE % args)
-
- # Functor with pointer to a pointer of the object.
- print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
- mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
- mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind")
- mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple")
- print mutant2
- print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n"
-
- # OS_WIN specific. Same functors but with stdcall calling conventions.
- # These are not for WIN64 (x86_64) because there is only one calling
- # convention in WIN64.
- # Functor for method with __stdcall calling conventions.
- print "#if defined (OS_WIN) && !defined (ARCH_CPU_X86_64)"
- stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE
- stdcall_method = stdcall_method.replace("U::", "__stdcall U::")
- stdcall_method = FixCode(stdcall_method % args)
- print stdcall_method
- # Functor for free function with __stdcall calling conventions.
- stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE
- stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *")
- print "\n", FixCode(stdcall_function % args)
-
- print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
- stdcall2 = stdcall_method
- stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
- stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind")
- stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple")
- print stdcall2
- print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
- print "#endif // defined (OS_WIN) && !defined (ARCH_CPU_X86_64)\n"
-
-
-def main():
- print HEADER
- for prebound in xrange(0, 6 + 1):
- for args in xrange(0, 6 + 1):
- GenerateDispatch(prebound, args)
- print MUTANT
- for prebound in xrange(0, 6 + 1):
- for args in xrange(0, 6 + 1):
- GenerateCreateFunctor(prebound, args)
- print FOOTER
- return 0
-
-
-if __name__ == "__main__":
- sys.exit(main())
diff --git a/testing/gmock b/testing/gmock
deleted file mode 160000
index 6b1759c381..0000000000
--- a/testing/gmock
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 6b1759c3816d574bddde3e1725c51a811c8870e7
diff --git a/testing/gmock.gyp b/testing/gmock.gyp
deleted file mode 100644
index 22a1893bd2..0000000000
--- a/testing/gmock.gyp
+++ /dev/null
@@ -1,62 +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.
-
-{
- 'targets': [
- {
- 'target_name': 'gmock',
- 'type': 'static_library',
- 'dependencies': [
- 'gtest.gyp:gtest',
- ],
- 'sources': [
- # Sources based on files in r173 of gmock.
- 'gmock/include/gmock/gmock-actions.h',
- 'gmock/include/gmock/gmock-cardinalities.h',
- 'gmock/include/gmock/gmock-generated-actions.h',
- 'gmock/include/gmock/gmock-generated-function-mockers.h',
- 'gmock/include/gmock/gmock-generated-matchers.h',
- 'gmock/include/gmock/gmock-generated-nice-strict.h',
- 'gmock/include/gmock/gmock-matchers.h',
- 'gmock/include/gmock/gmock-spec-builders.h',
- 'gmock/include/gmock/gmock.h',
- 'gmock/include/gmock/internal/gmock-generated-internal-utils.h',
- 'gmock/include/gmock/internal/gmock-internal-utils.h',
- 'gmock/include/gmock/internal/gmock-port.h',
- 'gmock/src/gmock-all.cc',
- 'gmock/src/gmock-cardinalities.cc',
- 'gmock/src/gmock-internal-utils.cc',
- 'gmock/src/gmock-matchers.cc',
- 'gmock/src/gmock-spec-builders.cc',
- 'gmock/src/gmock.cc',
- 'gmock_mutant.h', # gMock helpers
- ],
- 'sources!': [
- 'gmock/src/gmock-all.cc', # Not needed by our build.
- ],
- 'include_dirs': [
- 'gmock',
- 'gmock/include',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- 'gmock/include', # So that gmock headers can find themselves.
- ],
- },
- 'export_dependent_settings': [
- 'gtest.gyp:gtest',
- ],
- },
- {
- 'target_name': 'gmock_main',
- 'type': 'static_library',
- 'dependencies': [
- 'gmock',
- ],
- 'sources': [
- 'gmock/src/gmock_main.cc',
- ],
- },
- ],
-}
diff --git a/testing/gmock_mutant.h b/testing/gmock_mutant.h
deleted file mode 100644
index 90d303efec..0000000000
--- a/testing/gmock_mutant.h
+++ /dev/null
@@ -1,4995 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file automatically generated by testing/generate_gmock_mutant.py.
-// DO NOT EDIT.
-
-#ifndef TESTING_GMOCK_MUTANT_H_
-#define TESTING_GMOCK_MUTANT_H_
-
-// The intention of this file is to make possible using GMock actions in
-// all of its syntactic beauty. Classes and helper functions can be used as
-// more generic variants of Task and Callback classes (see base/task.h)
-// Mutant supports both pre-bound arguments (like Task) and call-time
-// arguments (like Callback) - hence the name. :-)
-//
-// DispatchToMethod/Function supports two sets of arguments: pre-bound (P) and
-// call-time (C). The arguments as well as the return type are templatized.
-// DispatchToMethod/Function will also try to call the selected method or
-// function even if provided pre-bound arguments does not match exactly with
-// the function signature hence the X1, X2 ... XN parameters in CreateFunctor.
-// DispatchToMethod will try to invoke method that may not belong to the
-// object's class itself but to the object's class base class.
-//
-// Additionally you can bind the object at calltime by binding a pointer to
-// pointer to the object at creation time - before including this file you
-// have to #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING.
-//
-// TODO(stoyan): It's yet not clear to me should we use T& and T&* instead
-// of T* and T** when we invoke CreateFunctor to match the EXPECT_CALL style.
-//
-//
-// Sample usage with gMock:
-//
-// struct Mock : public ObjectDelegate {
-// MOCK_METHOD2(string, OnRequest(int n, const string& request));
-// MOCK_METHOD1(void, OnQuit(int exit_code));
-// MOCK_METHOD2(void, LogMessage(int level, const string& message));
-//
-// string HandleFlowers(const string& reply, int n, const string& request) {
-// string result = SStringPrintf("In request of %d %s ", n, request);
-// for (int i = 0; i < n; ++i) result.append(reply)
-// return result;
-// }
-//
-// void DoLogMessage(int level, const string& message) {
-// }
-//
-// void QuitMessageLoop(int seconds) {
-// base::MessageLoop* loop = base::MessageLoop::current();
-// loop->PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
-// 1000 * seconds);
-// }
-// };
-//
-// Mock mock;
-// // Will invoke mock.HandleFlowers("orchids", n, request)
-// // "orchids" is a pre-bound argument, and and are call-time
-// // arguments - they are not known until the OnRequest mock is invoked.
-// EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower"))
-// .Times(1)
-// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers,
-// string("orchids"))));
-//
-//
-// // No pre-bound arguments, two call-time arguments passed
-// // directly to DoLogMessage
-// EXPECT_CALL(mock, OnLogMessage(_, _))
-// .Times(AnyNumber())
-// .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage));
-//
-//
-// // In this case we have a single pre-bound argument - 3. We ignore
-// // all of the arguments of OnQuit.
-// EXCEPT_CALL(mock, OnQuit(_))
-// .Times(1)
-// .WillOnce(InvokeWithoutArgs(CreateFunctor(
-// &mock, &Mock::QuitMessageLoop, 3)));
-//
-// MessageLoop loop;
-// loop.Run();
-//
-//
-// // Here is another example of how we can set an action that invokes
-// // method of an object that is not yet created.
-// struct Mock : public ObjectDelegate {
-// MOCK_METHOD1(void, DemiurgeCreated(Demiurge*));
-// MOCK_METHOD2(void, OnRequest(int count, const string&));
-//
-// void StoreDemiurge(Demiurge* w) {
-// demiurge_ = w;
-// }
-//
-// Demiurge* demiurge;
-// }
-//
-// EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1)
-// .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge)));
-//
-// EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick")))
-// .Times(AnyNumber())
-// .WillAlways(WithArgs<0>(Invoke(
-// CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters))));
-//
-
-#include "base/memory/linked_ptr.h"
-#include "base/tuple.h" // for Tuple
-
-namespace testing {
-
-// 0 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple0& c) {
- return (obj->*method)();
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple0& c) {
- return (*function)();
-}
-
-// 0 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple1& c) {
- return (obj->*method)(c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple1& c) {
- return (*function)(c.a);
-}
-
-// 0 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple2& c) {
- return (obj->*method)(c.a, c.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple2& c) {
- return (*function)(c.a, c.b);
-}
-
-// 0 - 3
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple3& c) {
- return (obj->*method)(c.a, c.b, c.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple3& c) {
- return (*function)(c.a, c.b, c.c);
-}
-
-// 0 - 4
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple4& c) {
- return (obj->*method)(c.a, c.b, c.c, c.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple4& c) {
- return (*function)(c.a, c.b, c.c, c.d);
-}
-
-// 0 - 5
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple5& c) {
- return (obj->*method)(c.a, c.b, c.c, c.d, c.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple5& c) {
- return (*function)(c.a, c.b, c.c, c.d, c.e);
-}
-
-// 0 - 6
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple0& p,
- const Tuple6& c) {
- return (obj->*method)(c.a, c.b, c.c, c.d, c.e, c.f);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple0& p,
- const Tuple6& c) {
- return (*function)(c.a, c.b, c.c, c.d, c.e, c.f);
-}
-
-// 1 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple0& c) {
- return (obj->*method)(p.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple0& c) {
- return (*function)(p.a);
-}
-
-// 1 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple1& c) {
- return (obj->*method)(p.a, c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple1& c) {
- return (*function)(p.a, c.a);
-}
-
-// 1 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple2& c) {
- return (obj->*method)(p.a, c.a, c.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple2& c) {
- return (*function)(p.a, c.a, c.b);
-}
-
-// 1 - 3
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple3& c) {
- return (obj->*method)(p.a, c.a, c.b, c.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple3& c) {
- return (*function)(p.a, c.a, c.b, c.c);
-}
-
-// 1 - 4
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple4& c) {
- return (obj->*method)(p.a, c.a, c.b, c.c, c.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple4& c) {
- return (*function)(p.a, c.a, c.b, c.c, c.d);
-}
-
-// 1 - 5
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple5& c) {
- return (obj->*method)(p.a, c.a, c.b, c.c, c.d, c.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple5& c) {
- return (*function)(p.a, c.a, c.b, c.c, c.d, c.e);
-}
-
-// 1 - 6
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple1& p,
- const Tuple6& c) {
- return (obj->*method)(p.a, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple1& p,
- const Tuple6& c) {
- return (*function)(p.a, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-
-// 2 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple0& c) {
- return (obj->*method)(p.a, p.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple0& c) {
- return (*function)(p.a, p.b);
-}
-
-// 2 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple1& c) {
- return (obj->*method)(p.a, p.b, c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple1& c) {
- return (*function)(p.a, p.b, c.a);
-}
-
-// 2 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple2& c) {
- return (obj->*method)(p.a, p.b, c.a, c.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple2& c) {
- return (*function)(p.a, p.b, c.a, c.b);
-}
-
-// 2 - 3
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple3& c) {
- return (obj->*method)(p.a, p.b, c.a, c.b, c.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple3& c) {
- return (*function)(p.a, p.b, c.a, c.b, c.c);
-}
-
-// 2 - 4
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple4& c) {
- return (obj->*method)(p.a, p.b, c.a, c.b, c.c, c.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple4& c) {
- return (*function)(p.a, p.b, c.a, c.b, c.c, c.d);
-}
-
-// 2 - 5
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple5& c) {
- return (obj->*method)(p.a, p.b, c.a, c.b, c.c, c.d, c.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple5& c) {
- return (*function)(p.a, p.b, c.a, c.b, c.c, c.d, c.e);
-}
-
-// 2 - 6
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple2& p,
- const Tuple6& c) {
- return (obj->*method)(p.a, p.b, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple2& p,
- const Tuple6& c) {
- return (*function)(p.a, p.b, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-
-// 3 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple0& c) {
- return (obj->*method)(p.a, p.b, p.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple0& c) {
- return (*function)(p.a, p.b, p.c);
-}
-
-// 3 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple1& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple1& c) {
- return (*function)(p.a, p.b, p.c, c.a);
-}
-
-// 3 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple2& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a, c.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple2& c) {
- return (*function)(p.a, p.b, p.c, c.a, c.b);
-}
-
-// 3 - 3
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple3& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple3& c) {
- return (*function)(p.a, p.b, p.c, c.a, c.b, c.c);
-}
-
-// 3 - 4
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple4& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c, c.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple4& c) {
- return (*function)(p.a, p.b, p.c, c.a, c.b, c.c, c.d);
-}
-
-// 3 - 5
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple5& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c, c.d, c.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple5& c) {
- return (*function)(p.a, p.b, p.c, c.a, c.b, c.c, c.d, c.e);
-}
-
-// 3 - 6
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple3& p,
- const Tuple6& c) {
- return (obj->*method)(p.a, p.b, p.c, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple3& p,
- const Tuple6& c) {
- return (*function)(p.a, p.b, p.c, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-
-// 4 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple0& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple0& c) {
- return (*function)(p.a, p.b, p.c, p.d);
-}
-
-// 4 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple1& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple1& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a);
-}
-
-// 4 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple2& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple2& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a, c.b);
-}
-
-// 4 - 3
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple3& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple3& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c);
-}
-
-// 4 - 4
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple4& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple4& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d);
-}
-
-// 4 - 5
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple5& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d, c.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple5& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d, c.e);
-}
-
-// 4 - 6
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple4& p,
- const Tuple6& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple4& p,
- const Tuple6& c) {
- return (*function)(p.a, p.b, p.c, p.d, c.a, c.b, c.c, c.d, c.e, c.f);
-}
-
-// 5 - 0
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple5& p,
- const Tuple0& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, p.e);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple5& p,
- const Tuple0& c) {
- return (*function)(p.a, p.b, p.c, p.d, p.e);
-}
-
-// 5 - 1
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple5& p,
- const Tuple1& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, p.e, c.a);
-}
-template
-inline R DispatchToFunction(Function function,
- const Tuple5& p,
- const Tuple1& c) {
- return (*function)(p.a, p.b, p.c, p.d, p.e, c.a);
-}
-
-// 5 - 2
-template
-inline R DispatchToMethod(T* obj, Method method,
- const Tuple5& p,
- const Tuple2& c) {
- return (obj->*method)(p.a, p.b, p.c, p.d, p.e, c.a, c.b);
-}
-template