OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/installer/util/util_constants.h" | 11 #include "chrome/installer/util/util_constants.h" |
12 #include "chrome/test/mini_installer_test/mini_installer_test_constants.h" | 12 #include "chrome/test/mini_installer_test/mini_installer_test_constants.h" |
13 #include "chrome_mini_installer.h" | 13 #include "chrome_mini_installer.h" |
14 | 14 |
15 void BackUpProfile(bool chrome_frame) { | 15 void BackUpProfile(bool chrome_frame) { |
16 if (base::GetProcessCount(L"chrome.exe", NULL) > 0) { | 16 if (base::GetProcessCount(L"chrome.exe", NULL) > 0) { |
17 printf("Chrome is currently running and cannot backup the profile." | 17 printf("Chrome is currently running and cannot backup the profile." |
18 "Please close Chrome and run the tests again.\n"); | 18 "Please close Chrome and run the tests again.\n"); |
19 exit(1); | 19 exit(1); |
20 } | 20 } |
21 ChromeMiniInstaller installer(mini_installer_constants::kUserInstall, | 21 ChromeMiniInstaller installer(false, |
kkania
2011/09/26 20:00:53
single line
Huyen
2011/09/27 23:00:24
Done.
| |
22 chrome_frame); | 22 chrome_frame); |
23 FilePath path = | 23 FilePath path; |
24 FilePath::FromWStringHack(installer.GetChromeInstallDirectoryLocation()); | 24 installer.GetChromeInstallDirectoryLocation(&path); |
25 path = path.Append(mini_installer_constants::kChromeAppDir).DirName(); | 25 path = path.Append(mini_installer_constants::kChromeAppDir).DirName(); |
26 FilePath backup_path = path; | 26 FilePath backup_path = path; |
27 // Will hold User Data path that needs to be backed-up. | 27 // Will hold User Data path that needs to be backed-up. |
28 path = path.Append(mini_installer_constants::kChromeUserDataDir); | 28 path = path.Append(mini_installer_constants::kChromeUserDataDir); |
29 // Will hold new backup path to save the profile. | 29 // Will hold new backup path to save the profile. |
30 backup_path = backup_path.Append( | 30 backup_path = backup_path.Append( |
31 mini_installer_constants::kChromeUserDataBackupDir); | 31 mini_installer_constants::kChromeUserDataBackupDir); |
32 // Will check if User Data profile is available. | 32 // Will check if User Data profile is available. |
33 if (file_util::PathExists(path)) { | 33 if (file_util::PathExists(path)) { |
34 // Will check if User Data is already backed up. | 34 // Will check if User Data is already backed up. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 installer::switches::kChromeFrame)); | 68 installer::switches::kChromeFrame)); |
69 } | 69 } |
70 | 70 |
71 if (base::win::GetVersion() < base::win::VERSION_VISTA || | 71 if (base::win::GetVersion() < base::win::VERSION_VISTA || |
72 command_line.HasSwitch(switches::kInstallerTestForce)) { | 72 command_line.HasSwitch(switches::kInstallerTestForce)) { |
73 return test_suite.Run(); | 73 return test_suite.Run(); |
74 } | 74 } |
75 printf("These tests don't run on this platform.\n"); | 75 printf("These tests don't run on this platform.\n"); |
76 return 0; | 76 return 0; |
77 } | 77 } |
OLD | NEW |