Index: mojo/public/bindings/js/test/run_js_tests.cc |
diff --git a/mojo/public/bindings/js/test/run_js_tests.cc b/mojo/public/bindings/js/test/run_js_tests.cc |
index b254cd650ff661e9d37e49240e395f355462458f..01de6739c6901821edffc14b5028e22d77f1048a 100644 |
--- a/mojo/public/bindings/js/test/run_js_tests.cc |
+++ b/mojo/public/bindings/js/test/run_js_tests.cc |
@@ -44,6 +44,43 @@ TEST(JSTest, core) { |
RunTest("core_unittests.js"); |
} |
+TEST(JSTest, codec) { |
+ // TODO(abarth): Rather than loading all these files manually, we should |
+ // teach the module loading system how to find imported modules on disk. |
abarth-chromium
2013/11/17 20:07:05
This code will get much cleaner once https://coder
|
+ |
+ base::FilePath path; |
+ PathService::Get(base::DIR_SOURCE_ROOT, &path); |
+ path = path.AppendASCII("mojo") |
+ .AppendASCII("public") |
+ .AppendASCII("bindings") |
+ .AppendASCII("js"); |
+ |
+ base::FilePath codec_path = path.AppendASCII("codec.js"); |
+ ASSERT_TRUE(base::PathExists(codec_path)) |
+ << codec_path.LossyDisplayName(); |
+ |
+ base::FilePath codec_unittests_path = path.AppendASCII("codec_unittests.js"); |
+ ASSERT_TRUE(base::PathExists(codec_unittests_path)) |
+ << codec_unittests_path.LossyDisplayName(); |
+ |
+ base::FilePath sample_service_path = |
+ path.AppendASCII("test").AppendASCII("sample_service.js"); |
+ ASSERT_TRUE(base::PathExists(sample_service_path)) |
+ << sample_service_path.LossyDisplayName(); |
+ |
+ std::string codec; |
+ ASSERT_TRUE(ReadFileToString(codec_path, &codec)); |
+ |
+ std::string codec_unittests; |
+ ASSERT_TRUE(ReadFileToString(codec_unittests_path, &codec_unittests)); |
+ |
+ std::string sample_service; |
+ ASSERT_TRUE(ReadFileToString(sample_service_path, &sample_service)); |
+ |
+ TestRunnerDelegate delegate; |
+ gin::RunTestFromString(codec + codec_unittests + sample_service, &delegate); |
+} |
+ |
} // namespace |
} // namespace js |
} // namespace mojo |