| 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 "crypto/random.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; | 44 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; |
| 45 | 45 |
| 46 // Setup the package root. | 46 // Setup the package root. |
| 47 base::FilePath package_root; | 47 base::FilePath package_root; |
| 48 PathService::Get(base::DIR_EXE, &package_root); | 48 PathService::Get(base::DIR_EXE, &package_root); |
| 49 package_root = package_root.AppendASCII("gen"); | 49 package_root = package_root.AppendASCII("gen"); |
| 50 | 50 |
| 51 char* error = NULL; | 51 char* error = NULL; |
| 52 bool unhandled_exception = false; | 52 bool unhandled_exception = false; |
| 53 DartControllerConfig config; | 53 DartControllerConfig config; |
| 54 #if defined(DEBUG) |
| 54 config.strict_compilation = true; | 55 config.strict_compilation = true; |
| 56 #else |
| 57 config.strict_compilation = false; |
| 58 #endif |
| 55 config.script = source; | 59 config.script = source; |
| 56 config.script_uri = path.AsUTF8Unsafe(); | 60 config.script_uri = path.AsUTF8Unsafe(); |
| 57 config.package_root = package_root.AsUTF8Unsafe(); | 61 config.package_root = package_root.AsUTF8Unsafe(); |
| 58 config.application_data = nullptr; | 62 config.application_data = nullptr; |
| 59 config.callbacks.exception = | 63 config.callbacks.exception = |
| 60 base::Bind(&exceptionCallback, &unhandled_exception); | 64 base::Bind(&exceptionCallback, &unhandled_exception); |
| 61 config.entropy = generateEntropy; | 65 config.entropy = generateEntropy; |
| 62 config.arguments = extra_args; | 66 config.arguments = extra_args; |
| 63 config.arguments_count = num_extra_args; | 67 config.arguments_count = num_extra_args; |
| 64 config.handle = MOJO_HANDLE_INVALID; | 68 config.handle = MOJO_HANDLE_INVALID; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 118 } |
| 115 | 119 |
| 116 TEST(DartTest, codec_test) { | 120 TEST(DartTest, codec_test) { |
| 117 RunTest("codec_test.dart", false, nullptr, 0); | 121 RunTest("codec_test.dart", false, nullptr, 0); |
| 118 } | 122 } |
| 119 | 123 |
| 120 TEST(DartTest, handle_watcher_test) { | 124 TEST(DartTest, handle_watcher_test) { |
| 121 RunTest("handle_watcher_test.dart", false, nullptr, 0); | 125 RunTest("handle_watcher_test.dart", false, nullptr, 0); |
| 122 } | 126 } |
| 123 | 127 |
| 124 TEST(DartTest, interface_test) { | |
| 125 RunTest("interface_test.dart", false, nullptr, 0); | |
| 126 } | |
| 127 | |
| 128 TEST(DartTest, bindings_generation_test) { | 128 TEST(DartTest, bindings_generation_test) { |
| 129 RunTest("bindings_generation_test.dart", false, nullptr, 0); | 129 RunTest("bindings_generation_test.dart", false, nullptr, 0); |
| 130 } | 130 } |
| 131 | 131 |
| 132 TEST(DartTest, compile_all_interfaces_test) { | 132 TEST(DartTest, compile_all_interfaces_test) { |
| 133 RunTest("compile_all_interfaces_test.dart", true, nullptr, 0); | 133 RunTest("compile_all_interfaces_test.dart", true, nullptr, 0); |
| 134 } | 134 } |
| 135 | 135 |
| 136 TEST(DartTest, uri_base_test) { | 136 TEST(DartTest, uri_base_test) { |
| 137 RunTest("uri_base_test.dart", true, nullptr, 0); | 137 RunTest("uri_base_test.dart", true, nullptr, 0); |
| 138 } | 138 } |
| 139 | 139 |
| 140 TEST(DartTest, handle_finalizer_test) { | 140 TEST(DartTest, handle_finalizer_test) { |
| 141 const int kNumArgs = 2; | 141 const int kNumArgs = 2; |
| 142 const char* args[kNumArgs]; | 142 const char* args[kNumArgs]; |
| 143 args[0] = "--new-gen-semi-max-size=1"; | 143 args[0] = "--new-gen-semi-max-size=1"; |
| 144 args[1] = "--old_gen_growth_rate=1"; | 144 args[1] = "--old_gen_growth_rate=1"; |
| 145 RunTest("handle_finalizer_test.dart", false, args, kNumArgs); | 145 RunTest("handle_finalizer_test.dart", false, args, kNumArgs); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace | 148 } // namespace |
| 149 } // namespace dart | 149 } // namespace dart |
| 150 } // namespace mojo | 150 } // namespace mojo |
| OLD | NEW |