Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: third_party/WebKit/Source/web/tests/RunAllTests.cpp

Issue 1758063002: Merge WebUnitTests.cpp into RunAllTests.cpp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/tests/DEPS ('k') | third_party/WebKit/Source/web/tests/WebUnitTests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/RunAllTests.cpp
diff --git a/third_party/WebKit/Source/web/tests/RunAllTests.cpp b/third_party/WebKit/Source/web/tests/RunAllTests.cpp
index 9aab82dcd8579ccd210b923d2336e6a25bfeb891..b23f3df1ee42afa3e2eb8d29cfa16fee63a30ce0 100644
--- a/third_party/WebKit/Source/web/tests/RunAllTests.cpp
+++ b/third_party/WebKit/Source/web/tests/RunAllTests.cpp
@@ -28,28 +28,43 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "public/platform/Platform.h"
-#include "public/web/WebKit.h"
-#include "web/tests/WebUnitTests.h"
-#include <content/test/blink_test_environment.h>
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+#include "bindings/core/v8/V8GCController.h"
+#include "content/test/blink_test_environment.h"
+#include "platform/weborigin/SchemeRegistry.h"
+#include <v8.h>
namespace {
-// 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()
+int runHelper(base::TestSuite* testSuite)
{
content::SetUpBlinkTestEnvironment();
-}
+ blink::SchemeRegistry::initialize();
+
+ int result = testSuite->Run();
+
+ // Tickle EndOfTaskRunner which among other things will flush the queue
+ // of error messages via V8Initializer::reportRejectedPromisesOnMainThread.
+ base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothing));
+ base::RunLoop().RunUntilIdle();
+
+ // Collect garbage in order to release mock objects referred from v8 or
+ // Oilpan heap. Otherwise false mock leaks will be reported.
+ blink::V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent());
-void postTestHook()
-{
content::TearDownBlinkTestEnvironment();
+
+ return result;
}
} // namespace
int main(int argc, char** argv)
{
- return blink::runWebTests(argc, argv, &preTestHook, &postTestHook);
+ base::TestSuite testSuite(argc, argv);
+ return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unretained(&testSuite)));
}
« no previous file with comments | « third_party/WebKit/Source/web/tests/DEPS ('k') | third_party/WebKit/Source/web/tests/WebUnitTests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698