Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: mojo/edk/js/tests/run_js_unittests.cc

Issue 2645873003: Cleanup mojo-js tests. (Closed)
Patch Set: more deps fixes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/edk/js/tests/sample_service_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/js/tests/run_js_unittests.cc
diff --git a/mojo/edk/js/test/run_js_integration_tests.cc b/mojo/edk/js/tests/run_js_unittests.cc
similarity index 67%
rename from mojo/edk/js/test/run_js_integration_tests.cc
rename to mojo/edk/js/tests/run_js_unittests.cc
index f3eb936f3fbf8d09bc38a1ca9f0fbf03f83aba54..bc5e242c629813cb16eae7f2d4bc50c9a9c1043c 100644
--- a/mojo/edk/js/test/run_js_integration_tests.cc
+++ b/mojo/edk/js/tests/run_js_unittests.cc
@@ -7,7 +7,6 @@
#include "base/path_service.h"
#include "gin/modules/console.h"
#include "gin/modules/module_registry.h"
-#include "gin/modules/timer.h"
#include "gin/test/file_runner.h"
#include "gin/test/gtest.h"
#include "mojo/edk/js/core.h"
@@ -25,40 +24,61 @@ class TestRunnerDelegate : public gin::FileRunnerDelegate {
TestRunnerDelegate() {
AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule);
AddBuiltinModule(Core::kModuleName, Core::GetModule);
- AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule);
AddBuiltinModule(Threading::kModuleName, Threading::GetModule);
AddBuiltinModule(Support::kModuleName, Support::GetModule);
}
+
private:
DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate);
};
-void RunTest(std::string test) {
+void RunTest(std::string test, bool run_until_idle) {
base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("mojo")
- .AppendASCII("edk")
+ .AppendASCII("public")
.AppendASCII("js")
.AppendASCII("tests")
.AppendASCII(test);
TestRunnerDelegate delegate;
- gin::RunTestFromFile(path, &delegate, false);
+ gin::RunTestFromFile(path, &delegate, run_until_idle);
+}
+
+// TODO(abarth): Should we autogenerate these stubs from GYP?
+TEST(JSTest, Binding) {
+ RunTest("binding_unittest.js", false);
+}
+
+TEST(JSTest, Codec) {
+ RunTest("codec_unittest.js", true);
}
TEST(JSTest, Connection) {
- RunTest("connection_tests.js");
+ RunTest("connection_unittest.js", false);
}
-TEST(JSTest, SampleService) {
- RunTest("sample_service_tests.js");
+TEST(JSTest, Core) {
+ RunTest("core_unittest.js", true);
}
TEST(JSTest, InterfacePtr) {
- RunTest("interface_ptr_tests.js");
+ RunTest("interface_ptr_unittest.js", false);
}
-TEST(JSTest, Binding) {
- RunTest("binding_tests.js");
+TEST(JSTest, SampleService) {
+ RunTest("sample_service_unittest.js", false);
+}
+
+TEST(JSTest, Struct) {
+ RunTest("struct_unittest.js", true);
+}
+
+TEST(JSTest, Union) {
+ RunTest("union_unittest.js", true);
+}
+
+TEST(JSTest, Validation) {
+ RunTest("validation_unittest.js", true);
}
} // namespace
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/edk/js/tests/sample_service_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698