| 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 "examples/apptest/example_service.mojom.h" | 5 #include "examples/apptest/example_service.mojom.h" |
| 6 #include "mojo/public/cpp/application/application_impl.h" | 6 #include "mojo/public/cpp/application/application_impl.h" |
| 7 #include "mojo/public/cpp/application/application_test_base.h" | 7 #include "mojo/public/cpp/application/application_test_base.h" |
| 8 #include "mojo/public/cpp/bindings/callback.h" | 8 #include "mojo/public/cpp/bindings/callback.h" |
| 9 #include "mojo/public/cpp/environment/logging.h" | 9 #include "mojo/public/cpp/environment/logging.h" |
| 10 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 ExampleServicePtr example_service_; | 30 ExampleServicePtr example_service_; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 MOJO_DISALLOW_COPY_AND_ASSIGN(ExampleApplicationTest); | 33 MOJO_DISALLOW_COPY_AND_ASSIGN(ExampleApplicationTest); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 TEST_F(ExampleApplicationTest, PingServiceToPong) { | 36 TEST_F(ExampleApplicationTest, PingServiceToPong) { |
| 37 uint16_t pong_value = 0u; | 37 uint16_t pong_value = 0u; |
| 38 example_service_->Ping(1u, | 38 example_service_->Ping(1u, |
| 39 [&pong_value](uint16_t value) { pong_value = value; }); | 39 [&pong_value](uint16_t value) { pong_value = value; }); |
| 40 EXPECT_TRUE(example_service_.WaitForIncomingMethodCall()); | 40 EXPECT_TRUE(example_service_.WaitForIncomingResponse()); |
| 41 // Test making a call and receiving the reply. | 41 // Test making a call and receiving the reply. |
| 42 EXPECT_EQ(1u, pong_value); | 42 EXPECT_EQ(1u, pong_value); |
| 43 } | 43 } |
| 44 | 44 |
| 45 TEST_F(ExampleApplicationTest, CheckCommandLineArg) { | 45 TEST_F(ExampleApplicationTest, CheckCommandLineArg) { |
| 46 // Ensure the test runner passes along this example command line argument. | 46 // Ensure the test runner passes along this example command line argument. |
| 47 ASSERT_TRUE(application_impl()->HasArg("--example_apptest_arg")); | 47 ASSERT_TRUE(application_impl()->HasArg("--example_apptest_arg")); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 } // namespace mojo | 51 } // namespace mojo |
| OLD | NEW |