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

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

Issue 728553002: 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
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/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"
10 #include "gin/test/file_runner.h" 9 #include "gin/test/file_runner.h"
11 #include "gin/test/gtest.h" 10 #include "gin/test/gtest.h"
12 #include "mojo/edk/js/core.h" 11 #include "mojo/edk/js/core.h"
13 #include "mojo/edk/js/support.h" 12 #include "mojo/edk/js/support.h"
14 #include "mojo/public/cpp/environment/environment.h" 13 #include "mojo/public/cpp/environment/environment.h"
15 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
16 15
17 namespace mojo { 16 namespace mojo {
18 namespace js { 17 namespace js {
19 namespace { 18 namespace {
20 19
21 class TestRunnerDelegate : public gin::FileRunnerDelegate { 20 class TestRunnerDelegate : public gin::FileRunnerDelegate {
22 public: 21 public:
23 TestRunnerDelegate() { 22 TestRunnerDelegate() {
24 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule); 23 AddBuiltinModule(gin::Console::kModuleName, gin::Console::GetModule);
25 AddBuiltinModule(Core::kModuleName, Core::GetModule); 24 AddBuiltinModule(Core::kModuleName, Core::GetModule);
26 AddBuiltinModule(Support::kModuleName, Support::GetModule); 25 AddBuiltinModule(Support::kModuleName, Support::GetModule);
27 } 26 }
28 27
29 private: 28 private:
30 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate); 29 DISALLOW_COPY_AND_ASSIGN(TestRunnerDelegate);
31 }; 30 };
32 31
33 void RunTest(std::string test, bool run_until_idle) { 32 void RunTest(std::string test, bool run_until_idle) {
34 Environment env;
35 base::FilePath path; 33 base::FilePath path;
36 PathService::Get(base::DIR_SOURCE_ROOT, &path); 34 PathService::Get(base::DIR_SOURCE_ROOT, &path);
37 path = path.AppendASCII("mojo") 35 path = path.AppendASCII("mojo")
38 .AppendASCII("public") 36 .AppendASCII("public")
39 .AppendASCII("js") 37 .AppendASCII("js")
40 .AppendASCII(test); 38 .AppendASCII(test);
41 TestRunnerDelegate delegate; 39 TestRunnerDelegate delegate;
42 gin::RunTestFromFile(path, &delegate, run_until_idle); 40 gin::RunTestFromFile(path, &delegate, run_until_idle);
43 } 41 }
44 42
(...skipping 10 matching lines...) Expand all
55 RunTest("struct_unittests.js", true); 53 RunTest("struct_unittests.js", true);
56 } 54 }
57 55
58 TEST(JSTest, validation) { 56 TEST(JSTest, validation) {
59 RunTest("validation_unittests.js", true); 57 RunTest("validation_unittests.js", true);
60 } 58 }
61 59
62 } // namespace 60 } // namespace
63 } // namespace js 61 } // namespace js
64 } // namespace mojo 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