summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-26 18:43:13 +0000
committerbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-26 18:43:13 +0000
commit8c04d00b502df0f8e1d4c2f9397eb4540943007c (patch)
treeed5ea3da241795da890d6706ee884189312d61b7 /chrome
parent1f48f758c388b0f402e5c166a4d63b7460c7dfa4 (diff)
downloadchromium_src-8c04d00b502df0f8e1d4c2f9397eb4540943007c.zip
chromium_src-8c04d00b502df0f8e1d4c2f9397eb4540943007c.tar.gz
chromium_src-8c04d00b502df0f8e1d4c2f9397eb4540943007c.tar.bz2
Pepper browser tests: Only grant private permissions to private tests.
This allows us to exercise the quota checking machinery for PPB_FileIO. BUG=194304 Review URL: https://codereview.chromium.org/115693008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/ppapi/ppapi_browsertest.cc28
-rw-r--r--chrome/test/ppapi/ppapi_test.cc37
-rw-r--r--chrome/test/ppapi/ppapi_test.h29
3 files changed, 85 insertions, 9 deletions
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc
index 840b2a2..c0a8e7c 100644
--- a/chrome/test/ppapi/ppapi_browsertest.cc
+++ b/chrome/test/ppapi/ppapi_browsertest.cc
@@ -817,8 +817,10 @@ TEST_PPAPI_OUT_OF_PROCESS(VideoDecoder)
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
// TODO(erg): linux_aura bringup: http://crbug.com/318961
#define MAYBE_FileIO DISABLED_FileIO
+#define MAYBE_FileIO_Private DISABLED_FileIO_Private
#else
#define MAYBE_FileIO FileIO
+#define MAYBE_FileIO_Private FileIO_Private
#endif
// FileIO tests.
@@ -833,6 +835,10 @@ IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_FileIO) {
LIST_TEST(FileIO_ReadWriteSetLength)
LIST_TEST(FileIO_ReadToArrayWriteSetLength)
LIST_TEST(FileIO_TouchQuery)
+ );
+}
+IN_PROC_BROWSER_TEST_F(PPAPIPrivateTest, MAYBE_FileIO_Private) {
+ RunTestViaHTTP(
LIST_TEST(FileIO_RequestOSFileHandle)
LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive)
LIST_TEST(FileIO_Mmap)
@@ -848,6 +854,10 @@ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_FileIO) {
LIST_TEST(FileIO_ReadWriteSetLength)
LIST_TEST(FileIO_ReadToArrayWriteSetLength)
LIST_TEST(FileIO_TouchQuery)
+ );
+}
+IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPIPrivateTest, MAYBE_FileIO_Private) {
+ RunTestViaHTTP(
LIST_TEST(FileIO_RequestOSFileHandle)
LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive)
LIST_TEST(FileIO_Mmap)
@@ -856,8 +866,10 @@ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_FileIO) {
// Flaky on XP; times out, http://crbug.com/313401
#if defined(OS_WIN)
#define MAYBE_Nacl_Newlib_FileIO DISABLED_FileIO
+#define MAYBE_Nacl_Newlib_FileIO_Private DISABLED_FileIO_Private
#else
#define MAYBE_Nacl_Newlib_FileIO FileIO
+#define MAYBE_Nacl_Newlib_FileIO_Private FileIO_Private
#endif
IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_Nacl_Newlib_FileIO) {
RunTestViaHTTP(
@@ -869,6 +881,11 @@ IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_Nacl_Newlib_FileIO) {
LIST_TEST(FileIO_ReadWriteSetLength)
LIST_TEST(FileIO_ReadToArrayWriteSetLength)
LIST_TEST(FileIO_TouchQuery)
+ );
+}
+IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClNewlibTest,
+ MAYBE_Nacl_Newlib_FileIO_Private) {
+ RunTestViaHTTP(
LIST_TEST(FileIO_RequestOSFileHandle)
LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive)
LIST_TEST(FileIO_Mmap)
@@ -886,6 +903,11 @@ IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, DISABLED_NaCl_Glibc_FileIO) {
LIST_TEST(FileIO_ReadWriteSetLength)
LIST_TEST(FileIO_ReadToArrayWriteSetLength)
LIST_TEST(FileIO_TouchQuery)
+ );
+}
+IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClGLibcTest,
+ DISABLED_NaCl_Glibc_FileIO_Private) {
+ RunTestViaHTTP(
LIST_TEST(FileIO_RequestOSFileHandle)
LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive)
LIST_TEST(FileIO_Mmap)
@@ -894,8 +916,10 @@ IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, DISABLED_NaCl_Glibc_FileIO) {
// Flaky on XP; times out, http://crbug.com/313205
#if defined(OS_WIN)
#define MAYBE_PNaCl_FileIO DISABLED_FileIO
+#define MAYBE_PNaCl_FileIO_Private DISABLED_FileIO_Private
#else
#define MAYBE_PNaCl_FileIO FileIO
+#define MAYBE_PNaCl_FileIO_Private FileIO_Private
#endif
IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PNaCl_FileIO) {
RunTestViaHTTP(
@@ -907,6 +931,10 @@ IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PNaCl_FileIO) {
LIST_TEST(FileIO_ReadWriteSetLength)
LIST_TEST(FileIO_ReadToArrayWriteSetLength)
LIST_TEST(FileIO_TouchQuery)
+ );
+}
+IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClTest, MAYBE_PNaCl_FileIO_Private) {
+ RunTestViaHTTP(
LIST_TEST(FileIO_RequestOSFileHandle)
LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive)
LIST_TEST(FileIO_Mmap)
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 783ae0e..b21dc9c 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -42,6 +42,13 @@ const char library_name[] = "ppapi_tests.plugin";
const char library_name[] = "libppapi_tests.so";
#endif
+void AddPrivateSwitches(CommandLine* command_line) {
+ // For TestRequestOSFileHandle.
+ command_line->AppendSwitch(switches::kUnlimitedStorage);
+ command_line->AppendSwitchASCII(switches::kAllowNaClFileHandleAPI,
+ "127.0.0.1");
+}
+
} // namespace
PPAPITestMessageHandler::PPAPITestMessageHandler() {
@@ -132,11 +139,6 @@ void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) {
// Smooth scrolling confuses the scrollbar test.
command_line->AppendSwitch(switches::kDisableSmoothScrolling);
-
- // For TestRequestOSFileHandle.
- command_line->AppendSwitch(switches::kUnlimitedStorage);
- command_line->AppendSwitchASCII(switches::kAllowNaClFileHandleAPI,
- "127.0.0.1");
}
void PPAPITestBase::SetUpOnMainThread() {
@@ -319,6 +321,11 @@ std::string PPAPITest::BuildQuery(const std::string& base,
return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str());
}
+void PPAPIPrivateTest::SetUpCommandLine(CommandLine* command_line) {
+ PPAPITest::SetUpCommandLine(command_line);
+ AddPrivateSwitches(command_line);
+}
+
OutOfProcessPPAPITest::OutOfProcessPPAPITest() {
in_process_ = false;
}
@@ -329,6 +336,11 @@ void OutOfProcessPPAPITest::SetUpCommandLine(CommandLine* command_line) {
command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
}
+void OutOfProcessPPAPIPrivateTest::SetUpCommandLine(CommandLine* command_line) {
+ OutOfProcessPPAPITest::SetUpCommandLine(command_line);
+ AddPrivateSwitches(command_line);
+}
+
void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) {
PPAPITestBase::SetUpCommandLine(command_line);
@@ -350,6 +362,11 @@ std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base,
test_case.c_str());
}
+void PPAPIPrivateNaClNewlibTest::SetUpCommandLine(CommandLine* command_line) {
+ PPAPINaClNewlibTest::SetUpCommandLine(command_line);
+ AddPrivateSwitches(command_line);
+}
+
// Append the correct mode and testcase string
std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base,
const std::string& test_case) {
@@ -357,6 +374,11 @@ std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base,
test_case.c_str());
}
+void PPAPIPrivateNaClGLibcTest::SetUpCommandLine(CommandLine* command_line) {
+ PPAPINaClGLibcTest::SetUpCommandLine(command_line);
+ AddPrivateSwitches(command_line);
+}
+
// Append the correct mode and testcase string
std::string PPAPINaClPNaClTest::BuildQuery(const std::string& base,
const std::string& test_case) {
@@ -364,6 +386,11 @@ std::string PPAPINaClPNaClTest::BuildQuery(const std::string& base,
test_case.c_str());
}
+void PPAPIPrivateNaClPNaClTest::SetUpCommandLine(CommandLine* command_line) {
+ PPAPINaClPNaClTest::SetUpCommandLine(command_line);
+ AddPrivateSwitches(command_line);
+}
+
void PPAPINaClTestDisallowedSockets::SetUpCommandLine(
CommandLine* command_line) {
PPAPITestBase::SetUpCommandLine(command_line);
diff --git a/chrome/test/ppapi/ppapi_test.h b/chrome/test/ppapi/ppapi_test.h
index ed9265b..fb5e6c73 100644
--- a/chrome/test/ppapi/ppapi_test.h
+++ b/chrome/test/ppapi/ppapi_test.h
@@ -89,10 +89,6 @@ class PPAPITestBase : public InProcessBrowserTest {
GURL GetTestURL(const net::SpawnedTestServer& http_server,
const std::string& test_case,
const std::string& extra_params);
-
- // Return the document root for the HTTP server on which tests will be run.
- // The result is placed in |document_root|. False is returned upon failure.
- bool GetHTTPDocumentRoot(base::FilePath* document_root);
};
// In-process plugin test runner. See OutOfProcessPPAPITest below for the
@@ -109,6 +105,11 @@ class PPAPITest : public PPAPITestBase {
bool in_process_; // Controls the --ppapi-in-process switch.
};
+class PPAPIPrivateTest : public PPAPITest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
+};
+
// Variant of PPAPITest that runs plugins out-of-process to test proxy
// codepaths.
class OutOfProcessPPAPITest : public PPAPITest {
@@ -118,6 +119,11 @@ class OutOfProcessPPAPITest : public PPAPITest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
};
+class OutOfProcessPPAPIPrivateTest : public OutOfProcessPPAPITest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
+};
+
// NaCl plugin test runner for Newlib runtime.
class PPAPINaClTest : public PPAPITestBase {
public:
@@ -131,6 +137,11 @@ class PPAPINaClNewlibTest : public PPAPINaClTest {
const std::string& test_case) OVERRIDE;
};
+class PPAPIPrivateNaClNewlibTest : public PPAPINaClNewlibTest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
+};
+
// NaCl plugin test runner for GNU-libc runtime.
class PPAPINaClGLibcTest : public PPAPINaClTest {
public:
@@ -138,6 +149,11 @@ class PPAPINaClGLibcTest : public PPAPINaClTest {
const std::string& test_case) OVERRIDE;
};
+class PPAPIPrivateNaClGLibcTest : public PPAPINaClGLibcTest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
+};
+
// NaCl plugin test runner for the PNaCl + Newlib runtime.
class PPAPINaClPNaClTest : public PPAPINaClTest {
public:
@@ -145,6 +161,11 @@ class PPAPINaClPNaClTest : public PPAPINaClTest {
const std::string& test_case) OVERRIDE;
};
+class PPAPIPrivateNaClPNaClTest : public PPAPINaClPNaClTest {
+ protected:
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
+};
+
class PPAPINaClTestDisallowedSockets : public PPAPITestBase {
public:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;