| 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/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 .AppendASCII("test") | 296 .AppendASCII("test") |
| 297 .AppendASCII(test); | 297 .AppendASCII(test); |
| 298 | 298 |
| 299 // Read in the source. | 299 // Read in the source. |
| 300 std::string source; | 300 std::string source; |
| 301 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; | 301 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; |
| 302 | 302 |
| 303 // Setup the package root. | 303 // Setup the package root. |
| 304 base::FilePath package_root; | 304 base::FilePath package_root; |
| 305 PathService::Get(base::DIR_EXE, &package_root); | 305 PathService::Get(base::DIR_EXE, &package_root); |
| 306 package_root = package_root.AppendASCII("gen"); | 306 package_root = package_root.AppendASCII("gen") |
| 307 .AppendASCII("dart-gen"); |
| 307 | 308 |
| 308 config->strict_compilation = true; | 309 config->strict_compilation = true; |
| 309 config->script = source; | 310 config->script = source; |
| 310 config->script_uri = path.AsUTF8Unsafe(); | 311 config->script_uri = path.AsUTF8Unsafe(); |
| 311 config->package_root = package_root.AsUTF8Unsafe(); | 312 config->package_root = package_root.AsUTF8Unsafe(); |
| 312 config->application_data = nullptr; | 313 config->application_data = nullptr; |
| 313 config->callbacks.exception = | 314 config->callbacks.exception = |
| 314 base::Bind(&UnhandledExceptionCallback, unhandled_exception); | 315 base::Bind(&UnhandledExceptionCallback, unhandled_exception); |
| 315 config->entropy = GenerateEntropy; | 316 config->entropy = GenerateEntropy; |
| 316 config->handle = handle; | 317 config->handle = handle; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 TEST_F(DartToCppTest, Echo) { | 373 TEST_F(DartToCppTest, Echo) { |
| 373 EchoCppSideConnection cpp_side_connection; | 374 EchoCppSideConnection cpp_side_connection; |
| 374 bool unhandled_exception = | 375 bool unhandled_exception = |
| 375 RunTest("dart_to_cpp_tests.dart", &cpp_side_connection); | 376 RunTest("dart_to_cpp_tests.dart", &cpp_side_connection); |
| 376 EXPECT_TRUE(cpp_side_connection.DidSucceed()); | 377 EXPECT_TRUE(cpp_side_connection.DidSucceed()); |
| 377 EXPECT_FALSE(unhandled_exception); | 378 EXPECT_FALSE(unhandled_exception); |
| 378 } | 379 } |
| 379 | 380 |
| 380 } // namespace dart | 381 } // namespace dart |
| 381 } // namespace mojo | 382 } // namespace mojo |
| OLD | NEW |