Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: mojo/edk/js/tests/js_to_cpp_tests.cc

Issue 1473273003: Mojo C++ bindings: InterfacePtr<T> and Binding<T> use MultiplexRouter when T passes associated inte… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/application/public/cpp/lib/application_test_main.cc ('k') | mojo/logging/init_logging.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/application/public/cpp/lib/application_test_main.cc ('k') | mojo/logging/init_logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698