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 #ifndef MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ | 5 #ifndef MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ |
6 #define MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ | 6 #define MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "mojo/dart/embedder/dart_controller.h" | 12 #include "mojo/dart/embedder/dart_controller.h" |
13 #include "mojo/public/c/system/types.h" | 13 #include "mojo/public/c/system/types.h" |
14 #include "mojo/public/cpp/environment/environment.h" | 14 #include "mojo/public/cpp/environment/environment.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 class DartTest : public testing::Test { | 20 class DartTest : public testing::Test { |
21 public: | 21 public: |
22 DartTest() {} | 22 DartTest() {} |
23 | 23 |
24 static void SetUpTestCase() { | 24 static void SetUpTestCase() { |
25 DartController::Initialize(nullptr, true, false, nullptr, 0); | 25 DartController::Initialize(nullptr, true, false, false, nullptr, 0); |
26 } | 26 } |
27 | 27 |
28 static void TearDownTestCase() { | 28 static void TearDownTestCase() { |
29 DartController::Shutdown(); | 29 DartController::Shutdown(); |
30 } | 30 } |
31 | 31 |
32 void RunDartTest(const base::FilePath& path, | 32 void RunDartTest(const base::FilePath& path, |
33 const std::vector<std::string>& script_arguments, | 33 const std::vector<std::string>& script_arguments, |
34 bool compile_all, | 34 bool compile_all, |
35 bool expect_unhandled_exception, | 35 bool expect_unhandled_exception, |
(...skipping 12 matching lines...) Expand all Loading... |
48 EXPECT_TRUE(Dart_IsError(error)); | 48 EXPECT_TRUE(Dart_IsError(error)); |
49 *exception = true; | 49 *exception = true; |
50 *closed_handles = count; | 50 *closed_handles = count; |
51 } | 51 } |
52 }; | 52 }; |
53 | 53 |
54 } // namespace dart | 54 } // namespace dart |
55 } // namespace mojo | 55 } // namespace mojo |
56 | 56 |
57 #endif // MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ | 57 #endif // MOJO_DART_UNITTESTS_EMBEDDER_TESTER_DART_TEST_H_ |
OLD | NEW |