OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "gin/modules/console.h" | 7 #include "gin/modules/console.h" |
8 #include "gin/modules/module_registry.h" | 8 #include "gin/modules/module_registry.h" |
9 #include "gin/modules/timer.h" | 9 #include "gin/modules/timer.h" |
10 #include "gin/test/file_runner.h" | 10 #include "gin/test/file_runner.h" |
11 #include "gin/test/gtest.h" | 11 #include "gin/test/gtest.h" |
12 #include "mojo/apps/js/bindings/core.h" | 12 #include "mojo/apps/js/bindings/core.h" |
13 #include "mojo/apps/js/bindings/monotonic_clock.h" | 13 #include "mojo/apps/js/bindings/monotonic_clock.h" |
14 #include "mojo/apps/js/bindings/threading.h" | 14 #include "mojo/apps/js/bindings/threading.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace js { | 18 namespace js { |
19 namespace { | 19 namespace { |
20 | 20 |
21 class TestRunnerDelegate : public gin::FileRunnerDelegate { | 21 class TestRunnerDelegate : public gin::FileRunnerDelegate { |
22 public: | 22 public: |
23 TestRunnerDelegate() { | 23 TestRunnerDelegate() { |
24 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); | 24 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); |
25 AddBuiltinModule(Core::kModuleName, Core::GetModule); | 25 AddBuiltinModule(Core::kModuleName, Core::GetModule); |
26 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule); | 26 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule); |
27 AddBuiltinModule(apps::MonotonicClock::kModuleName, | 27 AddBuiltinModule(apps::MonotonicClock::kModuleName, |
28 apps::MonotonicClock::GetModule); | 28 apps::MonotonicClock::GetModule); |
29 AddBuiltinModule(apps::Threading::kModuleName, apps::Threading::GetModule); | 29 AddBuiltinModule(apps::Threading::kModuleName, apps::Threading::GetModule); |
30 } | 30 } |
31 | 31 |
32 private: | 32 private: |
33 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); | 33 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); |
34 }; | 34 }; |
(...skipping 27 matching lines...) Expand all Loading... |
62 RunTest("connector_unittests.js", true); | 62 RunTest("connector_unittests.js", true); |
63 } | 63 } |
64 | 64 |
65 TEST(JSTest, monotonic_clock) { | 65 TEST(JSTest, monotonic_clock) { |
66 RunTest("monotonic_clock_unittests.js", false); | 66 RunTest("monotonic_clock_unittests.js", false); |
67 } | 67 } |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 } // namespace js | 70 } // namespace js |
71 } // namespace mojo | 71 } // namespace mojo |
OLD | NEW |