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

Unified Diff: ppapi/tests/testing_instance.cc

Issue 8536031: Reland http://codereview.chromium.org/8477015 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge AGAIN Created 9 years, 1 month 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 | « ppapi/tests/testing_instance.h ('k') | tools/valgrind/gtest_exclude/ui_tests.gtest.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/testing_instance.cc
diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc
index e50bb5a3610ad0b0cd3cf10a97a6560fc50edd8c..056477daaaa4014e1ebbcc57e611edcd11fced02 100644
--- a/ppapi/tests/testing_instance.cc
+++ b/ppapi/tests/testing_instance.cc
@@ -56,6 +56,7 @@ bool TestingInstance::Init(uint32_t argc,
if (argv[i][0] == '\0')
break;
current_case_ = CaseForTestName(argv[i]);
+ test_filter_ = FilterForTestName(argv[i]);
if (!current_case_)
errors_.append(std::string("Unknown test case ") + argv[i]);
else if (!current_case_->Init())
@@ -144,7 +145,7 @@ void TestingInstance::ExecuteTests(int32_t unused) {
LogAvailableTests();
errors_.append("FAIL: Only listed tests");
} else {
- current_case_->RunTest();
+ current_case_->RunTests(test_filter_);
// Automated PyAuto tests rely on finding the exact strings below.
LogHTML(errors_.empty() ?
"<span class=\"pass\">[SHUTDOWN]</span> All tests passed." :
@@ -156,16 +157,24 @@ void TestingInstance::ExecuteTests(int32_t unused) {
PostMessage(pp::Var("TESTING_MESSAGE:DidExecuteTests"));
}
-TestCase* TestingInstance::CaseForTestName(const char* name) {
+TestCase* TestingInstance::CaseForTestName(const std::string& name) {
+ std::string case_name = name.substr(0, name.find_first_of('_'));
TestCaseFactory* iter = TestCaseFactory::head_;
while (iter != NULL) {
- if (std::strcmp(name, iter->name_) == 0)
+ if (case_name == iter->name_)
return iter->method_(this);
iter = iter->next_;
}
return NULL;
}
+std::string TestingInstance::FilterForTestName(const std::string& name) {
+ size_t delim = name.find_first_of('_');
+ if (delim != std::string::npos)
+ return name.substr(delim+1);
+ return "";
+}
+
void TestingInstance::LogAvailableTests() {
// Print out a listing of all tests.
std::vector<std::string> test_cases;
« no previous file with comments | « ppapi/tests/testing_instance.h ('k') | tools/valgrind/gtest_exclude/ui_tests.gtest.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698