| Index: Source/web/tests/RunAllTests.cpp
|
| diff --git a/Source/web/tests/RunAllTests.cpp b/Source/web/tests/RunAllTests.cpp
|
| index 97fa90b3a5d3e666f6f9bb0000809f63f12b0851..9160a6dce9c01d07f494adce327ad72dd9457821 100644
|
| --- a/Source/web/tests/RunAllTests.cpp
|
| +++ b/Source/web/tests/RunAllTests.cpp
|
| @@ -32,35 +32,28 @@
|
| #include "config.h"
|
| #endif
|
|
|
| -// FIXME: Avoid this source dependency on Chromium's base module.
|
| -#include <base/test/test_suite.h>
|
| -
|
| #include "public/platform/Platform.h"
|
| #include "public/web/WebKit.h"
|
| +#include "web/tests/WebUnitTests.h"
|
| #include <content/test/webkit_support.h>
|
|
|
| -#if defined(BLINK_DLL_UNITTEST)
|
| -#include "web/tests/WebUnitTests.h"
|
| -#endif
|
| +namespace {
|
|
|
| -// TestSuite must be created before SetUpTestEnvironment so it performs
|
| -// initializations needed by WebKit support. This is slightly complicated by the
|
| -// fact that chromium multi-dll build requires that the TestSuite object be created
|
| -// and run inside blink_web.dll.
|
| -int main(int argc, char** argv)
|
| +// Test helpers to support the fact that blink tests are gloriously complicated
|
| +// in a shared library build. See WebUnitTests.h for more details.
|
| +void preTestHook()
|
| {
|
| -#if defined(BLINK_DLL_UNITTEST)
|
| - blink::InitTestSuite(argc, argv);
|
| - content::SetUpTestEnvironmentForUnitTests();
|
| - int result = blink::RunAllUnitTests();
|
| - content::TearDownTestEnvironment();
|
| - blink::DeleteTestSuite();
|
| -#else
|
| - TestSuite testSuite(argc, argv);
|
| content::SetUpTestEnvironmentForUnitTests();
|
| - int result = testSuite.Run();
|
| +}
|
| +
|
| +void postTestHook()
|
| +{
|
| content::TearDownTestEnvironment();
|
| -#endif
|
| +}
|
|
|
| - return result;
|
| +} // namespace
|
| +
|
| +int main(int argc, char** argv)
|
| +{
|
| + return blink::runWebTests(argc, argv, &preTestHook, &postTestHook);
|
| }
|
|
|