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

Side by Side Diff: mojo/package_manager/content_handler_unittest.cc

Issue 1431573002: Fix hangs in Mandoline page cycler on Linux with --enable-multiprocess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 1 month 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/path_service.h" 10 #include "base/path_service.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 base::MessageLoop::current()->QuitWhenIdle(); 68 base::MessageLoop::current()->QuitWhenIdle();
69 } 69 }
70 70
71 class TestContentHandler : public ContentHandler, public ApplicationDelegate { 71 class TestContentHandler : public ContentHandler, public ApplicationDelegate {
72 public: 72 public:
73 TestContentHandler(ApplicationConnection* connection, 73 TestContentHandler(ApplicationConnection* connection,
74 InterfaceRequest<ContentHandler> request) 74 InterfaceRequest<ContentHandler> request)
75 : binding_(this, request.Pass()) {} 75 : binding_(this, request.Pass()) {}
76 76
77 // ContentHandler: 77 // ContentHandler:
78 void StartApplication(InterfaceRequest<Application> application_request, 78 void StartApplication(
79 URLResponsePtr response) override { 79 InterfaceRequest<Application> application_request,
80 URLResponsePtr response,
81 const Callback<void()>& destruct_callback) override {
80 apps_.push_back(new ApplicationImpl(this, application_request.Pass())); 82 apps_.push_back(new ApplicationImpl(this, application_request.Pass()));
83 destruct_callback.Run();
81 } 84 }
82 85
83 private: 86 private:
84 StrongBinding<ContentHandler> binding_; 87 StrongBinding<ContentHandler> binding_;
85 ScopedVector<ApplicationImpl> apps_; 88 ScopedVector<ApplicationImpl> apps_;
86 89
87 DISALLOW_COPY_AND_ASSIGN(TestContentHandler); 90 DISALLOW_COPY_AND_ASSIGN(TestContentHandler);
88 }; 91 };
89 92
90 class TestApplicationLoader : public shell::ApplicationLoader, 93 class TestApplicationLoader : public shell::ApplicationLoader,
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 params->SetTargetURL(GURL("test:test")); 312 params->SetTargetURL(GURL("test:test"));
310 params->set_connect_callback( 313 params->set_connect_callback(
311 [&content_handler_id](uint32_t t) { content_handler_id = t; }); 314 [&content_handler_id](uint32_t t) { content_handler_id = t; });
312 application_manager_->ConnectToApplication(params.Pass()); 315 application_manager_->ConnectToApplication(params.Pass());
313 EXPECT_EQ(0u, content_handler_id); 316 EXPECT_EQ(0u, content_handler_id);
314 } 317 }
315 318
316 } // namespace test 319 } // namespace test
317 } // namespace package_manager 320 } // namespace package_manager
318 } // namespace mojo 321 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/package_manager/content_handler_connection.cc ('k') | mojo/package_manager/package_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698