| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/installer/mini_installer/mini_installer.h" |
| 6 |
| 7 #include "chrome/installer/mini_installer/configuration.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace mini_installer { |
| 11 |
| 12 TEST(MiniInstallerTest, AppendCommandLineFlags) { |
| 13 static constexpr struct { |
| 14 const wchar_t* command_line; |
| 15 const wchar_t* args; |
| 16 } kData[] = { |
| 17 {L"", L"foo.exe"}, |
| 18 {L"mini_installer.exe", L"foo.exe"}, |
| 19 {L"mini_installer.exe --verbose-logging", L"foo.exe --verbose-logging"}, |
| 20 {L"C:\\Temp\\mini_installer.exe --verbose-logging", |
| 21 L"foo.exe --verbose-logging"}, |
| 22 {L"C:\\Temp\\mini_installer --verbose-logging", |
| 23 L"foo.exe --verbose-logging"}, |
| 24 {L"\"C:\\Temp\\mini_installer (1).exe\" --verbose-logging", |
| 25 L"foo.exe --verbose-logging"}, |
| 26 {L"\"mini_installer.exe\"--verbose-logging", |
| 27 L"foo.exe --verbose-logging"}, |
| 28 }; |
| 29 |
| 30 CommandString buffer; |
| 31 |
| 32 for (const auto& data : kData) { |
| 33 buffer.assign(L"foo.exe"); |
| 34 AppendCommandLineFlags(data.command_line, &buffer); |
| 35 EXPECT_STREQ(data.args, buffer.get()) << data.command_line; |
| 36 } |
| 37 } |
| 38 |
| 39 } // namespace mini_installer |
| OLD | NEW |