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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 public: | 189 public: |
190 virtual ~ValidationTest() { | 190 virtual ~ValidationTest() { |
191 } | 191 } |
192 | 192 |
193 private: | 193 private: |
194 Environment env_; | 194 Environment env_; |
195 }; | 195 }; |
196 | 196 |
197 class ValidationIntegrationTest : public ValidationTest { | 197 class ValidationIntegrationTest : public ValidationTest { |
198 public: | 198 public: |
199 ValidationIntegrationTest() : test_message_receiver_(NULL) { | 199 ValidationIntegrationTest() : test_message_receiver_(nullptr) { |
200 } | 200 } |
201 | 201 |
202 virtual ~ValidationIntegrationTest() { | 202 virtual ~ValidationIntegrationTest() { |
203 } | 203 } |
204 | 204 |
205 virtual void SetUp() override { | 205 virtual void SetUp() override { |
206 ScopedMessagePipeHandle tester_endpoint; | 206 ScopedMessagePipeHandle tester_endpoint; |
207 ASSERT_EQ(MOJO_RESULT_OK, | 207 ASSERT_EQ(MOJO_RESULT_OK, |
208 CreateMessagePipe(NULL, &tester_endpoint, &testee_endpoint_)); | 208 CreateMessagePipe(nullptr, &tester_endpoint, &testee_endpoint_)); |
209 test_message_receiver_ = | 209 test_message_receiver_ = |
210 new TestMessageReceiver(this, tester_endpoint.Pass()); | 210 new TestMessageReceiver(this, tester_endpoint.Pass()); |
211 } | 211 } |
212 | 212 |
213 virtual void TearDown() override { | 213 virtual void TearDown() override { |
214 delete test_message_receiver_; | 214 delete test_message_receiver_; |
215 test_message_receiver_ = NULL; | 215 test_message_receiver_ = nullptr; |
216 | 216 |
217 // Make sure that the other end receives the OnConnectionError() | 217 // Make sure that the other end receives the OnConnectionError() |
218 // notification. | 218 // notification. |
219 PumpMessages(); | 219 PumpMessages(); |
220 } | 220 } |
221 | 221 |
222 MessageReceiver* test_message_receiver() { | 222 MessageReceiver* test_message_receiver() { |
223 return test_message_receiver_; | 223 return test_message_receiver_; |
224 } | 224 } |
225 | 225 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 "[u2]-1000", | 362 "[u2]-1000", |
363 "[u1]0x100", | 363 "[u1]0x100", |
364 "[s2]-0x8001", | 364 "[s2]-0x8001", |
365 "[b]1", | 365 "[b]1", |
366 "[b]1111111k", | 366 "[b]1111111k", |
367 "[dist4]unmatched", | 367 "[dist4]unmatched", |
368 "[anchr]hello [dist8]hello", | 368 "[anchr]hello [dist8]hello", |
369 "[dist4]a [dist4]a [anchr]a", | 369 "[dist4]a [dist4]a [anchr]a", |
370 "[dist4]a [anchr]a [dist4]a [anchr]a", | 370 "[dist4]a [anchr]a [dist4]a [anchr]a", |
371 "0 [handles]50", | 371 "0 [handles]50", |
372 NULL | 372 nullptr |
373 }; | 373 }; |
374 | 374 |
375 for (size_t i = 0; error_inputs[i]; ++i) { | 375 for (size_t i = 0; error_inputs[i]; ++i) { |
376 std::vector<uint8_t> expected; | 376 std::vector<uint8_t> expected; |
377 if (!TestInputParser(error_inputs[i], false, expected, 0)) | 377 if (!TestInputParser(error_inputs[i], false, expected, 0)) |
378 ADD_FAILURE() << "Unexpected test result for: " << error_inputs[i]; | 378 ADD_FAILURE() << "Unexpected test result for: " << error_inputs[i]; |
379 } | 379 } |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 IntegrationTestInterface1Impl* interface1_impl = | 425 IntegrationTestInterface1Impl* interface1_impl = |
426 BindToPipe(new IntegrationTestInterface1Impl(), testee_endpoint().Pass()); | 426 BindToPipe(new IntegrationTestInterface1Impl(), testee_endpoint().Pass()); |
427 interface1_impl->internal_state()->router()->EnableTestingMode(); | 427 interface1_impl->internal_state()->router()->EnableTestingMode(); |
428 | 428 |
429 RunValidationTests("integration_", test_message_receiver()); | 429 RunValidationTests("integration_", test_message_receiver()); |
430 } | 430 } |
431 | 431 |
432 } // namespace | 432 } // namespace |
433 } // namespace test | 433 } // namespace test |
434 } // namespace mojo | 434 } // namespace mojo |
OLD | NEW |