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

Unified Diff: content/public/test/test_launcher.cc

Issue 17551010: GTTF: TestLauncher: asynchronous and out-of-order execution of tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more comments Created 7 years, 6 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 | « base/test/test_launcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_launcher.cc
diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc
index 058b04f017b354668fc4b3dbff6f5d0d712c80ab..bd6756fe64e8bfd8811a3576437439845753d420 100644
--- a/content/public/test/test_launcher.cc
+++ b/content/public/test/test_launcher.cc
@@ -230,8 +230,11 @@ class WrapperTestLauncherDelegate : public base::TestLauncherDelegate {
// base::TestLauncherDelegate:
virtual bool ShouldRunTest(const testing::TestCase* test_case,
const testing::TestInfo* test_info) OVERRIDE;
- virtual bool RunTest(const testing::TestCase* test_case,
- const testing::TestInfo* test_info) OVERRIDE;
+ virtual void RunTest(
+ const testing::TestCase* test_case,
+ const testing::TestInfo* test_info,
+ const base::TestLauncherDelegate::TestResultCallback& callback) OVERRIDE;
+ virtual void RunRemainingTests() OVERRIDE;
private:
content::TestLauncherDelegate* launcher_delegate_;
@@ -272,8 +275,11 @@ bool WrapperTestLauncherDelegate::ShouldRunTest(
return true;
}
-bool WrapperTestLauncherDelegate::RunTest(const testing::TestCase* test_case,
- const testing::TestInfo* test_info) {
+void WrapperTestLauncherDelegate::RunTest(
+ const testing::TestCase* test_case,
+ const testing::TestInfo* test_info,
+ const base::TestLauncherDelegate::TestResultCallback& callback) {
+ base::TimeTicks start_time = base::TimeTicks::Now();
bool was_timeout = false;
std::string test_name =
std::string(test_case->name()) + "." + test_info->name();
@@ -284,7 +290,18 @@ bool WrapperTestLauncherDelegate::RunTest(const testing::TestCase* test_case,
&was_timeout);
if (was_timeout)
timeout_count_++;
- return exit_code == 0;
+
+ base::TestResult result;
+ result.test_case_name = test_case->name();
+ result.test_name = test_info->name();
+ result.success = (exit_code == 0);
+ result.elapsed_time = (base::TimeTicks::Now() - start_time);
+
+ callback.Run(result);
+}
+
+void WrapperTestLauncherDelegate::RunRemainingTests() {
+ // No need to do anything here, we launch tests synchronously.
}
} // namespace
« no previous file with comments | « base/test/test_launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698