| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.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" | |
| 11 #include "gin/test/file_runner.h" | 10 #include "gin/test/file_runner.h" |
| 12 #include "gin/test/gtest.h" | 11 #include "gin/test/gtest.h" |
| 13 #include "mojo/edk/js/core.h" | 12 #include "mojo/edk/js/core.h" |
| 14 #include "mojo/edk/js/support.h" | 13 #include "mojo/edk/js/support.h" |
| 15 #include "mojo/edk/js/threading.h" | 14 #include "mojo/edk/js/threading.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 16 |
| 18 namespace mojo { | 17 namespace mojo { |
| 19 namespace edk { | 18 namespace edk { |
| 20 namespace js { | 19 namespace js { |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| 23 class TestRunnerDelegate : public gin::FileRunnerDelegate { | 22 class TestRunnerDelegate : public gin::FileRunnerDelegate { |
| 24 public: | 23 public: |
| 25 TestRunnerDelegate() { | 24 TestRunnerDelegate() { |
| 26 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); | 25 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); |
| 27 AddBuiltinModule(gin::TimerModule::kName, gin::TimerModule::GetModule); | |
| 28 AddBuiltinModule(Core::kModuleName, Core::GetModule); | 26 AddBuiltinModule(Core::kModuleName, Core::GetModule); |
| 29 AddBuiltinModule(Threading::kModuleName, Threading::GetModule); | 27 AddBuiltinModule(Threading::kModuleName, Threading::GetModule); |
| 30 AddBuiltinModule(Support::kModuleName, Support::GetModule); | 28 AddBuiltinModule(Support::kModuleName, Support::GetModule); |
| 31 } | 29 } |
| 32 | 30 |
| 33 private: | 31 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); | 32 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); |
| 35 }; | 33 }; |
| 36 | 34 |
| 37 void RunTest(std::string test, bool run_until_idle) { | 35 void RunTest(std::string test, bool run_until_idle) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 } | 50 } |
| 53 | 51 |
| 54 TEST(JSTest, Validation) { | 52 TEST(JSTest, Validation) { |
| 55 RunTest("validation_unittest.js", true); | 53 RunTest("validation_unittest.js", true); |
| 56 } | 54 } |
| 57 | 55 |
| 58 } // namespace | 56 } // namespace |
| 59 } // namespace js | 57 } // namespace js |
| 60 } // namespace edk | 58 } // namespace edk |
| 61 } // namespace mojo | 59 } // namespace mojo |
| OLD | NEW |