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

Unified Diff: tests/test_instance.cc

Issue 2901005: Add support for running all tests with a single click from test_case.html.... (Closed) Base URL: http://ppapi.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 5 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 | « tests/test_case.html ('k') | tests/test_page.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_instance.cc
===================================================================
--- tests/test_instance.cc (revision 141)
+++ tests/test_instance.cc (working copy)
@@ -4,6 +4,7 @@
#include "ppapi/tests/test_instance.h"
+#include <algorithm>
#include <string.h>
#include "ppapi/cpp/module.h"
@@ -107,18 +108,25 @@
void TestInstance::LogAvailableTests() {
// Print out a listing of all tests.
+ std::vector<std::string> test_cases;
+ TestCaseFactory* iter = TestCaseFactory::head_;
+ while (iter != NULL) {
+ test_cases.push_back(iter->name_);
+ iter = iter->next_;
+ }
+ std::sort(test_cases.begin(), test_cases.end());
+
std::string html;
html.append("Available test cases: <dl>");
- TestCaseFactory* iter = TestCaseFactory::head_;
- while (iter != NULL) {
+ for (size_t i = 0; i < test_cases.size(); ++i) {
html.append("<dd><a href='?");
- html.append(iter->name_);
+ html.append(test_cases[i]);
html.append("'>");
- html.append(iter->name_);
+ html.append(test_cases[i]);
html.append("</a></dd>");
- iter = iter->next_;
}
html.append("</dl>");
+ html.append("<button onclick='RunAll()'>Run All Tests</button>");
LogHTML(html);
}
« no previous file with comments | « tests/test_case.html ('k') | tests/test_page.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698