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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "mojo/public/cpp/bindings/allocation_scope.h" | 6 #include "mojo/public/cpp/bindings/allocation_scope.h" |
7 #include "mojo/public/cpp/environment/environment.h" | 7 #include "mojo/public/cpp/environment/environment.h" |
8 #include "mojo/public/cpp/shell/application.h" | 8 #include "mojo/public/cpp/shell/application.h" |
9 #include "mojo/public/interfaces/shell/shell.mojom.h" | 9 #include "mojo/public/interfaces/shell/shell.mojom.h" |
10 #include "mojo/service_manager/service_loader.h" | 10 #include "mojo/service_manager/service_loader.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class TestServiceImpl : public InterfaceImpl<TestService> { | 27 class TestServiceImpl : public InterfaceImpl<TestService> { |
28 public: | 28 public: |
29 explicit TestServiceImpl(TestContext* context) : context_(context) { | 29 explicit TestServiceImpl(TestContext* context) : context_(context) { |
30 ++context_->num_impls; | 30 ++context_->num_impls; |
31 } | 31 } |
32 | 32 |
33 virtual ~TestServiceImpl() { | 33 virtual ~TestServiceImpl() { |
34 --context_->num_impls; | 34 --context_->num_impls; |
35 } | 35 } |
36 | 36 |
37 // InterfaceImpl<TestService> implementation. | |
38 virtual void OnConnectionError() OVERRIDE { | |
39 } | |
40 | |
41 // TestService implementation: | 37 // TestService implementation: |
42 virtual void Test(const mojo::String& test_string) OVERRIDE { | 38 virtual void Test(const mojo::String& test_string) OVERRIDE { |
43 context_->last_test_string = test_string.To<std::string>(); | 39 context_->last_test_string = test_string.To<std::string>(); |
44 client()->AckTest(); | 40 client()->AckTest(); |
45 } | 41 } |
46 | 42 |
47 private: | 43 private: |
48 TestContext* context_; | 44 TestContext* context_; |
49 }; | 45 }; |
50 | 46 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 270 |
275 std::string url("test:test3"); | 271 std::string url("test:test3"); |
276 MessagePipe pipe1; | 272 MessagePipe pipe1; |
277 sm.Connect(GURL(url), pipe1.handle0.Pass()); | 273 sm.Connect(GURL(url), pipe1.handle0.Pass()); |
278 EXPECT_EQ(1, interceptor.call_count()); | 274 EXPECT_EQ(1, interceptor.call_count()); |
279 EXPECT_EQ(url, interceptor.url_spec()); | 275 EXPECT_EQ(url, interceptor.url_spec()); |
280 EXPECT_EQ(1, default_loader->num_loads()); | 276 EXPECT_EQ(1, default_loader->num_loads()); |
281 } | 277 } |
282 | 278 |
283 } // namespace mojo | 279 } // namespace mojo |
OLD | NEW |