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

Unified Diff: ppapi/tests/test_case.html

Issue 4991006: Run Pepper unit tests in Native Client.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 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/cpp/var.cc ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_case.html
===================================================================
--- ppapi/tests/test_case.html (revision 66122)
+++ ppapi/tests/test_case.html (working copy)
@@ -48,21 +48,44 @@
LoadNext(0);
}
+function ExtractSearchParameter( name ) {
darin (slow to review) 2010/11/16 00:23:20 style nit: no spaces around the parameter name
+ var nameIndex = location.search.indexOf(name + "=");
+ if (nameIndex != -1) {
+ var value = location.search.substring(nameIndex + name.length + 1);
+ var endIndex = value.indexOf("&");
+ if (endIndex != -1)
+ value = value.substring(0, endIndex);
+ return value;
+ }
+ return "";
+}
+
onload = function() {
- var mimeType = "application/x-ppapi-tests";
- if (mimeType in navigator.mimeTypes) {
- var testcase = location.search.substring(1);
- document.title = 'Test ' + testcase;
-
- var obj = document.createElement("OBJECT");
+ var testcase = ExtractSearchParameter("testcase");
+ var mode = ExtractSearchParameter("mode");
+ document.title = 'Test ' + testcase;
+ var obj;
+ if (mode == "nacl") {
+ var nexes = "ARM: ppapi_tests_arm.nexe \nx86-32: ppapi_tests.nexe \nx86-64: ppapi_tests_x86_64.";
+ obj = document.createElement("OBJECT");
+ obj.setAttribute("type", "application/x-ppapi-nacl-srpc");
+ obj.setAttribute("nexes", nexes);
+ obj.setAttribute("mode", mode);
+ } else {
+ var mimeType = "application/x-ppapi-tests";
+ if (mimeType in navigator.mimeTypes) {
+ obj = document.createElement("OBJECT");
+ obj.setAttribute("type", mimeType);
+ } else {
+ document.getElementById("console").innerHTML =
+ '<span class="fail">FAIL</span>: ' +
+ '<span class="err_msg">Test plug-in is not registered.</span>';
+ }
+ }
+ if (obj) {
obj.setAttribute("id", "plugin");
- obj.setAttribute("type", mimeType);
obj.setAttribute("testcase", testcase);
document.getElementById("container").appendChild(obj);
- } else {
- document.getElementById("console").innerHTML =
- '<span class="fail">FAIL</span>: ' +
- '<span class="err_msg">Test plug-in is not registered.</span>';
}
}
</script>
« no previous file with comments | « ppapi/cpp/var.cc ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698