OLD | NEW |
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 "mojo/public/cpp/application/application_impl.h" | |
6 #include "mojo/public/cpp/application/application_test_base.h" | 5 #include "mojo/public/cpp/application/application_test_base.h" |
7 #include "mojo/public/cpp/application/connect.h" | 6 #include "mojo/public/cpp/application/connect.h" |
8 #include "mojo/public/cpp/system/macros.h" | 7 #include "mojo/public/cpp/system/macros.h" |
9 #include "mojo/public/interfaces/bindings/tests/versioning_test_client.mojom.h" | 8 #include "mojo/public/interfaces/bindings/tests/versioning_test_client.mojom.h" |
10 | 9 |
11 namespace mojo { | 10 namespace mojo { |
12 namespace test { | 11 namespace test { |
13 namespace versioning { | 12 namespace versioning { |
14 | 13 |
15 class VersioningApplicationTest : public ApplicationTestBase { | 14 class VersioningApplicationTest : public ApplicationTestBase { |
16 public: | 15 public: |
17 VersioningApplicationTest() : ApplicationTestBase() {} | 16 VersioningApplicationTest() : ApplicationTestBase() {} |
18 ~VersioningApplicationTest() override {} | 17 ~VersioningApplicationTest() override {} |
19 | 18 |
20 protected: | 19 protected: |
21 // ApplicationTestBase overrides. | 20 // ApplicationTestBase overrides. |
22 void SetUp() override { | 21 void SetUp() override { |
23 ApplicationTestBase::SetUp(); | 22 ApplicationTestBase::SetUp(); |
24 | 23 |
25 ConnectToService(application_impl()->shell(), | 24 ConnectToService(shell(), "mojo:versioning_test_service", |
26 "mojo:versioning_test_service", GetProxy(&database_)); | 25 GetProxy(&database_)); |
27 } | 26 } |
28 | 27 |
29 HumanResourceDatabasePtr database_; | 28 HumanResourceDatabasePtr database_; |
30 | 29 |
31 private: | 30 private: |
32 MOJO_DISALLOW_COPY_AND_ASSIGN(VersioningApplicationTest); | 31 MOJO_DISALLOW_COPY_AND_ASSIGN(VersioningApplicationTest); |
33 }; | 32 }; |
34 | 33 |
35 TEST_F(VersioningApplicationTest, Struct) { | 34 TEST_F(VersioningApplicationTest, Struct) { |
36 // The service side uses a newer version of Employee defintion. | 35 // The service side uses a newer version of Employee defintion. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Calling a version 2 method (which the service side doesn't support) closes | 112 // Calling a version 2 method (which the service side doesn't support) closes |
114 // the pipe. | 113 // the pipe. |
115 database_->ListEmployeeIds([](Array<uint64_t> ids) { EXPECT_TRUE(false); }); | 114 database_->ListEmployeeIds([](Array<uint64_t> ids) { EXPECT_TRUE(false); }); |
116 database_.WaitForIncomingResponse(); | 115 database_.WaitForIncomingResponse(); |
117 EXPECT_TRUE(database_.encountered_error()); | 116 EXPECT_TRUE(database_.encountered_error()); |
118 } | 117 } |
119 | 118 |
120 } // namespace versioning | 119 } // namespace versioning |
121 } // namespace examples | 120 } // namespace examples |
122 } // namespace mojo | 121 } // namespace mojo |
OLD | NEW |