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

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

Issue 281353005: Mojo: nuke EnvironmentData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gn Created 6 years, 6 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 | « mojo/android/javatests/mojo_test_case.cc ('k') | mojo/common/BUILD.gn » ('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/file_util.h" 6 #include "base/file_util.h"
6 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
7 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 9 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
10 #include "gin/public/isolate_holder.h" 11 #include "gin/public/isolate_holder.h"
11 #include "mojo/apps/js/mojo_runner_delegate.h" 12 #include "mojo/apps/js/mojo_runner_delegate.h"
12 #include "mojo/apps/js/test/js_to_cpp.mojom.h" 13 #include "mojo/apps/js/test/js_to_cpp.mojom.h"
13 #include "mojo/common/common_type_converters.h" 14 #include "mojo/common/common_type_converters.h"
14 #include "mojo/common/test/test_utils.h" 15 #include "mojo/common/test/test_utils.h"
15 #include "mojo/public/cpp/environment/environment.h"
16 #include "mojo/public/cpp/system/core.h" 16 #include "mojo/public/cpp/system/core.h"
17 #include "mojo/public/cpp/system/macros.h" 17 #include "mojo/public/cpp/system/macros.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace mojo { 20 namespace mojo {
21 namespace js { 21 namespace js {
22 22
23 // Global value updated by some checks to prevent compilers from optimizing 23 // Global value updated by some checks to prevent compilers from optimizing
24 // reads out of existence. 24 // reads out of existence.
25 uint32 g_waste_accumulator = 0; 25 uint32 g_waste_accumulator = 0;
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode); 402 gin::IsolateHolder instance(gin::IsolateHolder::kStrictMode);
403 apps::MojoRunnerDelegate delegate; 403 apps::MojoRunnerDelegate delegate;
404 gin::ShellRunner runner(&delegate, instance.isolate()); 404 gin::ShellRunner runner(&delegate, instance.isolate());
405 delegate.Start(&runner, pipe.handle1.release().value(), test); 405 delegate.Start(&runner, pipe.handle1.release().value(), test);
406 406
407 run_loop_.Run(); 407 run_loop_.Run();
408 } 408 }
409 409
410 private: 410 private:
411 Environment environment; 411 base::ShadowingAtExitManager at_exit_;
412 base::MessageLoop loop; 412 base::MessageLoop loop;
413 base::RunLoop run_loop_; 413 base::RunLoop run_loop_;
414 414
415 DISALLOW_COPY_AND_ASSIGN(JsToCppTest); 415 DISALLOW_COPY_AND_ASSIGN(JsToCppTest);
416 }; 416 };
417 417
418 TEST_F(JsToCppTest, Ping) { 418 TEST_F(JsToCppTest, Ping) {
419 if (IsRunningOnIsolatedBot()) 419 if (IsRunningOnIsolatedBot())
420 return; 420 return;
421 421
(...skipping 24 matching lines...) Expand all
446 if (IsRunningOnIsolatedBot()) 446 if (IsRunningOnIsolatedBot())
447 return; 447 return;
448 448
449 BackPointerCppSideConnection cpp_side_connection; 449 BackPointerCppSideConnection cpp_side_connection;
450 RunTest("mojo/apps/js/test/js_to_cpp_unittest", &cpp_side_connection); 450 RunTest("mojo/apps/js/test/js_to_cpp_unittest", &cpp_side_connection);
451 EXPECT_TRUE(cpp_side_connection.DidSucceed()); 451 EXPECT_TRUE(cpp_side_connection.DidSucceed());
452 } 452 }
453 453
454 } // namespace js 454 } // namespace js
455 } // namespace mojo 455 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/android/javatests/mojo_test_case.cc ('k') | mojo/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698