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

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

Issue 263683002: Set file tokens for NaCl main nexe if available to enable validation caching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: concat filepath literal Created 6 years, 7 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') | components/nacl/browser/nacl_browser.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 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));
+}
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.h ('k') | components/nacl/browser/nacl_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698