summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorygorshenin@google.com <ygorshenin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 20:07:49 +0000
committerygorshenin@google.com <ygorshenin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 20:07:49 +0000
commit240502342713279f648c1b21a889e52d19b91ff1 (patch)
tree269195f6f14a2b431456195e138d3fb295a08d32 /chrome
parent2a14500556798d559fd63f41059c6072f199a21d (diff)
downloadchromium_src-240502342713279f648c1b21a889e52d19b91ff1.zip
chromium_src-240502342713279f648c1b21a889e52d19b91ff1.tar.gz
chromium_src-240502342713279f648c1b21a889e52d19b91ff1.tar.bz2
Added test for disallowed nacl sockets switch.
BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115289 Review URL: http://codereview.chromium.org/8933027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/ui/ppapi_uitest.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc
index e318098..2f5618ff 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -225,6 +225,25 @@ class PPAPINaClTest : public PPAPITestBase {
}
};
+class PPAPINaClTestDisallowedSockets : public PPAPITestBase {
+ public:
+ PPAPINaClTestDisallowedSockets() {
+ FilePath plugin_lib;
+ EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib));
+ EXPECT_TRUE(file_util::PathExists(plugin_lib));
+
+ // Enable running NaCl outside of the store.
+ launch_arguments_.AppendSwitch(switches::kEnableNaCl);
+ }
+
+ // Append the correct mode and testcase string
+ std::string BuildQuery(const std::string& base,
+ const std::string& test_case) {
+ return StringPrintf("%smode=nacl&testcase=%s", base.c_str(),
+ test_case.c_str());
+ }
+};
+
// This macro finesses macro expansion to do what we want.
#define STRIP_PREFIXES(test_name) StripPrefixes(#test_name)
@@ -262,6 +281,7 @@ class PPAPINaClTest : public PPAPITestBase {
#if defined(DISABLE_NACL)
#define TEST_PPAPI_NACL_VIA_HTTP(test_name)
+#define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name)
#else
// NaCl based PPAPI tests
@@ -269,6 +289,12 @@ class PPAPINaClTest : public PPAPITestBase {
TEST_F(PPAPINaClTest, test_name) { \
RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
}
+
+// NaCl based PPAPI tests with disallowed socket API
+#define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name) \
+ TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \
+ RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
+}
#endif
@@ -333,6 +359,9 @@ TEST_PPAPI_IN_PROCESS_VIA_HTTP(UDPSocketPrivateShared)
TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivateShared)
TEST_PPAPI_NACL_VIA_HTTP(UDPSocketPrivateShared)
+TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(TCPSocketPrivateDisallowed)
+TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(UDPSocketPrivateDisallowed)
+
// URLLoader tests.
TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader_BasicGET)
TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader_BasicPOST)