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

Unified Diff: blimp/engine/app/blimp_engine_config.cc

Issue 1929723002: [Blimp] Adds blimp engine browser test framework and LoadUrl test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: blimp/engine/app/blimp_engine_config.cc
diff --git a/blimp/engine/app/blimp_engine_config.cc b/blimp/engine/app/blimp_engine_config.cc
index ccbdc4e52ffbd9a6d007b50382dc0945f2a10f53..cfa55eb0637fbad3a6df0f5e4b6ce22d585768ee 100644
--- a/blimp/engine/app/blimp_engine_config.cc
+++ b/blimp/engine/app/blimp_engine_config.cc
@@ -18,16 +18,22 @@ namespace blimp {
namespace engine {
namespace {
-// Gets the client token from the file provided by the command line. If a read
+// Gets the client token from the command line. Either from the token provided,
+// or from the file provided by the command line. If a file read
// does not succeed, or the switch is malformed, an empty string is returned.
std::string GetClientToken(const base::CommandLine& cmd_line) {
- std::string file_contents;
- const base::FilePath path = cmd_line.GetSwitchValuePath(kClientTokenPath);
- if (!base::ReadFileToString(path, &file_contents)) {
- LOG(ERROR) << "Could not read client token file at "
- << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe());
+ std::string token;
+ if (cmd_line.HasSwitch(kClientToken)) {
+ token = cmd_line.GetSwitchValueASCII(kClientToken);
+ } else {
+ DCHECK(cmd_line.HasSwitch(kClientTokenPath));
+ const base::FilePath path = cmd_line.GetSwitchValuePath(kClientTokenPath);
+ if (!base::ReadFileToString(path, &token)) {
+ LOG(ERROR) << "Could not read client token file at "
+ << (path.empty() ? "(not provided)" : path.AsUTF8Unsafe());
+ }
}
- return base::CollapseWhitespaceASCII(file_contents, true);
+ return base::CollapseWhitespaceASCII(token, true);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698