diff options
author | anantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-07 18:38:55 +0000 |
---|---|---|
committer | anantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-07 18:38:55 +0000 |
commit | 37a4d3c48ce25dbac523034d257135f207ed01ec (patch) | |
tree | c447273c9dc0fbdaa3ad18a0f68e498f732b2407 /chrome/test/mini_installer_test | |
parent | f4f9d466737649dca33a7f4b6d9c24f9ce6e8671 (diff) | |
download | chromium_src-37a4d3c48ce25dbac523034d257135f207ed01ec.zip chromium_src-37a4d3c48ce25dbac523034d257135f207ed01ec.tar.gz chromium_src-37a4d3c48ce25dbac523034d257135f207ed01ec.tar.bz2 |
Modified constant names from Chrome to Google Chrome. Added logic to close feedback window, on uninstall. The tests are still disabled. Nicolas is going to investigate why they work fine locally and fail on buildbots.
Review URL: http://codereview.chromium.org/5610
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test')
4 files changed, 16 insertions, 19 deletions
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 635ab78..56712d6 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -86,6 +86,7 @@ void ChromeMiniInstaller::OverInstall() { // Waits until setup.exe ends. // Checks if registry key exist even after uninstall. // Deletes App dir. +// Closes feedback form. void ChromeMiniInstaller::UnInstall() { printf("Verifying if Chrome is installed...\n"); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); @@ -95,7 +96,7 @@ void ChromeMiniInstaller::UnInstall() { } printf("\nClosing Chrome processes, if any...\n"); - CloseChromeProcesses(); + CloseProcesses(installer_util::kChromeExe); std::wstring uninstall_path = GetUninstallPath(); ASSERT_TRUE(file_util::PathExists(uninstall_path)); @@ -111,11 +112,9 @@ void ChromeMiniInstaller::UnInstall() { ASSERT_FALSE(CheckRegistryKey(dist->GetVersionKey())); DeleteAppFolder(); FindChromeShortcut(); - if (false == CloseWindow(mini_installer_constants::kChromeUninstallIETitle, - WM_CLOSE)) { - printf("\nFailed to close window \"%s\".", - mini_installer_constants::kChromeUninstallIETitle); - } + CloseProcesses(mini_installer_constants::kIEExecutable); + ASSERT_EQ(0, process_util::GetProcessCount( + mini_installer_constants::kIEExecutable, NULL)); } // Takes care of Chrome uninstall dialog. @@ -141,16 +140,16 @@ void ChromeMiniInstaller::CloseChromeBrowser(LPCWSTR window_name) { ASSERT_TRUE(CloseWindow(window_name, WM_CLOSE)); } -// Checks for all running Chrome processes and kills them. -void ChromeMiniInstaller::CloseChromeProcesses() { +// Checks for all requested running processes and kills them. +void ChromeMiniInstaller::CloseProcesses(const std::wstring& executable_name) { int timer = 0; - while ((process_util::GetProcessCount(installer_util::kChromeExe, NULL) > 0) && + while ((process_util::GetProcessCount(executable_name, NULL) > 0) && (timer < 20000)) { - process_util::KillProcesses(installer_util::kChromeExe, 1, NULL); + process_util::KillProcesses(executable_name, 1, NULL); Sleep(200); timer = timer + 200; } - ASSERT_EQ(0, process_util::GetProcessCount(installer_util::kChromeExe, NULL)); + ASSERT_EQ(0, process_util::GetProcessCount(executable_name, NULL)); } // Checks for Chrome registry keys. diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.h b/chrome/test/mini_installer_test/chrome_mini_installer.h index 796716c..d740942 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.h +++ b/chrome/test/mini_installer_test/chrome_mini_installer.h @@ -43,8 +43,8 @@ class ChromeMiniInstaller { // Closes Chrome browser. void CloseChromeBrowser(LPCWSTR window_name); - // Closes all running Chrome processes. - void CloseChromeProcesses(); + // Closes specified process. + void CloseProcesses(const std::wstring& executable_name); // Checks for registry key. bool CheckRegistryKey(std::wstring key_path); diff --git a/chrome/test/mini_installer_test/mini_installer_test_constants.cc b/chrome/test/mini_installer_test/mini_installer_test_constants.cc index abdd6ae..5faba60 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_constants.cc +++ b/chrome/test/mini_installer_test/mini_installer_test_constants.cc @@ -8,6 +8,7 @@ namespace mini_installer_constants { const wchar_t kAppDir[] = L"Google\\Chrome\\Application\\"; const wchar_t kChromeSetupExecutable[] = L"setup.exe"; +const wchar_t kIEExecutable[] = L"iexplore.exe"; const wchar_t kChromeMiniInstallerExecutable[] = L"mini_installer.exe"; const wchar_t kChromeInstallerType[] = L"dev"; @@ -15,13 +16,10 @@ const wchar_t kBrowserAppName[] = L"Google - Google Chrome"; const wchar_t kBrowserTabName[] = L"New Tab - Google Chrome"; const wchar_t kConfirmDialog[] = L"Google Chrome"; const wchar_t kInstallerWindow[] = L"Google App Installer"; -const wchar_t kFirstChromeUI[] = L"Welcome to Chrome"; - -const wchar_t kChromeUninstallIETitle[] = - L"Google Chrome - Windows Internet Explorer"; +const wchar_t kFirstChromeUI[] = L"Welcome to Google Chrome"; // Chrome meta installer location. const wchar_t kChromeSetupDevExeLocation[] = - L"\\\\172.23.44.61\\shared\\chrome_autotest\\DevTest\\ChromeSetup_en.exe"; + L"\\\\172.23.44.61\\shared\\chrome_autotest\\DevTest\\ChromeSetup.exe"; } diff --git a/chrome/test/mini_installer_test/mini_installer_test_constants.h b/chrome/test/mini_installer_test/mini_installer_test_constants.h index 4578498..9fc7f89 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_constants.h +++ b/chrome/test/mini_installer_test/mini_installer_test_constants.h @@ -11,6 +11,7 @@ namespace mini_installer_constants { extern const wchar_t kAppDir[]; extern const wchar_t kChromeSetupExecutable[]; +extern const wchar_t kIEExecutable[]; extern const wchar_t kChromeMiniInstallerExecutable[]; extern const wchar_t kChromeInstallerType[]; @@ -20,7 +21,6 @@ extern const wchar_t kBrowserTabName[]; extern const wchar_t kConfirmDialog[]; extern const wchar_t kInstallerWindow[]; extern const wchar_t kFirstChromeUI[]; -extern const wchar_t kChromeUninstallIETitle[]; // Chrome meta installer location. extern const wchar_t kChromeSetupDevExeLocation[]; |