OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // Paths match exactly. | 440 // Paths match exactly. |
441 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( | 441 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( |
442 L"\"" + expect.value() + L"\"")); | 442 L"\"" + expect.value() + L"\"")); |
443 // Paths differ by case. | 443 // Paths differ by case. |
444 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( | 444 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( |
445 L"\"" + expect_upcase.value() + L"\"")); | 445 L"\"" + expect_upcase.value() + L"\"")); |
446 | 446 |
447 // Test where strings don't match, but the same file is indicated. | 447 // Test where strings don't match, but the same file is indicated. |
448 std::wstring short_expect; | 448 std::wstring short_expect; |
449 DWORD short_len = GetShortPathName(expect.value().c_str(), | 449 DWORD short_len = GetShortPathName(expect.value().c_str(), |
450 WriteInto(&short_expect, MAX_PATH), | 450 base::WriteInto(&short_expect, MAX_PATH), |
451 MAX_PATH); | 451 MAX_PATH); |
452 ASSERT_NE(static_cast<DWORD>(0), short_len); | 452 ASSERT_NE(static_cast<DWORD>(0), short_len); |
453 ASSERT_GT(static_cast<DWORD>(MAX_PATH), short_len); | 453 ASSERT_GT(static_cast<DWORD>(MAX_PATH), short_len); |
454 short_expect.resize(short_len); | 454 short_expect.resize(short_len); |
455 ASSERT_FALSE(base::FilePath::CompareEqualIgnoreCase(expect.value(), | 455 ASSERT_FALSE(base::FilePath::CompareEqualIgnoreCase(expect.value(), |
456 short_expect)); | 456 short_expect)); |
457 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( | 457 EXPECT_TRUE(InstallUtil::ProgramCompare(expect).Evaluate( |
458 L"\"" + short_expect + L"\"")); | 458 L"\"" + short_expect + L"\"")); |
459 } | 459 } |
460 | 460 |
(...skipping 18 matching lines...) Expand all Loading... |
479 #if defined(_WIN64) | 479 #if defined(_WIN64) |
480 const int kOtherProgramFilesKey = base::DIR_PROGRAM_FILES; | 480 const int kOtherProgramFilesKey = base::DIR_PROGRAM_FILES; |
481 base::ScopedPathOverride other_program_files_override(kOtherProgramFilesKey); | 481 base::ScopedPathOverride other_program_files_override(kOtherProgramFilesKey); |
482 ASSERT_TRUE(PathService::Get(kOtherProgramFilesKey, &some_exe)); | 482 ASSERT_TRUE(PathService::Get(kOtherProgramFilesKey, &some_exe)); |
483 some_exe = some_exe.AppendASCII("Company") | 483 some_exe = some_exe.AppendASCII("Company") |
484 .AppendASCII("Product") | 484 .AppendASCII("Product") |
485 .AppendASCII("product.exe"); | 485 .AppendASCII("product.exe"); |
486 EXPECT_TRUE(InstallUtil::IsPerUserInstall(some_exe)); | 486 EXPECT_TRUE(InstallUtil::IsPerUserInstall(some_exe)); |
487 #endif // defined(_WIN64) | 487 #endif // defined(_WIN64) |
488 } | 488 } |
OLD | NEW |