summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 18:51:20 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 18:51:20 +0000
commit2baf7ace0bf418c1b59e3a4d62a6338fb2a32d36 (patch)
treeb72411ff36628177686bdaa55d2d5da724970d55 /ppapi
parentbf10a92d59313ae8c6fa8013971ce7f6a002d648 (diff)
downloadchromium_src-2baf7ace0bf418c1b59e3a4d62a6338fb2a32d36.zip
chromium_src-2baf7ace0bf418c1b59e3a4d62a6338fb2a32d36.tar.gz
chromium_src-2baf7ace0bf418c1b59e3a4d62a6338fb2a32d36.tar.bz2
Fixed bug causing invalid PPAPI test to PASS.
If a test was run with a filter that did not name a valid test, no test would be run and success would be reported. This is bad because it allows a test to be added to ppapi_uitest.cc which does not run and no error is raised. This also fixes all existing invalid tests. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10627012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/tests/testing_instance.cc19
-rw-r--r--ppapi/tests/testing_instance.h3
2 files changed, 18 insertions, 4 deletions
diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc
index f19292f..f505ff7 100644
--- a/ppapi/tests/testing_instance.cc
+++ b/ppapi/tests/testing_instance.cc
@@ -30,6 +30,7 @@ TestingInstance::TestingInstance(PP_Instance instance)
#endif
current_case_(NULL),
executed_tests_(false),
+ number_tests_executed_(0),
nacl_mode_(false),
ssl_server_port_(-1),
websocket_port_(-1) {
@@ -120,6 +121,8 @@ void TestingInstance::LogTest(const std::string& test_name,
// Tell the browser we're still working.
ReportProgress(kProgressSignal);
+ number_tests_executed_++;
+
std::string html;
html.append("<div class=\"test_line\"><span class=\"test_name\">");
html.append(test_name);
@@ -160,10 +163,18 @@ void TestingInstance::ExecuteTests(int32_t unused) {
errors_.append("FAIL: Only listed tests");
} else {
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." :
- "<span class=\"fail\">[SHUTDOWN]</span> Some tests failed.");
+
+ if (number_tests_executed_ == 0) {
+ errors_.append("No tests executed. The test filter might be too "
+ "restrictive: '" + test_filter_ + "'.");
+ LogError(errors_);
+ }
+ else {
+ // Automated PyAuto tests rely on finding the exact strings below.
+ LogHTML(errors_.empty() ?
+ "<span class=\"pass\">[SHUTDOWN]</span> All tests passed." :
+ "<span class=\"fail\">[SHUTDOWN]</span> Some tests failed.");
+ }
}
// Declare we're done by setting a cookie to either "PASS" or the errors.
diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h
index b5a6333..8aeecfe 100644
--- a/ppapi/tests/testing_instance.h
+++ b/ppapi/tests/testing_instance.h
@@ -141,6 +141,9 @@ pp::InstancePrivate {
// Set once the tests are run so we know not to re-run when the view is sized.
bool executed_tests_;
+ // The number of tests executed so far.
+ int32_t number_tests_executed_;
+
// Collects all errors to send the the browser. Empty indicates no error yet.
std::string errors_;