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

Unified Diff: blimp/common/fake_commandline.h

Issue 1958033003: Allows client to access auth token from command line specified file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/common/fake_commandline.h
diff --git a/blimp/common/fake_commandline.h b/blimp/common/fake_commandline.h
new file mode 100644
index 0000000000000000000000000000000000000000..3d436587966b3f136e9a919cd6bacd4065c49606
--- /dev/null
+++ b/blimp/common/fake_commandline.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
Kevin M 2016/05/10 18:06:35 We should use the token testdata file, so this hel
CJ 2016/05/10 20:58:06 So, I should make the server test look more like t
Kevin M 2016/05/11 00:39:56 Yeah.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_COMMON_FAKE_COMMANDLINE_H_
+#define BLIMP_COMMON_FAKE_COMMANDLINE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/command_line.h"
+#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
+#include "blimp/engine/app/switches.h"
+
+namespace blimp {
+
+// Creates a file in the temp directory for a given filepath switch.
+void CreateFileForSwitch(const std::string& filepath_switch,
Kevin M 2016/05/10 18:06:34 We don't need to create a tmpfile (or have any sup
+ const std::string& data);
+
+// Removes the associated file for a given filepath switch.
+void RemoveFileForSwitch(const std::string& filepath_switch);
+
+// Creates and returns a CommandLine object with specified filepath switches.
+base::CommandLine CreateCommandLine(
Kevin M 2016/05/10 18:06:35 This isn't necessary; look at the existing unit te
+ const std::vector<std::string>& filepath_switches);
+
+base::FilePath GetFilepathForSwitch(const std::string& filepath_switch);
+
+const std::vector<std::string> all_filepath_switches_ =
Kevin M 2016/05/10 18:06:35 1. Non-POD (Plain Old Data) constants are disallow
+{engine::kClientTokenPath};
Kevin M 2016/05/10 18:06:34 Brace initialization, while cool, isn't allowed ye
+
+base::ScopedTempDir temp_dir_;
+} // namespace blimp
+
+#endif // BLIMP_COMMON_FAKE_COMMANDLINE_H_

Powered by Google App Engine
This is Rietveld 408576698