| 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.";
|
| }
|
|
|