summaryrefslogtreecommitdiffstats
path: root/chrome/test/ppapi
diff options
context:
space:
mode:
authoreduardo.lima <eduardo.lima@intel.com>2015-03-13 08:40:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-13 15:41:01 +0000
commit8171d46410b1ea937b0ae59577b9b36ed151149a (patch)
tree24bb98ab89f255ac337f9d584de264f931570bf3 /chrome/test/ppapi
parentfe37dca5b311cf194493669f26ddee27d60cc667 (diff)
downloadchromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.zip
chromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.tar.gz
chromium_src-8171d46410b1ea937b0ae59577b9b36ed151149a.tar.bz2
Add support for multicast in PPB_UDPSocket API
This change introduces two new values to be used with SetOption(), to set up the behavior of the multicast packets: - PP_UDPSOCKET_OPTION_MULTICAST_LOOP (Boolean) Whether packets sent from the host to the multicast group will be looped back to the host or not. - PP_UDPSOCKET_OPTION_MULTICAST_TTL (Integer) Sets time-to-live of multicast packets sent to the multicast group. It also introduces two new functions JoinGroup() and LeaveGroup(), both of them expecting the address of the multicast group as specified by the PPB_NetAddress API. These two functions should only be called after the socket is bound. This CL adds specific test cases to browser_tests in order to exercise the different versions of the SetOption function. For this reason, the PPAPI UDPSocket tests were split into multiple tests, instead of a single one that enclosed all of them. This way we get clearer information about the results of each test. BUG=430939 TEST=browser_tests NOPRESUBMIT=true Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com> Review URL: https://codereview.chromium.org/704133005 Cr-Commit-Position: refs/heads/master@{#320504}
Diffstat (limited to 'chrome/test/ppapi')
-rw-r--r--chrome/test/ppapi/ppapi_browsertest.cc55
1 files changed, 31 insertions, 24 deletions
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc
index b3fbc3f..aec526d 100644
--- a/chrome/test/ppapi/ppapi_browsertest.cc
+++ b/chrome/test/ppapi/ppapi_browsertest.cc
@@ -319,31 +319,38 @@ TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivateTrusted)
#define MAYBE_UDPSocket_Broadcast UDPSocket_Broadcast
#endif
-#define RUN_UDPSOCKET_SUBTESTS \
- RunTestViaHTTP( \
- LIST_TEST(UDPSocket_ReadWrite) \
- LIST_TEST(UDPSocket_SetOption) \
- LIST_TEST(MAYBE_UDPSocket_Broadcast) \
- LIST_TEST(UDPSocket_ParallelSend))
-
-IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, UDPSocket) {
- RUN_UDPSOCKET_SUBTESTS;
-}
-IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, UDPSocket) {
- RUN_UDPSOCKET_SUBTESTS;
-}
-IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, UDPSocket) {
- RUN_UDPSOCKET_SUBTESTS;
-}
-IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
- MAYBE_PNACL_NONSFI(UDPSocket)) {
- RUN_UDPSOCKET_SUBTESTS;
-}
-IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTransitionalNonSfiTest,
- MAYBE_PNACL_TRANSITIONAL_NONSFI(UDPSocket)) {
- RUN_UDPSOCKET_SUBTESTS;
-}
+#define UDPSOCKET_TEST(_test) \
+ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, _test) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ } \
+ IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, _test) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ } \
+ IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(_test)) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ } \
+ IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, _test) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ } \
+ IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
+ MAYBE_PNACL_NONSFI(_test)) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ } \
+ IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTransitionalNonSfiTest, \
+ MAYBE_PNACL_TRANSITIONAL_NONSFI(_test)) { \
+ RunTestViaHTTP(LIST_TEST(_test)); \
+ }
+// Instead of one single test for all UDPSocket features (like it is done for
+// TCPSocket), split them into multiple, making it easier to isolate which tests
+// are failing.
+UDPSOCKET_TEST(UDPSocket_ReadWrite)
+UDPSOCKET_TEST(UDPSocket_SetOption)
+UDPSOCKET_TEST(UDPSocket_SetOption_1_0)
+UDPSOCKET_TEST(UDPSocket_SetOption_1_1)
+UDPSOCKET_TEST(MAYBE_UDPSocket_Broadcast)
+UDPSOCKET_TEST(UDPSocket_ParallelSend)
+UDPSOCKET_TEST(UDPSocket_Multicast)
// UDPSocketPrivate tests.
// UDPSocketPrivate_Broadcast is disabled for OSX because it requires root