| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 .AppendASCII("validation_test.dart"); | 53 .AppendASCII("validation_test.dart"); |
| 54 | 54 |
| 55 // Read in the source. | 55 // Read in the source. |
| 56 std::string source; | 56 std::string source; |
| 57 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; | 57 EXPECT_TRUE(ReadFileToString(path, &source)) << "Failed to read test file"; |
| 58 | 58 |
| 59 // Setup the package root. | 59 // Setup the package root. |
| 60 base::FilePath package_root; | 60 base::FilePath package_root; |
| 61 PathService::Get(base::DIR_EXE, &package_root); | 61 PathService::Get(base::DIR_EXE, &package_root); |
| 62 package_root = package_root.AppendASCII("gen") | 62 package_root = package_root.AppendASCII("gen") |
| 63 .AppendASCII("dart-gen"); | 63 .AppendASCII("dart-pkg") |
| 64 .AppendASCII("packages"); |
| 64 | 65 |
| 65 char* error = NULL; | 66 char* error = NULL; |
| 66 bool unhandled_exception = false; | 67 bool unhandled_exception = false; |
| 67 DartControllerConfig config; | 68 DartControllerConfig config; |
| 68 config.script = source; | 69 config.script = source; |
| 69 // Run with strict compilation even in Release mode so that ASAN testing gets | 70 // Run with strict compilation even in Release mode so that ASAN testing gets |
| 70 // coverage of Dart asserts, type-checking, etc. | 71 // coverage of Dart asserts, type-checking, etc. |
| 71 config.strict_compilation = true; | 72 config.strict_compilation = true; |
| 72 config.script_uri = test; | 73 config.script_uri = test; |
| 73 config.package_root = package_root.AsUTF8Unsafe(); | 74 config.package_root = package_root.AsUTF8Unsafe(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 86 EXPECT_FALSE(unhandled_exception); | 87 EXPECT_FALSE(unhandled_exception); |
| 87 } | 88 } |
| 88 | 89 |
| 89 TEST(DartTest, validation) { | 90 TEST(DartTest, validation) { |
| 90 RunTest(GetPath()); | 91 RunTest(GetPath()); |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace | 94 } // namespace |
| 94 } // namespace dart | 95 } // namespace dart |
| 95 } // namespace mojo | 96 } // namespace mojo |
| OLD | NEW |