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

Unified Diff: ppapi/tests/test_case.cc

Issue 21833005: Fix PPAPI TestCase so individual tests can be run more than once. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Robustify. Created 7 years, 4 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 | « ppapi/tests/test_case.h ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_case.cc
diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc
index 733faadbb1600c6944049f64c4b5ff3795e8cd70..6f61fc505ac2289aa683de7680b5f01a4eae6fdb 100644
--- a/ppapi/tests/test_case.cc
+++ b/ppapi/tests/test_case.cc
@@ -81,7 +81,7 @@ TestCase::TestCase(TestingInstance* instance)
: instance_(instance),
testing_interface_(NULL),
callback_type_(PP_REQUIRED),
- have_populated_remaining_tests_(false) {
+ have_populated_filter_tests_(false) {
// Get the testing_interface_ if it is available, so that we can do Resource
// and Var checks on shutdown (see CheckResourcesAndVars). If it is not
// available, testing_interface_ will be NULL. Some tests do not require it.
@@ -181,21 +181,21 @@ bool TestCase::ShouldRunTest(const std::string& test_name,
if (ShouldRunAllTests(filter))
return true;
- // Lazily initialize our "remaining_tests_" map.
- if (!have_populated_remaining_tests_) {
- ParseTestFilter(filter, &remaining_tests_);
- have_populated_remaining_tests_ = true;
+ // Lazily initialize our "filter_tests_" map.
+ if (!have_populated_filter_tests_) {
+ ParseTestFilter(filter, &filter_tests_);
+ remaining_tests_ = filter_tests_;
+ have_populated_filter_tests_ = true;
}
- std::map<std::string, bool>::iterator iter = remaining_tests_.find(test_name);
- if (iter == remaining_tests_.end()) {
+ std::map<std::string, bool>::iterator iter = filter_tests_.find(test_name);
+ if (iter == filter_tests_.end()) {
// The test name wasn't listed in the filter. Don't run it, but store it
// so TestingInstance::ExecuteTests can report an error later.
skipped_tests_.insert(test_name);
return false;
}
- bool should_run_test = iter->second;
- remaining_tests_.erase(iter);
- return should_run_test;
+ remaining_tests_.erase(test_name);
+ return iter->second;
}
PP_TimeTicks TestCase::NowInTimeTicks() {
« no previous file with comments | « ppapi/tests/test_case.h ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698