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 19758e1c696aa6306cba950aa57358c49f3f2d1f..9c1d57d8ac736a083dc52059cbb46575787a8b53 100644 |
--- a/chrome/test/nacl/nacl_browsertest_util.cc |
+++ b/chrome/test/nacl/nacl_browsertest_util.cc |
@@ -169,6 +169,7 @@ MessageResponse NaClIntegrationMessageHandler::HandleStructuredMessage( |
// nacl_test_data/ |
// newlib/ |
// glibc/ |
+// pnacl/ |
static bool GetNaClVariantRoot(const base::FilePath::StringType& variant, |
base::FilePath* document_root) { |
if (!ui_test_utils::GetRelativeBuildDirectory(document_root)) |
@@ -261,7 +262,7 @@ void NaClBrowserTestBase::RunLoadTest( |
} |
void NaClBrowserTestBase::RunNaClIntegrationTest( |
- const base::FilePath::StringType& url_fragment) { |
+ const base::FilePath::StringType& url_fragment, bool full_url) { |
NaClIntegrationMessageHandler handler; |
base::FilePath::StringType url_fragment_with_pnacl = url_fragment; |
if (IsAPnaclTest()) { |
@@ -271,7 +272,10 @@ void NaClBrowserTestBase::RunNaClIntegrationTest( |
if (IsPnaclDisabled()) { |
AddPnaclDisabledParm(url_fragment_with_pnacl, &url_fragment_with_both); |
} |
- bool ok = RunJavascriptTest(TestURL(url_fragment_with_both), &handler); |
+ bool ok = RunJavascriptTest(full_url |
+ ? GURL(url_fragment_with_both) |
+ : TestURL(url_fragment_with_both), |
+ &handler); |
ASSERT_TRUE(ok) << handler.error_message(); |
ASSERT_TRUE(handler.test_passed()) << "Test failed."; |
} |
@@ -349,3 +353,21 @@ void NaClBrowserTestPnaclNonSfi::SetUpCommandLine( |
NaClBrowserTestBase::SetUpCommandLine(command_line); |
command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); |
} |
+ |
+void NaClBrowserTestNewlibExtension::SetUpCommandLine( |
+ CommandLine* command_line) { |
+ NaClBrowserTestBase::SetUpCommandLine(command_line); |
+ base::FilePath src_root; |
+ ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_root)); |
+ |
+ // Extension-based tests should specialize the GetDocumentRoot() / Variant() |
+ // to point at the isolated the test extension directory. |
+ // Otherwise, multiple NaCl extensions tests will end up sharing the |
+ // same directory when loading the extension files. |
+ base::FilePath document_root; |
+ ASSERT_TRUE(GetDocumentRoot(&document_root)); |
+ |
+ // Document root is relative to source root, and source root may not be CWD. |
+ command_line->AppendSwitchPath(switches::kLoadExtension, |
+ src_root.Append(document_root)); |
+} |