| 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/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "gin/modules/console.h" | 8 #include "gin/modules/console.h" |
| 9 #include "gin/modules/module_registry.h" | 9 #include "gin/modules/module_registry.h" |
| 10 #include "gin/modules/timer.h" | 10 #include "gin/modules/timer.h" |
| 11 #include "gin/test/file_runner.h" | 11 #include "gin/test/file_runner.h" |
| 12 #include "gin/test/gtest.h" | 12 #include "gin/test/gtest.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 "mojo/bindings/js/core.h" | 15 #include "mojo/bindings/js/core.h" |
| 16 #include "mojo/bindings/js/unicode.h" | |
| 17 #include "mojo/common/test/test_utils.h" | 16 #include "mojo/common/test/test_utils.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 18 |
| 20 namespace mojo { | 19 namespace mojo { |
| 21 namespace js { | 20 namespace js { |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 class TestRunnerDelegate : public gin::FileRunnerDelegate { | 23 class TestRunnerDelegate : public gin::FileRunnerDelegate { |
| 25 public: | 24 public: |
| 26 TestRunnerDelegate() { | 25 TestRunnerDelegate() { |
| 27 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); | 26 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); |
| 28 AddBuiltinModule(Core::kModuleName, Core::GetModule); | 27 AddBuiltinModule(Core::kModuleName, Core::GetModule); |
| 29 AddBuiltinModule(Unicode::kModuleName, Unicode::GetModule); | |
| 30 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule); | 28 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule); |
| 31 AddBuiltinModule(apps::MonotonicClock::kModuleName, | 29 AddBuiltinModule(apps::MonotonicClock::kModuleName, |
| 32 apps::MonotonicClock::GetModule); | 30 apps::MonotonicClock::GetModule); |
| 33 AddBuiltinModule(apps::Threading::kModuleName, apps::Threading::GetModule); | 31 AddBuiltinModule(apps::Threading::kModuleName, apps::Threading::GetModule); |
| 34 } | 32 } |
| 35 | 33 |
| 36 private: | 34 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); | 35 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); |
| 38 }; | 36 }; |
| 39 | 37 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 RunTest("connection_unittests.js", false); | 77 RunTest("connection_unittests.js", false); |
| 80 } | 78 } |
| 81 | 79 |
| 82 TEST(JSTest, monotonic_clock) { | 80 TEST(JSTest, monotonic_clock) { |
| 83 RunTest("monotonic_clock_unittests.js", false); | 81 RunTest("monotonic_clock_unittests.js", false); |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace | 84 } // namespace |
| 87 } // namespace js | 85 } // namespace js |
| 88 } // namespace mojo | 86 } // namespace mojo |
| OLD | NEW |