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

Side by Side Diff: mojo/apps/js/test/run_apps_js_tests.cc

Issue 703023004: Move the JS content handler et al from mojo/apps/js to mojo/services (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixed DEPS gl build 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/apps/js/test/BUILD.gn ('k') | mojo/services/public/js/mojo.js » ('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 2013 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/modules/timer.h"
10 #include "gin/test/file_runner.h"
11 #include "gin/test/gtest.h"
12 #include "mojo/apps/js/bindings/monotonic_clock.h"
13 #include "mojo/edk/js/core.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(gin::TimerModule::kName, gin::TimerModule::GetModule);
26 AddBuiltinModule(apps::MonotonicClock::kModuleName,
27 apps::MonotonicClock::GetModule);
28 }
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate);
32 };
33
34 void RunTest(std::string test, bool run_until_idle) {
35 base::FilePath path;
36 PathService::Get(base::DIR_SOURCE_ROOT, &path);
37 path = path.AppendASCII("mojo")
38 .AppendASCII("apps")
39 .AppendASCII("js")
40 .AppendASCII("bindings")
41 .AppendASCII(test);
42 TestRunnerDelegate delegate;
43 gin::RunTestFromFile(path, &delegate, run_until_idle);
44 }
45
46 // TODO(abarth): Should we autogenerate these stubs from GYP?
47
48 TEST(JSTest, monotonic_clock) {
49 RunTest("monotonic_clock_unittests.js", false);
50 }
51
52 } // namespace
53 } // namespace js
54 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/apps/js/test/BUILD.gn ('k') | mojo/services/public/js/mojo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698