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/bind.h" | 5 #include "base/bind.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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "crypto/random.h" | 10 #include "base/rand_util.h" |
11 #include "mojo/dart/embedder/dart_controller.h" | 11 #include "mojo/dart/embedder/dart_controller.h" |
12 #include "mojo/public/c/system/types.h" | 12 #include "mojo/public/c/system/types.h" |
13 #include "mojo/public/cpp/environment/environment.h" | 13 #include "mojo/public/cpp/environment/environment.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 // TODO(zra): Pull vm options from the test scripts. | 16 // TODO(zra): Pull vm options from the test scripts. |
17 | 17 |
18 namespace mojo { | 18 namespace mojo { |
19 namespace dart { | 19 namespace dart { |
20 namespace { | 20 namespace { |
21 | 21 |
22 static bool generateEntropy(uint8_t* buffer, intptr_t length) { | 22 static bool generateEntropy(uint8_t* buffer, intptr_t length) { |
23 crypto::RandBytes(reinterpret_cast<void*>(buffer), length); | 23 base::RandBytes(reinterpret_cast<void*>(buffer), length); |
24 return true; | 24 return true; |
25 } | 25 } |
26 | 26 |
27 static void exceptionCallback(bool* exception, Dart_Handle error) { | 27 static void exceptionCallback(bool* exception, Dart_Handle error) { |
28 *exception = true; | 28 *exception = true; |
29 } | 29 } |
30 | 30 |
31 static void RunTest(const std::string& test, | 31 static void RunTest(const std::string& test, |
32 bool compile_all, | 32 bool compile_all, |
33 const char** extra_args, | 33 const char** extra_args, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const int kNumArgs = 2; | 149 const int kNumArgs = 2; |
150 const char* args[kNumArgs]; | 150 const char* args[kNumArgs]; |
151 args[0] = "--new-gen-semi-max-size=1"; | 151 args[0] = "--new-gen-semi-max-size=1"; |
152 args[1] = "--old_gen_growth_rate=1"; | 152 args[1] = "--old_gen_growth_rate=1"; |
153 RunTest("handle_finalizer_test.dart", false, args, kNumArgs); | 153 RunTest("handle_finalizer_test.dart", false, args, kNumArgs); |
154 } | 154 } |
155 | 155 |
156 } // namespace | 156 } // namespace |
157 } // namespace dart | 157 } // namespace dart |
158 } // namespace mojo | 158 } // namespace mojo |
OLD | NEW |