| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "gin/public/isolate_holder.h" | 10 #include "gin/public/isolate_holder.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 JsToCppTest() {} | 387 JsToCppTest() {} |
| 388 | 388 |
| 389 void RunTest(const std::string& test, CppSideConnection* cpp_side) { | 389 void RunTest(const std::string& test, CppSideConnection* cpp_side) { |
| 390 cpp_side->set_run_loop(&run_loop_); | 390 cpp_side->set_run_loop(&run_loop_); |
| 391 | 391 |
| 392 MessagePipe pipe; | 392 MessagePipe pipe; |
| 393 js_to_cpp::JsSidePtr js_side = | 393 js_to_cpp::JsSidePtr js_side = |
| 394 MakeProxy<js_to_cpp::JsSide>(pipe.handle0.Pass()); | 394 MakeProxy<js_to_cpp::JsSide>(pipe.handle0.Pass()); |
| 395 js_side.set_client(cpp_side); | 395 js_side.set_client(cpp_side); |
| 396 | 396 |
| 397 js_side.internal_state()->router()-> | 397 js_side.internal_state()->router()->EnableTestingMode(); |
| 398 set_enforce_errors_from_incoming_receiver(false); | |
| 399 | 398 |
| 400 cpp_side->set_js_side(js_side.get()); | 399 cpp_side->set_js_side(js_side.get()); |
| 401 | 400 |
| 402 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode); | 401 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode); |
| 403 apps::MojoRunnerDelegate delegate; | 402 apps::MojoRunnerDelegate delegate; |
| 404 gin::ShellRunner runner(&delegate, instance.isolate()); | 403 gin::ShellRunner runner(&delegate, instance.isolate()); |
| 405 delegate.Start(&runner, pipe.handle1.release().value(), test); | 404 delegate.Start(&runner, pipe.handle1.release().value(), test); |
| 406 | 405 |
| 407 run_loop_.Run(); | 406 run_loop_.Run(); |
| 408 } | 407 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 if (IsRunningOnIsolatedBot()) | 445 if (IsRunningOnIsolatedBot()) |
| 447 return; | 446 return; |
| 448 | 447 |
| 449 BackPointerCppSideConnection cpp_side_connection; | 448 BackPointerCppSideConnection cpp_side_connection; |
| 450 RunTest("mojo/apps/js/test/js_to_cpp_unittest", &cpp_side_connection); | 449 RunTest("mojo/apps/js/test/js_to_cpp_unittest", &cpp_side_connection); |
| 451 EXPECT_TRUE(cpp_side_connection.DidSucceed()); | 450 EXPECT_TRUE(cpp_side_connection.DidSucceed()); |
| 452 } | 451 } |
| 453 | 452 |
| 454 } // namespace js | 453 } // namespace js |
| 455 } // namespace mojo | 454 } // namespace mojo |
| OLD | NEW |