summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_tcp_socket_private_disallowed.cc
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 /ppapi/tests/test_tcp_socket_private_disallowed.cc
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 'ppapi/tests/test_tcp_socket_private_disallowed.cc')
-rw-r--r--ppapi/tests/test_tcp_socket_private_disallowed.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/ppapi/tests/test_tcp_socket_private_disallowed.cc b/ppapi/tests/test_tcp_socket_private_disallowed.cc
new file mode 100644
index 0000000..1193292
--- /dev/null
+++ b/ppapi/tests/test_tcp_socket_private_disallowed.cc
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/tests/test_tcp_socket_private_disallowed.h"
+
+#include "ppapi/cpp/module.h"
+#include "ppapi/tests/testing_instance.h"
+
+REGISTER_TEST_CASE(TCPSocketPrivateDisallowed);
+
+TestTCPSocketPrivateDisallowed::TestTCPSocketPrivateDisallowed(
+ TestingInstance* instance)
+ : TestCase(instance), tcp_socket_private_interface_(NULL) {
+}
+
+bool TestTCPSocketPrivateDisallowed::Init() {
+ tcp_socket_private_interface_ = static_cast<const PPB_TCPSocket_Private*>(
+ pp::Module::Get()->GetBrowserInterface(PPB_TCPSOCKET_PRIVATE_INTERFACE));
+ if (!tcp_socket_private_interface_)
+ instance_->AppendError("TCPSocketPrivate interface not available");
+ return tcp_socket_private_interface_ && CheckTestingInterface();
+}
+
+void TestTCPSocketPrivateDisallowed::RunTests(const std::string& filter) {
+ RUN_TEST(Create, filter);
+}
+
+std::string TestTCPSocketPrivateDisallowed::TestCreate() {
+ PP_Resource socket =
+ tcp_socket_private_interface_->Create(instance_->pp_instance());
+ if (0 != socket) {
+ return "PPB_TCPSocket_Private::Create returns valid socket " \
+ "without allowing switch";
+ }
+ PASS();
+}