Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: mojo/services/network/udp_socket_apptest.cc

Issue 1121783003: Move navigations with POST or referrer to the shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "mojo/application/public/cpp/application_connection.h" 8 #include "mojo/application/public/cpp/application_connection.h"
9 #include "mojo/application/public/cpp/application_impl.h" 9 #include "mojo/application/public/cpp/application_impl.h"
10 #include "mojo/application/public/cpp/application_test_base.h" 10 #include "mojo/application/public/cpp/application_test_base.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 }; 315 };
316 316
317 class UDPSocketAppTest : public test::ApplicationTestBase { 317 class UDPSocketAppTest : public test::ApplicationTestBase {
318 public: 318 public:
319 UDPSocketAppTest() : receiver_binding_(&receiver_) {} 319 UDPSocketAppTest() : receiver_binding_(&receiver_) {}
320 ~UDPSocketAppTest() override {} 320 ~UDPSocketAppTest() override {}
321 321
322 void SetUp() override { 322 void SetUp() override {
323 ApplicationTestBase::SetUp(); 323 ApplicationTestBase::SetUp();
324 324
325 mojo::URLRequestPtr request(mojo::URLRequest::New());
326 request->url = mojo::String::From("mojo:network_service");
325 ApplicationConnection* connection = 327 ApplicationConnection* connection =
326 application_impl()->ConnectToApplication("mojo:network_service"); 328 application_impl()->ConnectToApplication(request.Pass());
327 connection->ConnectToService(&network_service_); 329 connection->ConnectToService(&network_service_);
328 330
329 network_service_->CreateUDPSocket(GetProxy(&socket_)); 331 network_service_->CreateUDPSocket(GetProxy(&socket_));
330 } 332 }
331 333
332 protected: 334 protected:
333 NetworkServicePtr network_service_; 335 NetworkServicePtr network_service_;
334 UDPSocketPtr socket_; 336 UDPSocketPtr socket_;
335 UDPSocketReceiverImpl receiver_; 337 UDPSocketReceiverImpl receiver_;
336 Binding<UDPSocketReceiver> receiver_binding_; 338 Binding<UDPSocketReceiver> receiver_binding_;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 receive_callbacks[j].result()->code); 645 receive_callbacks[j].result()->code);
644 EXPECT_FALSE(receive_callbacks[j].src_addr()); 646 EXPECT_FALSE(receive_callbacks[j].src_addr());
645 EXPECT_TRUE(receive_callbacks[j].data().Equals( 647 EXPECT_TRUE(receive_callbacks[j].data().Equals(
646 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize))); 648 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize)));
647 } 649 }
648 } 650 }
649 } 651 }
650 652
651 } // namespace service 653 } // namespace service
652 } // namespace mojo 654 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/network/network_context.cc ('k') | mojo/services/test_service/test_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698