OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "mojo/dart/embedder/dart_controller.h" | 8 #include "mojo/dart/embedder/dart_controller.h" |
9 #include "mojo/dart/unittests/embedder_tester/dart_test.h" | 9 #include "mojo/dart/unittests/embedder_tester/dart_test.h" |
10 #include "mojo/public/c/system/types.h" | 10 #include "mojo/public/c/system/types.h" |
11 #include "mojo/public/cpp/environment/environment.h" | 11 #include "mojo/public/cpp/environment/environment.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 namespace dart { | 15 namespace dart { |
16 namespace { | 16 namespace { |
17 | 17 |
18 class DartFinalizerTest : public DartTest { | 18 class DartFinalizerTest : public DartTest { |
19 public: | 19 public: |
20 DartFinalizerTest() {} | 20 DartFinalizerTest() {} |
21 | 21 |
22 static void SetUpTestCase() { | 22 static void SetUpTestCase() { |
23 const int kNumArgs = 2; | 23 const int kNumArgs = 2; |
24 const char* args[kNumArgs]; | 24 const char* args[kNumArgs]; |
25 args[0] = "--new-gen-semi-max-size=1"; | 25 args[0] = "--new-gen-semi-max-size=1"; |
26 args[1] = "--old_gen_growth_rate=1"; | 26 args[1] = "--old_gen_growth_rate=1"; |
27 DartController::Initialize(nullptr, true, false, args, kNumArgs); | 27 DartController::Initialize(nullptr, true, false, false, args, kNumArgs); |
28 } | 28 } |
29 | 29 |
30 void RunTest(const std::string& test) { | 30 void RunTest(const std::string& test) { |
31 base::FilePath path; | 31 base::FilePath path; |
32 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 32 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
33 path = path.AppendASCII("mojo") | 33 path = path.AppendASCII("mojo") |
34 .AppendASCII("dart") | 34 .AppendASCII("dart") |
35 .AppendASCII("unittests") | 35 .AppendASCII("unittests") |
36 .AppendASCII("embedder_tests") | 36 .AppendASCII("embedder_tests") |
37 .AppendASCII(test); | 37 .AppendASCII(test); |
38 std::vector<std::string> script_arguments; | 38 std::vector<std::string> script_arguments; |
39 | 39 |
40 RunDartTest(path, script_arguments, false, false, 0); | 40 RunDartTest(path, script_arguments, false, false, 0); |
41 } | 41 } |
42 }; | 42 }; |
43 | 43 |
44 TEST_F(DartFinalizerTest, handle_finalizer_test) { | 44 TEST_F(DartFinalizerTest, handle_finalizer_test) { |
45 RunTest("handle_finalizer_test.dart"); | 45 RunTest("handle_finalizer_test.dart"); |
46 } | 46 } |
47 | 47 |
48 TEST_F(DartFinalizerTest, shared_buffer_finalizer_test) { | 48 TEST_F(DartFinalizerTest, shared_buffer_finalizer_test) { |
49 RunTest("shared_buffer_finalizer_test.dart"); | 49 RunTest("shared_buffer_finalizer_test.dart"); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 } // namespace dart | 53 } // namespace dart |
54 } // namespace mojo | 54 } // namespace mojo |
OLD | NEW |