Index: gin/test/run_js_tests.cc |
diff --git a/gin/test/run_js_tests.cc b/gin/test/run_js_tests.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0b7c41a65aaee4cfffa68c54c43d8942b06e976a |
--- /dev/null |
+++ b/gin/test/run_js_tests.cc |
@@ -0,0 +1,37 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "base/file_util.h" |
+#include "base/path_service.h" |
+#include "gin/test/file_runner.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace gin { |
+namespace { |
+ |
+base::FilePath BasePath() { |
+ base::FilePath path; |
+ PathService::Get(base::DIR_SOURCE_ROOT, &path); |
+ return path.AppendASCII("gin"); |
+} |
+ |
+void RunTest(const base::FilePath& path) { |
+ FileRunnerDelegate delegate; |
+ RunTestFromFile(path, &delegate); |
+} |
+ |
+TEST(JSTest, GTest) { |
+ RunTest(BasePath() |
+ .AppendASCII("test") |
+ .AppendASCII("gtest_unittests.js")); |
+} |
+ |
+TEST(JSTest, ModuleRegistry) { |
+ RunTest(BasePath() |
+ .AppendASCII("modules") |
+ .AppendASCII("module_registry_unittests.js")); |
+} |
+ |
+} // namespace |
+} // gin |