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

Unified Diff: base/test/test_suite.cc

Issue 12321117: Refactor MainHook into TestSuite. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing test_suite changes Created 7 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
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index a55b8e08e2811517708f8cf263bb3d9b02c35701..fd8bf2e10d66cb9d4aadc9f079bbcd1699c704a6 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -26,6 +26,7 @@
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#if defined(OS_IOS)
+#include "base/test/run_hook_ios.h"
#include "base/test/test_listener_ios.h"
#else
#include "base/test/mock_chrome_application_mac.h"
@@ -116,6 +117,10 @@ void TestSuite::PreInitialize(int argc, char** argv,
at_exit_manager_.reset(new base::AtExitManager);
#endif
+#if defined(OS_IOS)
+ RunHook::Init(this, argc, argv);
+#endif
+
// Don't add additional code to this function. Instead add it to
// Initialize(). See bug 6436.
}
@@ -141,6 +146,14 @@ void TestSuite::ResetCommandLine() {
// Don't add additional code to this method. Instead add it to
// Initialize(). See bug 6436.
int TestSuite::Run() {
+#if defined(OS_IOS)
+ // When TestSuite::Run() is invoked initially, RunTestsFromApp() will fire up
+ // an iOS app which will invoke TestSuite::Run() again. On the second
+ // invocation, RunTestsFromApp is a no-op and TestSuite::Run() is procesessed
+ // normally, but in the context of the iOS app.
TVL 2013/02/27 15:59:35 I'd probably just put this comment on the RunTests
lliabraa 2013/02/27 20:31:31 Done.
+ RunHook::RunTestsFromApp();
+#endif
+
#if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool scoped_pool;
#endif

Powered by Google App Engine
This is Rietveld 408576698