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

Side by Side Diff: gin/shell/gin_shell_unittest.cc

Issue 1507663003: Isolate gin_unittests and add them to bots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years 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 | « gin/gin_unittests.isolate ('k') | testing/buildbot/chromium.linux.json » ('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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/process/launch.h" 8 #include "base/process/launch.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 base::FilePath GinShellPath() { 12 base::FilePath GinShellPath() {
13 base::FilePath dir; 13 base::FilePath dir;
14 PathService::Get(base::DIR_EXE, &dir); 14 PathService::Get(base::DIR_EXE, &dir);
15 #if defined(OS_WIN)
16 return dir.AppendASCII("gin_shell.exe");
17 #else
15 return dir.AppendASCII("gin_shell"); 18 return dir.AppendASCII("gin_shell");
19 #endif
16 } 20 }
17 21
18 base::FilePath HelloWorldPath() { 22 base::FilePath HelloWorldPath() {
19 base::FilePath path; 23 base::FilePath path;
20 PathService::Get(base::DIR_SOURCE_ROOT, &path); 24 PathService::Get(base::DIR_SOURCE_ROOT, &path);
21 return path 25 return path
22 .AppendASCII("gin") 26 .AppendASCII("gin")
23 .AppendASCII("shell") 27 .AppendASCII("shell")
24 .AppendASCII("hello_world.js"); 28 .AppendASCII("hello_world.js");
25 } 29 }
26 30
27 TEST(GinShellTest, HelloWorld) { 31 TEST(GinShellTest, HelloWorld) {
28 base::FilePath gin_shell_path(GinShellPath()); 32 base::FilePath gin_shell_path(GinShellPath());
29 base::FilePath hello_world_path(HelloWorldPath()); 33 base::FilePath hello_world_path(HelloWorldPath());
30 ASSERT_TRUE(base::PathExists(gin_shell_path)); 34 ASSERT_TRUE(base::PathExists(gin_shell_path));
31 ASSERT_TRUE(base::PathExists(hello_world_path)); 35 ASSERT_TRUE(base::PathExists(hello_world_path));
32 36
33 base::CommandLine cmd(gin_shell_path); 37 base::CommandLine cmd(gin_shell_path);
34 cmd.AppendArgPath(hello_world_path); 38 cmd.AppendArgPath(hello_world_path);
35 std::string output; 39 std::string output;
36 ASSERT_TRUE(base::GetAppOutput(cmd, &output)); 40 ASSERT_TRUE(base::GetAppOutput(cmd, &output));
37 base::TrimWhitespaceASCII(output, base::TRIM_ALL, &output); 41 base::TrimWhitespaceASCII(output, base::TRIM_ALL, &output);
38 ASSERT_EQ("Hello World", output); 42 ASSERT_EQ("Hello World", output);
39 } 43 }
OLDNEW
« no previous file with comments | « gin/gin_unittests.isolate ('k') | testing/buildbot/chromium.linux.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698