| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/rand_util.h" | 15 #include "base/rand_util.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "mojo/dart/embedder/dart_controller.h" | 17 #include "mojo/dart/embedder/dart_controller.h" |
| 18 #include "mojo/dart/embedder/test/dart_test.h" | 18 #include "mojo/dart/unittests/embedder_tester/dart_test.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 namespace dart { | 22 namespace dart { |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 class DartValidationTest : public DartTest { | 25 class DartValidationTest : public DartTest { |
| 26 public: | 26 public: |
| 27 | 27 |
| 28 DartValidationTest() {} | 28 DartValidationTest() {} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 .AppendASCII("validation"); | 39 .AppendASCII("validation"); |
| 40 | 40 |
| 41 return path.AsUTF8Unsafe(); | 41 return path.AsUTF8Unsafe(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void RunTest(const std::string& test) { | 44 void RunTest(const std::string& test) { |
| 45 base::FilePath path; | 45 base::FilePath path; |
| 46 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 46 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 47 path = path.AppendASCII("mojo") | 47 path = path.AppendASCII("mojo") |
| 48 .AppendASCII("dart") | 48 .AppendASCII("dart") |
| 49 .AppendASCII("test") | 49 .AppendASCII("unittests") |
| 50 .AppendASCII("embedder_tests") |
| 50 .AppendASCII("validation_test.dart"); | 51 .AppendASCII("validation_test.dart"); |
| 51 std::vector<std::string> script_arguments = | 52 std::vector<std::string> script_arguments = |
| 52 CollectTests(base::FilePath(test)); | 53 CollectTests(base::FilePath(test)); |
| 53 | 54 |
| 54 RunDartTest(path, script_arguments, false, false, 0); | 55 RunDartTest(path, script_arguments, false, false, 0); |
| 55 } | 56 } |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 // Enumerates files inside |path| and collects all data needed to run | 59 // Enumerates files inside |path| and collects all data needed to run |
| 59 // conformance tests. | 60 // conformance tests. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 104 } |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 TEST_F(DartValidationTest, validation) { | 107 TEST_F(DartValidationTest, validation) { |
| 107 RunTest(GetPath()); | 108 RunTest(GetPath()); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace | 111 } // namespace |
| 111 } // namespace dart | 112 } // namespace dart |
| 112 } // namespace mojo | 113 } // namespace mojo |
| OLD | NEW |