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

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

Issue 19079002: Enable pnacl by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: IOS flag name Created 7 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 | « chrome/test/nacl/nacl_browsertest_util.h ('k') | chrome/test/ppapi/ppapi_test.cc » ('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 48cde92d724d60d86a7866f68b313b1d9ca45e89..c1e56555447f31357ed469043411617c119913c5 100644
--- a/chrome/test/nacl/nacl_browsertest_util.cc
+++ b/chrome/test/nacl/nacl_browsertest_util.cc
@@ -187,6 +187,15 @@ static void AddPnaclParm(const base::FilePath::StringType& url,
}
}
+static void AddPnaclDisabledParm(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_disabled=1");
+ } else {
+ *url_with_parm = url + FILE_PATH_LITERAL("&pnacl_disabled=1");
+ }
+}
+
NaClBrowserTestBase::NaClBrowserTestBase() {
}
@@ -211,7 +220,11 @@ bool NaClBrowserTestBase::GetDocumentRoot(base::FilePath* document_root) {
return GetNaClVariantRoot(Variant(), document_root);
}
-bool NaClBrowserTestBase::IsPnacl() {
+bool NaClBrowserTestBase::IsAPnaclTest() {
+ return false;
+}
+
+bool NaClBrowserTestBase::IsPnaclDisabled() {
return false;
}
@@ -234,11 +247,15 @@ bool NaClBrowserTestBase::RunJavascriptTest(const GURL& url,
void NaClBrowserTestBase::RunLoadTest(
const base::FilePath::StringType& test_file) {
LoadTestMessageHandler handler;
- base::FilePath::StringType test_file_with_parm = test_file;
- if (IsPnacl()) {
- AddPnaclParm(test_file, &test_file_with_parm);
+ base::FilePath::StringType test_file_with_pnacl = test_file;
+ if (IsAPnaclTest()) {
+ AddPnaclParm(test_file, &test_file_with_pnacl);
}
- bool ok = RunJavascriptTest(TestURL(test_file_with_parm), &handler);
+ base::FilePath::StringType test_file_with_both = test_file_with_pnacl;
+ if (IsPnaclDisabled()) {
+ AddPnaclDisabledParm(test_file_with_pnacl, &test_file_with_both);
+ }
+ bool ok = RunJavascriptTest(TestURL(test_file_with_both), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
@@ -246,11 +263,15 @@ void NaClBrowserTestBase::RunLoadTest(
void NaClBrowserTestBase::RunNaClIntegrationTest(
const base::FilePath::StringType& url_fragment) {
NaClIntegrationMessageHandler handler;
- base::FilePath::StringType url_fragment_with_parm = url_fragment;
- if (IsPnacl()) {
- AddPnaclParm(url_fragment, &url_fragment_with_parm);
+ base::FilePath::StringType url_fragment_with_pnacl = url_fragment;
+ if (IsAPnaclTest()) {
+ AddPnaclParm(url_fragment, &url_fragment_with_pnacl);
+ }
+ base::FilePath::StringType url_fragment_with_both = url_fragment_with_pnacl;
+ if (IsPnaclDisabled()) {
+ AddPnaclDisabledParm(url_fragment_with_pnacl, &url_fragment_with_both);
}
- bool ok = RunJavascriptTest(TestURL(url_fragment_with_parm), &handler);
+ bool ok = RunJavascriptTest(TestURL(url_fragment_with_both), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
@@ -279,13 +300,25 @@ base::FilePath::StringType NaClBrowserTestPnacl::Variant() {
return FILE_PATH_LITERAL("pnacl");
}
-bool NaClBrowserTestPnacl::IsPnacl() {
+bool NaClBrowserTestPnacl::IsAPnaclTest() {
+ return true;
+}
+
+base::FilePath::StringType NaClBrowserTestPnaclDisabled::Variant() {
+ return FILE_PATH_LITERAL("pnacl");
+}
+
+bool NaClBrowserTestPnaclDisabled::IsAPnaclTest() {
+ return true;
+}
+
+bool NaClBrowserTestPnaclDisabled::IsPnaclDisabled() {
return true;
}
-void NaClBrowserTestPnacl::SetUpCommandLine(CommandLine* command_line) {
+void NaClBrowserTestPnaclDisabled::SetUpCommandLine(CommandLine* command_line) {
NaClBrowserTestBase::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnablePnacl);
+ command_line->AppendSwitch(switches::kDisablePnacl);
}
NaClBrowserTestPnaclWithNewCache::NaClBrowserTestPnaclWithNewCache() {
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.h ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698