Remove extra line from unit_tests.isolate
[chromium-blink-merge.git] / ppapi / tests / test_udp_socket_private_disallowed.cc
blobfa0c179111f5af1367e56e7087859bd1ff3d9d94
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/tests/test_udp_socket_private_disallowed.h"
7 #include "ppapi/cpp/module.h"
8 #include "ppapi/cpp/private/net_address_private.h"
9 #include "ppapi/tests/testing_instance.h"
10 #include "ppapi/tests/test_utils.h"
12 REGISTER_TEST_CASE(UDPSocketPrivateDisallowed);
14 TestUDPSocketPrivateDisallowed::TestUDPSocketPrivateDisallowed(
15 TestingInstance* instance)
16 : TestCase(instance), udp_socket_private_interface_(NULL) {
19 bool TestUDPSocketPrivateDisallowed::Init() {
20 udp_socket_private_interface_ = static_cast<const PPB_UDPSocket_Private*>(
21 pp::Module::Get()->GetBrowserInterface(PPB_UDPSOCKET_PRIVATE_INTERFACE));
22 if (!udp_socket_private_interface_)
23 instance_->AppendError("UDPSocketPrivate interface not available");
24 return udp_socket_private_interface_ && CheckTestingInterface();
27 void TestUDPSocketPrivateDisallowed::RunTests(const std::string& filter) {
28 RUN_TEST(Bind, filter);
31 std::string TestUDPSocketPrivateDisallowed::TestBind() {
32 PP_Resource socket =
33 udp_socket_private_interface_->Create(instance_->pp_instance());
34 if (0 != socket) {
35 PP_NetAddress_Private addr;
36 pp::NetAddressPrivate::GetAnyAddress(false, &addr);
38 TestCompletionCallback callback(instance_->pp_instance());
39 int32_t rv = udp_socket_private_interface_->Bind(socket, &addr,
40 static_cast<pp::CompletionCallback>(callback).pp_completion_callback());
42 if (PP_OK_COMPLETIONPENDING == rv)
43 rv = callback.WaitForResult();
45 if (PP_ERROR_FAILED != rv)
46 return "PPB_UDPSocket_Private can bind without allowing switch";
48 PASS();