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

Side by Side Diff: mojo/edk/js/test/run_js_tests.cc

Issue 728043002: Revert of Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/js/test/run_js_integration_tests.cc ('k') | mojo/edk/js/tests/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/files/file_path.h"
6 #include "base/path_service.h"
7 #include "gin/modules/console.h"
8 #include "gin/modules/module_registry.h"
9 #include "gin/test/file_runner.h"
10 #include "gin/test/gtest.h"
11 #include "mojo/edk/js/core.h"
12 #include "mojo/edk/js/support.h"
13 #include "mojo/public/cpp/environment/environment.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15
16 namespace mojo {
17 namespace js {
18 namespace {
19
20 class TestRunnerDelegate : public gin::FileRunnerDelegate {
21 public:
22 TestRunnerDelegate() {
23 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule);
24 AddBuiltinModule(Core::kModuleName, Core::GetModule);
25 AddBuiltinModule(Support::kModuleName, Support::GetModule);
26 }
27
28 private:
29 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate);
30 };
31
32 void RunTest(std::string test, bool run_until_idle) {
33 base::FilePath path;
34 PathService::Get(base::DIR_SOURCE_ROOT, &path);
35 path = path.AppendASCII("mojo")
36 .AppendASCII("public")
37 .AppendASCII("js")
38 .AppendASCII(test);
39 TestRunnerDelegate delegate;
40 gin::RunTestFromFile(path, &delegate, run_until_idle);
41 }
42
43 // TODO(abarth): Should we autogenerate these stubs from GYP?
44 TEST(JSTest, core) {
45 RunTest("core_unittests.js", true);
46 }
47
48 TEST(JSTest, codec) {
49 RunTest("codec_unittests.js", true);
50 }
51
52 TEST(JSTest, struct) {
53 RunTest("struct_unittests.js", true);
54 }
55
56 TEST(JSTest, validation) {
57 RunTest("validation_unittests.js", true);
58 }
59
60 } // namespace
61 } // namespace js
62 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/js/test/run_js_integration_tests.cc ('k') | mojo/edk/js/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698