| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 class DummyMessageReceiver : public MessageReceiver { | 181 class DummyMessageReceiver : public MessageReceiver { |
| 182 public: | 182 public: |
| 183 bool Accept(Message* message) override { | 183 bool Accept(Message* message) override { |
| 184 return true; // Any message is OK. | 184 return true; // Any message is OK. |
| 185 } | 185 } |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 class ValidationTest : public testing::Test { | 188 class ValidationTest : public testing::Test { |
| 189 public: | 189 public: |
| 190 virtual ~ValidationTest() {} | 190 ~ValidationTest() override {} |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 Environment env_; | 193 Environment env_; |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 class ValidationIntegrationTest : public ValidationTest { | 196 class ValidationIntegrationTest : public ValidationTest { |
| 197 public: | 197 public: |
| 198 ValidationIntegrationTest() : test_message_receiver_(nullptr) {} | 198 ValidationIntegrationTest() : test_message_receiver_(nullptr) {} |
| 199 | 199 |
| 200 virtual ~ValidationIntegrationTest() {} | 200 ~ValidationIntegrationTest() override {} |
| 201 | 201 |
| 202 virtual void SetUp() override { | 202 void SetUp() override { |
| 203 ScopedMessagePipeHandle tester_endpoint; | 203 ScopedMessagePipeHandle tester_endpoint; |
| 204 ASSERT_EQ(MOJO_RESULT_OK, | 204 ASSERT_EQ(MOJO_RESULT_OK, |
| 205 CreateMessagePipe(nullptr, &tester_endpoint, &testee_endpoint_)); | 205 CreateMessagePipe(nullptr, &tester_endpoint, &testee_endpoint_)); |
| 206 test_message_receiver_ = | 206 test_message_receiver_ = |
| 207 new TestMessageReceiver(this, tester_endpoint.Pass()); | 207 new TestMessageReceiver(this, tester_endpoint.Pass()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 virtual void TearDown() override { | 210 void TearDown() override { |
| 211 delete test_message_receiver_; | 211 delete test_message_receiver_; |
| 212 test_message_receiver_ = nullptr; | 212 test_message_receiver_ = nullptr; |
| 213 | 213 |
| 214 // Make sure that the other end receives the OnConnectionError() | 214 // Make sure that the other end receives the OnConnectionError() |
| 215 // notification. | 215 // notification. |
| 216 PumpMessages(); | 216 PumpMessages(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 MessageReceiver* test_message_receiver() { return test_message_receiver_; } | 219 MessageReceiver* test_message_receiver() { return test_message_receiver_; } |
| 220 | 220 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 IntegrationTestInterface1Impl* interface1_impl = | 410 IntegrationTestInterface1Impl* interface1_impl = |
| 411 BindToPipe(new IntegrationTestInterface1Impl(), testee_endpoint().Pass()); | 411 BindToPipe(new IntegrationTestInterface1Impl(), testee_endpoint().Pass()); |
| 412 interface1_impl->internal_state()->router()->EnableTestingMode(); | 412 interface1_impl->internal_state()->router()->EnableTestingMode(); |
| 413 | 413 |
| 414 RunValidationTests("integration_", test_message_receiver()); | 414 RunValidationTests("integration_", test_message_receiver()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 } // namespace | 417 } // namespace |
| 418 } // namespace test | 418 } // namespace test |
| 419 } // namespace mojo | 419 } // namespace mojo |
| OLD | NEW |