summaryrefslogtreecommitdiffstats
path: root/gin
diff options
context:
space:
mode:
authorhansmuller@chromium.org <hansmuller@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 15:45:16 +0000
committerhansmuller@chromium.org <hansmuller@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 15:47:03 +0000
commit2f3a7b23b62dca9435d4e0f9274c3b0307a983b3 (patch)
tree6182db5f6b132b4d330a730e3aa9a3c838c22ccf /gin
parent480bf75ac4feca8d13bf239105f18c60900ed568 (diff)
downloadchromium_src-2f3a7b23b62dca9435d4e0f9274c3b0307a983b3.zip
chromium_src-2f3a7b23b62dca9435d4e0f9274c3b0307a983b3.tar.gz
chromium_src-2f3a7b23b62dca9435d4e0f9274c3b0307a983b3.tar.bz2
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
Diffstat (limited to 'gin')
-rw-r--r--gin/shell/gin_shell_unittest.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/gin/shell/gin_shell_unittest.cc b/gin/shell/gin_shell_unittest.cc
index 0df979d..f80d6b0 100644
--- a/gin/shell/gin_shell_unittest.cc
+++ b/gin/shell/gin_shell_unittest.cc
@@ -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);