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

Side by Side Diff: mojo/application_manager/application_manager_unittest.cc

Issue 718473003: Add mojo::Binding<Interface> for more flexible pipe<->impl binding (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 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/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/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/application_manager/application_loader.h" 9 #include "mojo/application_manager/application_loader.h"
10 #include "mojo/application_manager/application_manager.h" 10 #include "mojo/application_manager/application_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 explicit TestServiceImpl(TestContext* context) : context_(context) { 50 explicit TestServiceImpl(TestContext* context) : context_(context) {
51 ++context_->num_impls; 51 ++context_->num_impls;
52 } 52 }
53 53
54 ~TestServiceImpl() override { --context_->num_impls; } 54 ~TestServiceImpl() override { --context_->num_impls; }
55 55
56 void OnConnectionError() override { 56 void OnConnectionError() override {
57 if (!base::MessageLoop::current()->is_running()) 57 if (!base::MessageLoop::current()->is_running())
58 return; 58 return;
59 base::MessageLoop::current()->Quit(); 59 base::MessageLoop::current()->Quit();
60 InterfaceImpl::OnConnectionError();
60 } 61 }
61 62
62 // TestService implementation: 63 // TestService implementation:
63 void Test(const String& test_string) override { 64 void Test(const String& test_string) override {
64 context_->last_test_string = test_string; 65 context_->last_test_string = test_string;
65 client()->AckTest(); 66 client()->AckTest();
66 } 67 }
67 68
68 private: 69 private:
69 TestContext* context_; 70 TestContext* context_;
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 TestServicePtr test_service2; 713 TestServicePtr test_service2;
713 application_manager_->ConnectToService(GURL("foo:foo2"), &test_service2); 714 application_manager_->ConnectToService(GURL("foo:foo2"), &test_service2);
714 EXPECT_EQ(2, test_loader_->num_loads()); 715 EXPECT_EQ(2, test_loader_->num_loads());
715 716
716 TestServicePtr test_service3; 717 TestServicePtr test_service3;
717 application_manager_->ConnectToService(GURL("bar:bar"), &test_service2); 718 application_manager_->ConnectToService(GURL("bar:bar"), &test_service2);
718 EXPECT_EQ(3, test_loader_->num_loads()); 719 EXPECT_EQ(3, test_loader_->num_loads());
719 } 720 }
720 721
721 } // namespace mojo 722 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698