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

Unified Diff: chrome/installer/mini_installer/mini_installer_unittest.cc

Issue 2655473002: Handle spaces in the name of the mini_installer. (Closed)
Patch Set: better comments Created 3 years, 11 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
« no previous file with comments | « chrome/installer/mini_installer/mini_installer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/mini_installer_unittest.cc
diff --git a/chrome/installer/mini_installer/mini_installer_unittest.cc b/chrome/installer/mini_installer/mini_installer_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e0b355bc285af4ef20272845fdd356b59c6919b6
--- /dev/null
+++ b/chrome/installer/mini_installer/mini_installer_unittest.cc
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/installer/mini_installer/mini_installer.h"
+
+#include "chrome/installer/mini_installer/configuration.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mini_installer {
+
+TEST(MiniInstallerTest, AppendCommandLineFlags) {
+ static constexpr struct {
+ const wchar_t* command_line;
+ const wchar_t* args;
+ } kData[] = {
+ {L"", L"foo.exe"},
+ {L"mini_installer.exe", L"foo.exe"},
+ {L"mini_installer.exe --verbose-logging", L"foo.exe --verbose-logging"},
+ {L"C:\\Temp\\mini_installer.exe --verbose-logging",
+ L"foo.exe --verbose-logging"},
+ {L"C:\\Temp\\mini_installer --verbose-logging",
+ L"foo.exe --verbose-logging"},
+ {L"\"C:\\Temp\\mini_installer (1).exe\" --verbose-logging",
+ L"foo.exe --verbose-logging"},
+ {L"\"mini_installer.exe\"--verbose-logging",
+ L"foo.exe --verbose-logging"},
+ };
+
+ CommandString buffer;
+
+ for (const auto& data : kData) {
+ buffer.assign(L"foo.exe");
+ AppendCommandLineFlags(data.command_line, &buffer);
+ EXPECT_STREQ(data.args, buffer.get()) << data.command_line;
+ }
+}
+
+} // namespace mini_installer
« no previous file with comments | « chrome/installer/mini_installer/mini_installer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698