| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 TestContext* context_; | 44 TestContext* context_; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class TestClientImpl : public TestClient { | 47 class TestClientImpl : public TestClient { |
| 48 public: | 48 public: |
| 49 explicit TestClientImpl(TestServicePtr service) | 49 explicit TestClientImpl(TestServicePtr service) |
| 50 : service_(service.Pass()), | 50 : service_(service.Pass()), |
| 51 quit_after_ack_(false) { | 51 quit_after_ack_(false) { |
| 52 service_->SetClient(this); | 52 service_.set_client(this); |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual ~TestClientImpl() {} | 55 virtual ~TestClientImpl() {} |
| 56 | 56 |
| 57 virtual void AckTest() OVERRIDE { | 57 virtual void AckTest() OVERRIDE { |
| 58 if (quit_after_ack_) | 58 if (quit_after_ack_) |
| 59 base::MessageLoop::current()->Quit(); | 59 base::MessageLoop::current()->Quit(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void Test(std::string test_string) { | 62 void Test(std::string test_string) { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 std::string url("test:test3"); | 271 std::string url("test:test3"); |
| 272 MessagePipe pipe1; | 272 MessagePipe pipe1; |
| 273 sm.Connect(GURL(url), pipe1.handle0.Pass()); | 273 sm.Connect(GURL(url), pipe1.handle0.Pass()); |
| 274 EXPECT_EQ(1, interceptor.call_count()); | 274 EXPECT_EQ(1, interceptor.call_count()); |
| 275 EXPECT_EQ(url, interceptor.url_spec()); | 275 EXPECT_EQ(url, interceptor.url_spec()); |
| 276 EXPECT_EQ(1, default_loader->num_loads()); | 276 EXPECT_EQ(1, default_loader->num_loads()); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace mojo | 279 } // namespace mojo |
| OLD | NEW |