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

Side by Side Diff: mojo/apps/js/test/js_to_cpp_unittest.cc

Issue 400043004: InterfacePtr: not configure proxy until actual read/write is needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/interface_ptr.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/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->EnableTestingMode(); 397 js_side.internal_state()->router_for_testing()->EnableTestingMode();
398 398
399 cpp_side->set_js_side(js_side.get()); 399 cpp_side->set_js_side(js_side.get());
400 400
401 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode); 401 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode);
402 apps::MojoRunnerDelegate delegate; 402 apps::MojoRunnerDelegate delegate;
403 gin::ShellRunner runner(&delegate, instance.isolate()); 403 gin::ShellRunner runner(&delegate, instance.isolate());
404 delegate.Start(&runner, pipe.handle1.release().value(), test); 404 delegate.Start(&runner, pipe.handle1.release().value(), test);
405 405
406 run_loop_.Run(); 406 run_loop_.Run();
407 } 407 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (IsRunningOnIsolatedBot()) 445 if (IsRunningOnIsolatedBot())
446 return; 446 return;
447 447
448 BackPointerCppSideConnection cpp_side_connection; 448 BackPointerCppSideConnection cpp_side_connection;
449 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);
450 EXPECT_TRUE(cpp_side_connection.DidSucceed()); 450 EXPECT_TRUE(cpp_side_connection.DidSucceed());
451 } 451 }
452 452
453 } // namespace js 453 } // namespace js
454 } // namespace mojo 454 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698