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 23 matching lines...) Expand all Loading... |
34 class JSServiceProviderEchoTest : public test::JSApplicationTestBase { | 34 class JSServiceProviderEchoTest : public test::JSApplicationTestBase { |
35 public: | 35 public: |
36 JSServiceProviderEchoTest() : JSApplicationTestBase() {} | 36 JSServiceProviderEchoTest() : JSApplicationTestBase() {} |
37 ~JSServiceProviderEchoTest() override {} | 37 ~JSServiceProviderEchoTest() override {} |
38 | 38 |
39 protected: | 39 protected: |
40 // ApplicationTestBase: | 40 // ApplicationTestBase: |
41 void SetUp() override { | 41 void SetUp() override { |
42 ApplicationTestBase::SetUp(); | 42 ApplicationTestBase::SetUp(); |
43 const std::string& url = JSAppURL("echo.js"); | 43 const std::string& url = JSAppURL("echo.js"); |
44 shell()->ConnectToApplication(url, GetProxy(&echo_service_provider_), | 44 shell()->ConnectToApplication(url, GetProxy(&echo_service_provider_)); |
45 nullptr); | |
46 } | 45 } |
47 | 46 |
48 mojo::ServiceProviderPtr echo_service_provider_; | 47 mojo::ServiceProviderPtr echo_service_provider_; |
49 | 48 |
50 private: | 49 private: |
51 MOJO_DISALLOW_COPY_AND_ASSIGN(JSServiceProviderEchoTest); | 50 MOJO_DISALLOW_COPY_AND_ASSIGN(JSServiceProviderEchoTest); |
52 }; | 51 }; |
53 | 52 |
54 TEST_F(JSEchoTest, EchoString) { | 53 TEST_F(JSEchoTest, EchoString) { |
55 String foo; | 54 String foo; |
(...skipping 11 matching lines...) Expand all Loading... |
67 | 66 |
68 TEST_F(JSEchoTest, EchoNullString) { | 67 TEST_F(JSEchoTest, EchoNullString) { |
69 String null; | 68 String null; |
70 EXPECT_TRUE(echo_service_->EchoString(nullptr, &null)); | 69 EXPECT_TRUE(echo_service_->EchoString(nullptr, &null)); |
71 EXPECT_TRUE(null.is_null()); | 70 EXPECT_TRUE(null.is_null()); |
72 echo_service_->Quit(); | 71 echo_service_->Quit(); |
73 } | 72 } |
74 | 73 |
75 } // namespace | 74 } // namespace |
76 } // namespace js | 75 } // namespace js |
OLD | NEW |