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

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

Issue 23326003: Enable PNaCl by default (revert disabling CL) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for Jan's comments. Created 7 years, 4 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 1c171a75e4d3d5361e12cca8abf4cc5bc1ad8831..ace7305d6a0c990c78369f78e884899438182616 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() {
}
@@ -210,7 +219,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;
}
@@ -233,11 +246,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);
+ }
+ 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_parm), &handler);
+ bool ok = RunJavascriptTest(TestURL(test_file_with_both), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
@@ -245,11 +262,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);
}
- bool ok = RunJavascriptTest(TestURL(url_fragment_with_parm), &handler);
+ 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_both), &handler);
ASSERT_TRUE(ok) << handler.error_message();
ASSERT_TRUE(handler.test_passed()) << "Test failed.";
}
@@ -278,13 +299,24 @@ base::FilePath::StringType NaClBrowserTestPnacl::Variant() {
return FILE_PATH_LITERAL("pnacl");
}
-bool NaClBrowserTestPnacl::IsPnacl() {
+bool NaClBrowserTestPnacl::IsAPnaclTest() {
return true;
}
-void NaClBrowserTestPnacl::SetUpCommandLine(CommandLine* command_line) {
+base::FilePath::StringType NaClBrowserTestPnaclDisabled::Variant() {
+ return FILE_PATH_LITERAL("pnacl");
+}
+
+bool NaClBrowserTestPnaclDisabled::IsAPnaclTest() {
+ return true;
+}
+
+bool NaClBrowserTestPnaclDisabled::IsPnaclDisabled() {
+ return true;
+}
+void NaClBrowserTestPnaclDisabled::SetUpCommandLine(CommandLine* command_line) {
NaClBrowserTestBase::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnablePnacl);
+ command_line->AppendSwitch(switches::kDisablePnacl);
}
NaClBrowserTestPnaclWithOldCache::NaClBrowserTestPnaclWithOldCache() {
« 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