| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file declares utility functions for mini installer tests. | 5 // This file declares utility functions for mini installer tests. |
| 6 // The reason for putting these functions in different class is to separate out | 6 // The reason for putting these functions in different class is to separate out |
| 7 // the critical logic from utility methods. | 7 // the critical logic from utility methods. |
| 8 | 8 |
| 9 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ | 9 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ |
| 10 #define CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ | 10 #define CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // the build is stable/dev/beta. | 53 // the build is stable/dev/beta. |
| 54 static bool GetInstaller(const wchar_t* pattern, std::wstring *name, | 54 static bool GetInstaller(const wchar_t* pattern, std::wstring *name, |
| 55 const wchar_t* channel_type); | 55 const wchar_t* channel_type); |
| 56 | 56 |
| 57 // This method will create a command line to run apply tag. | 57 // This method will create a command line to run apply tag. |
| 58 static bool GetCommandForTagging(std::wstring *return_command); | 58 static bool GetCommandForTagging(std::wstring *return_command); |
| 59 | 59 |
| 60 // Returns the directory containing exe_name. | 60 // Returns the directory containing exe_name. |
| 61 static std::wstring GetFilePath(const wchar_t* exe_name); | 61 static std::wstring GetFilePath(const wchar_t* exe_name); |
| 62 | 62 |
| 63 |
| 63 // This method will get the list of all folders or files based on the passed | 64 // This method will get the list of all folders or files based on the passed |
| 64 // 'path' and 'pattern' argument. The 'pattern' argument decides if the | 65 // 'path' and 'pattern' argument. The 'pattern' argument decides if the |
| 65 // requested file is a full or a differential installer. | 66 // requested file is a full or a differential installer. |
| 66 static bool GetLatestFile(const wchar_t* path, const wchar_t* pattern, | 67 static bool GetLatestFile(const wchar_t* path, const wchar_t* pattern, |
| 67 FileInfoList *file_name); | 68 FileInfoList *file_name); |
| 68 | 69 |
| 69 // This method will get the previous build number | 70 // This method retrieves the previous build version for the given diff |
| 70 static void GetPreviousBuildNumber(const std::wstring& path, | 71 // installer path. |
| 71 std::wstring *build_number, const wchar_t* channel_type); | 72 static bool GetPreviousBuildNumber(const std::wstring& path, |
| 73 std::wstring *build_number); |
| 72 | 74 |
| 73 // This method will get the previous full installer based on 'diff_file' | 75 // This method will get the previous full installer based on 'diff_file' |
| 74 // and 'channel_type' arguments. The 'channel_type' | 76 // and 'channel_type' arguments. The 'channel_type' |
| 75 // parameter decides if the build is stable/dev/beta. The 'diff_file' | 77 // parameter decides if the build is stable/dev/beta. The 'diff_file' |
| 76 // parameter will hold the latest diff installer name. | 78 // parameter will hold the latest diff installer name. |
| 77 static bool GetPreviousFullInstaller(const std::wstring& diff_file, | 79 static bool GetPreviousFullInstaller(const std::wstring& diff_file, |
| 78 std::wstring *previous, const wchar_t* channel_type); | 80 std::wstring *previous); |
| 79 | 81 |
| 80 // This method will return standalone installer file name. | 82 // This method will return standalone installer file name. |
| 81 static bool GetStandaloneInstallerFileName(FileInfoList *file_name); | 83 static bool GetStandaloneInstallerFileName(FileInfoList *file_name); |
| 82 | 84 |
| 83 // This method will get the version number from the filename. | 85 // This method will get the version number from the filename. |
| 84 static bool GetStandaloneVersion(std::wstring* version); | 86 static bool GetStandaloneVersion(std::wstring* version); |
| 85 | 87 |
| 86 // This method will send enter key to window in the foreground. | 88 // This method will send enter key to window in the foreground. |
| 87 static void SendEnterKeyToWindow(); | 89 static void SendEnterKeyToWindow(); |
| 88 | 90 |
| 89 // Verifies if the given process starts running. | 91 // Verifies if the given process starts running. |
| 90 static void VerifyProcessLaunch(const wchar_t* process_name, | 92 static void VerifyProcessLaunch(const wchar_t* process_name, |
| 91 bool expected_status); | 93 bool expected_status); |
| 92 | 94 |
| 93 // Verifies if the given process stops running. | 95 // Verifies if the given process stops running. |
| 94 static bool VerifyProcessClose(const wchar_t* process_name); | 96 static bool VerifyProcessClose(const wchar_t* process_name); |
| 95 | 97 |
| 96 private: | 98 private: |
| 97 DISALLOW_EVIL_CONSTRUCTORS(MiniInstallerTestUtil); | 99 DISALLOW_EVIL_CONSTRUCTORS(MiniInstallerTestUtil); |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 #endif // CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ | 102 #endif // CHROME_TEST_MINI_INSTALLER_TEST_MINI_INSTALLER_TEST_UTIL_H_ |
| OLD | NEW |