Verify that gin_shell and hello_world.js exist.
This issue: https://code.google.com/p/chromium/issues/detail?id=398549, was difficult to debug because gin/shell/gin_shell_unittest.cc didn't verify that its input files existed before forging ahead. The unit test now verifies that the gin_shell and hello_world.js paths exist before launching the former and loading the latter. BUG=398549 Review URL: https://codereview.chromium.org/471623002 Cr-Commit-Position: refs/heads/master@{#289599} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289599 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -25,8 +25,13 @@ base::FilePath HelloWorldPath() {
|
||||
}
|
||||
|
||||
TEST(GinShellTest, HelloWorld) {
|
||||
CommandLine cmd(GinShellPath());
|
||||
cmd.AppendArgPath(HelloWorldPath());
|
||||
base::FilePath gin_shell_path(GinShellPath());
|
||||
base::FilePath hello_world_path(HelloWorldPath());
|
||||
ASSERT_TRUE(base::PathExists(gin_shell_path));
|
||||
ASSERT_TRUE(base::PathExists(hello_world_path));
|
||||
|
||||
CommandLine cmd(gin_shell_path);
|
||||
cmd.AppendArgPath(hello_world_path);
|
||||
std::string output;
|
||||
ASSERT_TRUE(base::GetAppOutput(cmd, &output));
|
||||
base::TrimWhitespaceASCII(output, base::TRIM_ALL, &output);
|
||||
|
Reference in New Issue
Block a user