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

Side by Side Diff: mojo/shell/capability_filter_unittest.cc

Issue 1254383016: ApplicationConnection lifetime management changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Overridden from ApplicationDelegate: 122 // Overridden from ApplicationDelegate:
123 void Initialize(ApplicationImpl* app) override { 123 void Initialize(ApplicationImpl* app) override {
124 app_ = app; 124 app_ = app;
125 } 125 }
126 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { 126 bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
127 // TestApplications receive their Validator via the inbound connection. 127 // TestApplications receive their Validator via the inbound connection.
128 connection->ConnectToService(&validator_); 128 connection->ConnectToService(&validator_);
129 129
130 URLRequestPtr request(URLRequest::New()); 130 URLRequestPtr request(URLRequest::New());
131 request->url = String::From("test:service"); 131 request->url = String::From("test:service");
132 ApplicationConnection* connection1 = 132 scoped_ptr<ApplicationConnection> connection1 =
133 app_->ConnectToApplication(request.Pass()); 133 app_->ConnectToApplication(request.Pass());
134 connection1->SetRemoteServiceProviderConnectionErrorHandler( 134 connection1->SetRemoteServiceProviderConnectionErrorHandler(
135 base::Bind(&TestApplication::ConnectionClosed, 135 base::Bind(&TestApplication::ConnectionClosed,
136 base::Unretained(this), "test:service")); 136 base::Unretained(this), "test:service"));
137 137
138 URLRequestPtr request2(URLRequest::New()); 138 URLRequestPtr request2(URLRequest::New());
139 request2->url = String::From("test:service2"); 139 request2->url = String::From("test:service2");
140 ApplicationConnection* connection2 = 140 scoped_ptr<ApplicationConnection> connection2 =
141 app_->ConnectToApplication(request2.Pass()); 141 app_->ConnectToApplication(request2.Pass());
142 connection2->SetRemoteServiceProviderConnectionErrorHandler( 142 connection2->SetRemoteServiceProviderConnectionErrorHandler(
143 base::Bind(&TestApplication::ConnectionClosed, 143 base::Bind(&TestApplication::ConnectionClosed,
144 base::Unretained(this), "test:service2")); 144 base::Unretained(this), "test:service2"));
145 return true; 145 return true;
146 } 146 }
147 147
148 void ConnectionClosed(const std::string& service_url) { 148 void ConnectionClosed(const std::string& service_url) {
149 validator_->ConnectionClosed(app_->url(), service_url); 149 validator_->ConnectionClosed(app_->url(), service_url);
150 } 150 }
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 RunTest(); 542 RunTest();
543 } 543 }
544 544
545 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) { 545 TEST_F(CapabilityFilter_WildcardsTest, ContentHandler) {
546 RunContentHandlerTest(); 546 RunContentHandlerTest();
547 } 547 }
548 548
549 } // namespace 549 } // namespace
550 } // namespace shell 550 } // namespace shell
551 } // namespace mojo 551 } // namespace mojo
OLDNEW
« mojo/common/tracing_impl.cc ('K') | « mojo/shell/application_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698