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

Unified Diff: chrome/test/nacl/nacl_browsertest_util.cc

Issue 16296005: Split pnacl and nacl mime types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: After (hopefully) last rebase. Created 7 years, 6 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 | « chrome/test/nacl/nacl_browsertest.cc ('k') | ppapi/native_client/src/trusted/plugin/json_manifest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/nacl/nacl_browsertest_util.cc
diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc
index 9701e6677ffd8b6751b08e5acc3d1e240cc349b9..77136b73aed161a6558d14b0671ebd25c0daf105 100644
--- a/chrome/test/nacl/nacl_browsertest_util.cc
+++ b/chrome/test/nacl/nacl_browsertest_util.cc
@@ -177,6 +177,15 @@ static bool GetNaClVariantRoot(const base::FilePath::StringType& variant,
return true;
}
+static void AddPnaclParm(const base::FilePath::StringType& url,
+ base::FilePath::StringType* url_with_parm) {
+ if (url.find(FILE_PATH_LITERAL("?")) == base::FilePath::StringType::npos) {
+ *url_with_parm = url + FILE_PATH_LITERAL("?pnacl=1");
+ } else {
+ *url_with_parm = url + FILE_PATH_LITERAL("&pnacl=1");
+ }
+}
+
NaClBrowserTestBase::NaClBrowserTestBase() {
}
@@ -224,7 +233,11 @@ bool NaClBrowserTestBase::RunJavascriptTest(const GURL& url,
void NaClBrowserTestBase::RunLoadTest(
const base::FilePath::StringType& test_file) {
LoadTestMessageHandler handler;
- bool ok = RunJavascriptTest(TestURL(test_file), &handler);
+ base::FilePath::StringType test_file_with_parm = test_file;
+ if (IsPnacl()) {
+ AddPnaclParm(test_file, &test_file_with_parm);
+ }
+ bool ok = RunJavascriptTest(TestURL(test_file_with_parm), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
@@ -232,7 +245,11 @@ void NaClBrowserTestBase::RunLoadTest(
void NaClBrowserTestBase::RunNaClIntegrationTest(
const base::FilePath::StringType& url_fragment) {
NaClIntegrationMessageHandler handler;
- bool ok = RunJavascriptTest(TestURL(url_fragment), &handler);
+ base::FilePath::StringType url_fragment_with_parm = url_fragment;
+ if (IsPnacl()) {
+ AddPnaclParm(url_fragment, &url_fragment_with_parm);
+ }
+ bool ok = RunJavascriptTest(TestURL(url_fragment_with_parm), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
« no previous file with comments | « chrome/test/nacl/nacl_browsertest.cc ('k') | ppapi/native_client/src/trusted/plugin/json_manifest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698