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

Side by Side Diff: chrome/installer/util/installer_state_unittest.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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 unified diff | Download patch
OLDNEW
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 "chrome/installer/util/installer_state.h" 5 #include "chrome/installer/util/installer_state.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <fstream> 9 #include <fstream>
10 10
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 installer_state.target_path().Append(L"1.2.3.6"), 536 installer_state.target_path().Append(L"1.2.3.6"),
537 installer_state.target_path().AppendASCII(kOldVersion), 537 installer_state.target_path().AppendASCII(kOldVersion),
538 installer_state.target_path().AppendASCII(kOldChromeExeVersion), 538 installer_state.target_path().AppendASCII(kOldChromeExeVersion),
539 installer_state.target_path().Append(L"2.1.1.0"), 539 installer_state.target_path().Append(L"2.1.1.0"),
540 installer_state.target_path().AppendASCII(kChromeExeVersion), 540 installer_state.target_path().AppendASCII(kChromeExeVersion),
541 installer_state.target_path().AppendASCII(kNewVersion), 541 installer_state.target_path().AppendASCII(kNewVersion),
542 installer_state.target_path().Append(L"3.9.1.1"), 542 installer_state.target_path().Append(L"3.9.1.1"),
543 }; 543 };
544 544
545 // Create the version directories. 545 // Create the version directories.
546 for (int i = 0; i < arraysize(version_dirs); i++) { 546 for (size_t i = 0; i < arraysize(version_dirs); i++) {
547 base::CreateDirectory(version_dirs[i]); 547 base::CreateDirectory(version_dirs[i]);
548 EXPECT_TRUE(base::PathExists(version_dirs[i])); 548 EXPECT_TRUE(base::PathExists(version_dirs[i]));
549 } 549 }
550 550
551 // Create exes with the appropriate version resource. 551 // Create exes with the appropriate version resource.
552 // Use the current test exe as a baseline. 552 // Use the current test exe as a baseline.
553 base::FilePath exe_path; 553 base::FilePath exe_path;
554 ASSERT_TRUE(PathService::Get(base::FILE_EXE, &exe_path)); 554 ASSERT_TRUE(PathService::Get(base::FILE_EXE, &exe_path));
555 555
556 struct target_info { 556 struct target_info {
557 base::FilePath target_file; 557 base::FilePath target_file;
558 const Version& target_version; 558 const Version& target_version;
559 } targets[] = { 559 } targets[] = {
560 { installer_state.target_path().Append(installer::kChromeOldExe), 560 { installer_state.target_path().Append(installer::kChromeOldExe),
561 old_chrome_exe_version }, 561 old_chrome_exe_version },
562 { installer_state.target_path().Append(installer::kChromeExe), 562 { installer_state.target_path().Append(installer::kChromeExe),
563 chrome_exe_version }, 563 chrome_exe_version },
564 { installer_state.target_path().Append(installer::kChromeNewExe), 564 { installer_state.target_path().Append(installer::kChromeNewExe),
565 new_chrome_exe_version }, 565 new_chrome_exe_version },
566 }; 566 };
567 for (int i = 0; i < arraysize(targets); ++i) { 567 for (size_t i = 0; i < arraysize(targets); ++i) {
568 ASSERT_TRUE(upgrade_test::GenerateSpecificPEFileVersion( 568 ASSERT_TRUE(upgrade_test::GenerateSpecificPEFileVersion(
569 exe_path, targets[i].target_file, targets[i].target_version)); 569 exe_path, targets[i].target_file, targets[i].target_version));
570 } 570 }
571 571
572 // Call GetExistingExeVersions, validate that picks up the 572 // Call GetExistingExeVersions, validate that picks up the
573 // exe resources. 573 // exe resources.
574 std::set<std::string> expected_exe_versions; 574 std::set<std::string> expected_exe_versions;
575 expected_exe_versions.insert(kOldChromeExeVersion); 575 expected_exe_versions.insert(kOldChromeExeVersion);
576 expected_exe_versions.insert(kChromeExeVersion); 576 expected_exe_versions.insert(kChromeExeVersion);
577 expected_exe_versions.insert(kNewChromeExeVersion); 577 expected_exe_versions.insert(kNewChromeExeVersion);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 // Critical update newer than the new version. 827 // Critical update newer than the new version.
828 EXPECT_FALSE( 828 EXPECT_FALSE(
829 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); 829 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid());
830 EXPECT_FALSE( 830 EXPECT_FALSE(
831 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) 831 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_)
832 .IsValid()); 832 .IsValid());
833 EXPECT_FALSE( 833 EXPECT_FALSE(
834 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) 834 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_)
835 .IsValid()); 835 .IsValid());
836 } 836 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util_unittest.cc ('k') | chrome/installer/util/logging_installer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698