This source file includes following definitions.
- BasePath
- RunTest
- TEST
- TEST
#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"));
}
}
}