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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 void set_run_loop(base::RunLoop* run_loop) { run_loop_ = run_loop; } | 204 void set_run_loop(base::RunLoop* run_loop) { run_loop_ = run_loop; } |
205 base::RunLoop* run_loop() { return run_loop_; } | 205 base::RunLoop* run_loop() { return run_loop_; } |
206 | 206 |
207 void set_js_side(js_to_cpp::JsSide* js_side) { js_side_ = js_side; } | 207 void set_js_side(js_to_cpp::JsSide* js_side) { js_side_ = js_side; } |
208 js_to_cpp::JsSide* js_side() { return js_side_; } | 208 js_to_cpp::JsSide* js_side() { return js_side_; } |
209 | 209 |
210 void Bind(InterfaceRequest<js_to_cpp::CppSide> request) { | 210 void Bind(InterfaceRequest<js_to_cpp::CppSide> request) { |
211 binding_.Bind(request.Pass()); | 211 binding_.Bind(request.Pass()); |
212 // Keep the pipe open even after validation errors. | 212 // Keep the pipe open even after validation errors. |
213 binding_.internal_router()->EnableTestingMode(); | 213 binding_.EnableTestingMode(); |
214 } | 214 } |
215 | 215 |
216 // js_to_cpp::CppSide: | 216 // js_to_cpp::CppSide: |
217 void StartTest() override { NOTREACHED(); } | 217 void StartTest() override { NOTREACHED(); } |
218 | 218 |
219 void TestFinished() override { NOTREACHED(); } | 219 void TestFinished() override { NOTREACHED(); } |
220 | 220 |
221 void PingResponse() override { mishandled_messages_ += 1; } | 221 void PingResponse() override { mishandled_messages_ += 1; } |
222 | 222 |
223 void EchoResponse(js_to_cpp::EchoArgsListPtr list) override { | 223 void EchoResponse(js_to_cpp::EchoArgsListPtr list) override { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 | 419 |
420 TEST_F(JsToCppTest, BackPointer) { | 420 TEST_F(JsToCppTest, BackPointer) { |
421 BackPointerCppSideConnection cpp_side_connection; | 421 BackPointerCppSideConnection cpp_side_connection; |
422 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); | 422 RunTest("mojo/edk/js/tests/js_to_cpp_tests", &cpp_side_connection); |
423 EXPECT_TRUE(cpp_side_connection.DidSucceed()); | 423 EXPECT_TRUE(cpp_side_connection.DidSucceed()); |
424 } | 424 } |
425 | 425 |
426 } // namespace edk | 426 } // namespace edk |
427 } // namespace mojo | 427 } // namespace mojo |
OLD | NEW |