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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "gin/modules/console.h" | 8 #include "gin/modules/console.h" |
9 #include "gin/modules/module_registry.h" | 9 #include "gin/modules/module_registry.h" |
10 #include "gin/modules/timer.h" | 10 #include "gin/modules/timer.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 .AppendASCII(test); | 38 .AppendASCII(test); |
39 TestRunnerDelegate delegate; | 39 TestRunnerDelegate delegate; |
40 gin::RunTestFromFile(path, &delegate, run_until_idle); | 40 gin::RunTestFromFile(path, &delegate, run_until_idle); |
41 } | 41 } |
42 | 42 |
43 // TODO(abarth): Should we autogenerate these stubs from GYP? | 43 // TODO(abarth): Should we autogenerate these stubs from GYP? |
44 TEST(JSTest, core) { | 44 TEST(JSTest, core) { |
45 RunTest("core_unittests.js", true); | 45 RunTest("core_unittests.js", true); |
46 } | 46 } |
47 | 47 |
48 TEST(JSTest, codec) { | 48 static bool MojoBindingFilesExist() { |
49 // TODO(yzshen): Remove this check once isolated tests are supported on the | 49 // TODO(yzshen): Remove this check once isolated tests are supported on the |
50 // Chromium waterfall. (http://crbug.com/351214) | 50 // Chromium waterfall. (http://crbug.com/351214) |
51 const base::FilePath test_file_path( | 51 const base::FilePath test_file_path( |
52 test::GetFilePathForJSResource( | 52 test::GetFilePathForJSResource( |
53 "mojo/public/interfaces/bindings/tests/sample_service.mojom")); | 53 "mojo/public/interfaces/bindings/tests/sample_service.mojom")); |
54 if (!base::PathExists(test_file_path)) { | 54 if (!base::PathExists(test_file_path)) { |
55 LOG(WARNING) << "Mojom binding files don't exist. Skipping the test."; | 55 LOG(WARNING) << "Mojom binding files don't exist. Skipping the test."; |
| 56 return false; |
| 57 } |
| 58 return true; |
| 59 } |
| 60 |
| 61 TEST(JSTest, codec) { |
| 62 if (!MojoBindingFilesExist()) |
56 return; | 63 return; |
57 } | 64 RunTest("codec_unittests.js", true); |
| 65 } |
58 | 66 |
59 RunTest("codec_unittests.js", true); | 67 TEST(JSTest, validation) { |
| 68 if (!MojoBindingFilesExist()) |
| 69 return; |
| 70 RunTest("validation_unittests.js", true); |
60 } | 71 } |
61 | 72 |
62 } // namespace | 73 } // namespace |
63 } // namespace js | 74 } // namespace js |
64 } // namespace mojo | 75 } // namespace mojo |
OLD | NEW |