| 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 "mojo/public/cpp/application/connect.h" | 5 #include "mojo/public/cpp/application/connect.h" |
| 6 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" | 6 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" |
| 7 #include "services/js/test/echo_service.mojom-sync.h" | 7 #include "services/js/test/echo_service.mojom-sync.h" |
| 8 #include "services/js/test/js_application_test_base.h" | 8 #include "services/js/test/js_application_test_base.h" |
| 9 | 9 |
| 10 using mojo::String; | 10 using mojo::String; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 echo_service_->Quit(); | 66 echo_service_->Quit(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 TEST_F(JSEchoTest, EchoNullString) { | 69 TEST_F(JSEchoTest, EchoNullString) { |
| 70 String null; | 70 String null; |
| 71 EXPECT_TRUE(echo_service_->EchoString(nullptr, &null)); | 71 EXPECT_TRUE(echo_service_->EchoString(nullptr, &null)); |
| 72 EXPECT_TRUE(null.is_null()); | 72 EXPECT_TRUE(null.is_null()); |
| 73 echo_service_->Quit(); | 73 echo_service_->Quit(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Verify that a JS app's ServiceProvider can request and provide services. | |
| 77 // This test exercises the same code paths as examples/js/share_echo.js. | |
| 78 TEST_F(JSEchoTest, ShareEchoService) { | |
| 79 bool returned_value = false; | |
| 80 EXPECT_TRUE(echo_service_->ShareEchoService(&returned_value)); | |
| 81 EXPECT_TRUE(returned_value); | |
| 82 echo_service_->Quit(); | |
| 83 } | |
| 84 | |
| 85 } // namespace | 76 } // namespace |
| 86 } // namespace js | 77 } // namespace js |
| OLD | NEW |