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

Side by Side Diff: gin/test/run_js_tests.cc

Issue 419673004: gin test - add simple file access for JS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null return tests for no-args and non-existant paths Created 6 years, 4 months 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 | Annotate | Revision Log
« gin/test/file.cc ('K') | « gin/test/file_unittests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/file_runner.h" 7 #include "gin/test/file_runner.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace gin { 10 namespace gin {
11 namespace { 11 namespace {
12 12
13 base::FilePath BasePath() { 13 base::FilePath BasePath() {
14 base::FilePath path; 14 base::FilePath path;
15 PathService::Get(base::DIR_SOURCE_ROOT, &path); 15 PathService::Get(base::DIR_SOURCE_ROOT, &path);
16 return path.AppendASCII("gin"); 16 return path.AppendASCII("gin");
17 } 17 }
18 18
19 void RunTest(const base::FilePath& path) { 19 void RunTest(const base::FilePath& path) {
20 FileRunnerDelegate delegate; 20 FileRunnerDelegate delegate;
21 RunTestFromFile(path, &delegate); 21 RunTestFromFile(path, &delegate);
22 } 22 }
23 23
24 TEST(JSTest, File) {
25 RunTest(BasePath()
26 .AppendASCII("test")
27 .AppendASCII("file_unittests.js"));
28 }
29
24 TEST(JSTest, GTest) { 30 TEST(JSTest, GTest) {
25 RunTest(BasePath() 31 RunTest(BasePath()
26 .AppendASCII("test") 32 .AppendASCII("test")
27 .AppendASCII("gtest_unittests.js")); 33 .AppendASCII("gtest_unittests.js"));
28 } 34 }
29 35
30 TEST(JSTest, ModuleRegistry) { 36 TEST(JSTest, ModuleRegistry) {
31 RunTest(BasePath() 37 RunTest(BasePath()
32 .AppendASCII("modules") 38 .AppendASCII("modules")
33 .AppendASCII("module_registry_unittests.js")); 39 .AppendASCII("module_registry_unittests.js"));
34 } 40 }
35 41
36 } // namespace 42 } // namespace
37 } // gin 43 } // gin
OLDNEW
« gin/test/file.cc ('K') | « gin/test/file_unittests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698