diff options
author | leng@chromium.org <leng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 09:21:34 +0000 |
---|---|---|
committer | leng@chromium.org <leng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 09:21:34 +0000 |
commit | 73b3242f5b0c21820e41c6f7811a6436cd161d41 (patch) | |
tree | 875ff3b5fd4cd29d07192bb0cebeb0054bdb60d0 /base/test/test_suite.cc | |
parent | 6add19457a1cbc140992ed31eec110945a5255fa (diff) | |
download | chromium_src-73b3242f5b0c21820e41c6f7811a6436cd161d41.zip chromium_src-73b3242f5b0c21820e41c6f7811a6436cd161d41.tar.gz chromium_src-73b3242f5b0c21820e41c6f7811a6436cd161d41.tar.bz2 |
Make it possible to run gtests on iOS.
Adds MainHook object to run_all_unittests main() and run_all_perftest main(), so tests run without beng killed by the OS. (If an application does not check in within a certain amount of time after launch, it will be killed.) The object is empty for non-iOS.
Adds test_listener_ios to test_suite, which registers to be notified on test end. At test end, it runs the run loop to prevent the test run from being killed by the OS.
Disables two tests for iOS: BooleanOperators and StringPattern.
BUG=b/6753976
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10690161
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/test_suite.cc')
-rw-r--r-- | base/test/test_suite.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 0cca8fa..05a6069b 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -25,9 +25,11 @@ #if defined(OS_MACOSX) #include "base/mac/scoped_nsautorelease_pool.h" -#if !defined(OS_IOS) +#if defined(OS_IOS) +#include "base/test/test_listener_ios.h" +#else #include "base/test/mock_chrome_application_mac.h" -#endif // !OS_IOS +#endif // OS_IOS #endif // OS_MACOSX #if defined(OS_ANDROID) @@ -234,6 +236,9 @@ int TestSuite::Run() { // Check to see if we are being run as a client process. if (!client_func.empty()) return multi_process_function_list::InvokeChildProcessTest(client_func); +#if defined(OS_IOS) + base::test_listener_ios::RegisterTestEndListener(); +#endif int result = RUN_ALL_TESTS(); // If there are failed tests, see if we should ignore the failures. |