OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 DISALLOW_COPY_AND_ASSIGN(UDPSocketReceiverImpl); | 317 DISALLOW_COPY_AND_ASSIGN(UDPSocketReceiverImpl); |
318 }; | 318 }; |
319 | 319 |
320 class UDPSocketAppTest : public test::ApplicationTestBase { | 320 class UDPSocketAppTest : public test::ApplicationTestBase { |
321 public: | 321 public: |
322 UDPSocketAppTest() : receiver_binding_(&receiver_) {} | 322 UDPSocketAppTest() : receiver_binding_(&receiver_) {} |
323 ~UDPSocketAppTest() override {} | 323 ~UDPSocketAppTest() override {} |
324 | 324 |
325 void SetUp() override { | 325 void SetUp() override { |
326 ApplicationTestBase::SetUp(); | 326 ApplicationTestBase::SetUp(); |
327 shell()->ConnectToInterface("mojo:network_service", &network_service_); | 327 connector()->ConnectToInterface("mojo:network_service", &network_service_); |
328 network_service_->CreateUDPSocket(GetProxy(&socket_)); | 328 network_service_->CreateUDPSocket(GetProxy(&socket_)); |
329 } | 329 } |
330 | 330 |
331 protected: | 331 protected: |
332 NetworkServicePtr network_service_; | 332 NetworkServicePtr network_service_; |
333 UDPSocketPtr socket_; | 333 UDPSocketPtr socket_; |
334 UDPSocketReceiverImpl receiver_; | 334 UDPSocketReceiverImpl receiver_; |
335 Binding<UDPSocketReceiver> receiver_binding_; | 335 Binding<UDPSocketReceiver> receiver_binding_; |
336 | 336 |
337 DISALLOW_COPY_AND_ASSIGN(UDPSocketAppTest); | 337 DISALLOW_COPY_AND_ASSIGN(UDPSocketAppTest); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 receive_callbacks[j].result()->code); | 642 receive_callbacks[j].result()->code); |
643 EXPECT_FALSE(receive_callbacks[j].src_addr()); | 643 EXPECT_FALSE(receive_callbacks[j].src_addr()); |
644 EXPECT_TRUE(receive_callbacks[j].data().Equals( | 644 EXPECT_TRUE(receive_callbacks[j].data().Equals( |
645 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize))); | 645 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize))); |
646 } | 646 } |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 } // namespace service | 650 } // namespace service |
651 } // namespace mojo | 651 } // namespace mojo |
OLD | NEW |