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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 .AppendASCII("test") | 52 .AppendASCII("test") |
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 | 64 |
64 char* error = NULL; | 65 char* error = NULL; |
65 bool unhandled_exception = false; | 66 bool unhandled_exception = false; |
66 DartControllerConfig config; | 67 DartControllerConfig config; |
67 config.script = source; | 68 config.script = source; |
68 // Run with strict compilation even in Release mode so that ASAN testing gets | 69 // Run with strict compilation even in Release mode so that ASAN testing gets |
69 // coverage of Dart asserts, type-checking, etc. | 70 // coverage of Dart asserts, type-checking, etc. |
70 config.strict_compilation = true; | 71 config.strict_compilation = true; |
71 config.script_uri = test; | 72 config.script_uri = test; |
72 config.package_root = package_root.AsUTF8Unsafe(); | 73 config.package_root = package_root.AsUTF8Unsafe(); |
(...skipping 12 matching lines...) Expand all Loading... |
85 EXPECT_FALSE(unhandled_exception); | 86 EXPECT_FALSE(unhandled_exception); |
86 } | 87 } |
87 | 88 |
88 TEST(DartTest, validation) { | 89 TEST(DartTest, validation) { |
89 RunTest(GetPath()); | 90 RunTest(GetPath()); |
90 } | 91 } |
91 | 92 |
92 } // namespace | 93 } // namespace |
93 } // namespace dart | 94 } // namespace dart |
94 } // namespace mojo | 95 } // namespace mojo |
OLD | NEW |