Index: mojo/public/js/bindings/tests/run_js_tests.cc |
diff --git a/mojo/bindings/js/run_js_tests.cc b/mojo/public/js/bindings/tests/run_js_tests.cc |
similarity index 86% |
rename from mojo/bindings/js/run_js_tests.cc |
rename to mojo/public/js/bindings/tests/run_js_tests.cc |
index 976a0b17591b90da5ba84d04ec2ad7d16f666d78..c3704674e418d9c43aca85989eeacb28e7418558 100644 |
--- a/mojo/bindings/js/run_js_tests.cc |
+++ b/mojo/public/js/bindings/tests/run_js_tests.cc |
@@ -33,8 +33,10 @@ void RunTest(std::string test, bool run_until_idle) { |
base::FilePath path; |
PathService::Get(base::DIR_SOURCE_ROOT, &path); |
path = path.AppendASCII("mojo") |
- .AppendASCII("bindings") |
+ .AppendASCII("public") |
.AppendASCII("js") |
+ .AppendASCII("bindings") |
+ .AppendASCII("tests") |
.AppendASCII(test); |
TestRunnerDelegate delegate; |
gin::RunTestFromFile(path, &delegate, run_until_idle); |
@@ -45,7 +47,7 @@ TEST(JSTest, core) { |
RunTest("core_unittests.js", true); |
} |
-TEST(JSTest, codec) { |
+static bool MojoBindingFilesExist() { |
yzshen1
2014/07/23 07:26:55
I think this whole check is not necessary anymore.
hansmuller
2014/07/23 18:06:36
OK. I've removed it from here and from /mojo/apps/
yzshen1
2014/07/23 19:53:38
Thanks! :)
|
// TODO(yzshen): Remove this check once isolated tests are supported on the |
// Chromium waterfall. (http://crbug.com/351214) |
const base::FilePath test_file_path( |
@@ -53,12 +55,23 @@ TEST(JSTest, codec) { |
"mojo/public/interfaces/bindings/tests/sample_service.mojom")); |
if (!base::PathExists(test_file_path)) { |
LOG(WARNING) << "Mojom binding files don't exist. Skipping the test."; |
- return; |
+ return false; |
} |
+ return true; |
+} |
+TEST(JSTest, codec) { |
+ if (!MojoBindingFilesExist()) |
+ return; |
RunTest("codec_unittests.js", true); |
} |
+TEST(JSTest, validation) { |
+ if (!MojoBindingFilesExist()) |
+ return; |
+ RunTest("validation_unittests.js", true); |
+} |
+ |
} // namespace |
} // namespace js |
} // namespace mojo |