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

Unified Diff: chrome/installer/mini_installer/configuration_test.cc

Issue 1247993002: Return Windows error code when create-process fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: untabify and rebase Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mini_installer/configuration.cc ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/configuration_test.cc
diff --git a/chrome/installer/mini_installer/configuration_test.cc b/chrome/installer/mini_installer/configuration_test.cc
index 27a3d80fc02191fce6feaeb9cb427a982bdfb7c3..f2c8e3dcbf24acc7fbba4d25b22e8f63b6abe3ce 100644
--- a/chrome/installer/mini_installer/configuration_test.cc
+++ b/chrome/installer/mini_installer/configuration_test.cc
@@ -14,14 +14,39 @@ using mini_installer::Configuration;
class TestConfiguration : public Configuration {
public:
- explicit TestConfiguration(const wchar_t* command_line) : Configuration() {
+ explicit TestConfiguration(const wchar_t* command_line)
+ : Configuration(),
+ open_registry_key_result_(false),
+ read_registry_value_result_(0),
+ read_registry_value_(L"") {
Initialize(command_line);
}
+ explicit TestConfiguration(const wchar_t* command_line,
+ LONG ret, const wchar_t* value)
+ : Configuration(),
+ open_registry_key_result_(true),
+ read_registry_value_result_(ret),
+ read_registry_value_(value) {
+ Initialize(command_line);
+ }
+ void SetRegistryResults(bool openkey, LONG ret, const wchar_t* value) {
+ }
private:
+ bool open_registry_key_result_;
+ LONG read_registry_value_result_;
+ const wchar_t* read_registry_value_ = L"";
+
void Initialize(const wchar_t* command_line) {
Clear();
ASSERT_TRUE(ParseCommandLine(command_line));
}
+ bool ReadClientStateRegistryValue(
+ const HKEY root_key, const wchar_t* app_guid,
+ LONG* retval, ValueString& value) override {
+ *retval = read_registry_value_result_;
+ value.assign(read_registry_value_);
+ return open_registry_key_result_;
+ }
};
// Test that the operation type is CLEANUP iff --cleanup is on the cmdline.
@@ -72,13 +97,29 @@ TEST(MiniInstallerConfigurationTest, ChromeAppGuid) {
TestConfiguration(L"spam.exe").chrome_app_guid());
EXPECT_TRUE(std::wstring(google_update::kAppGuid) ==
TestConfiguration(L"spam.exe --chrome").chrome_app_guid());
- EXPECT_TRUE(std::wstring(google_update::kAppGuid) ==
- TestConfiguration(L"spam.exe --multi-install --chrome")
- .chrome_app_guid());
- EXPECT_TRUE(std::wstring(google_update::kAppGuid) ==
+ EXPECT_TRUE(std::wstring(google_update::kChromeFrameAppGuid) ==
TestConfiguration(L"spam.exe --chrome-frame").chrome_app_guid());
EXPECT_TRUE(std::wstring(google_update::kSxSAppGuid) ==
TestConfiguration(L"spam.exe --chrome-sxs").chrome_app_guid());
+ EXPECT_TRUE(std::wstring(google_update::kMultiInstallAppGuid) ==
+ TestConfiguration(L"spam.exe --multi-install --chrome")
+ .chrome_app_guid());
+ EXPECT_TRUE(std::wstring(google_update::kMultiInstallAppGuid) ==
+ TestConfiguration(L"spam.exe --multi-install --chrome",
+ ERROR_INVALID_FUNCTION, L"")
+ .chrome_app_guid());
+ EXPECT_TRUE(std::wstring(google_update::kAppGuid) ==
+ TestConfiguration(L"spam.exe --multi-install --chrome",
+ ERROR_FILE_NOT_FOUND, L"")
+ .chrome_app_guid());
+ EXPECT_TRUE(std::wstring(google_update::kAppGuid) ==
+ TestConfiguration(L"spam.exe --multi-install --chrome",
+ ERROR_SUCCESS, L"foo-bar")
+ .chrome_app_guid());
+ EXPECT_TRUE(std::wstring(google_update::kMultiInstallAppGuid) ==
+ TestConfiguration(L"spam.exe --multi-install --chrome",
+ ERROR_SUCCESS, L"foo-multi")
+ .chrome_app_guid());
}
TEST(MiniInstallerConfigurationTest, HasChrome) {
« no previous file with comments | « chrome/installer/mini_installer/configuration.cc ('k') | chrome/installer/mini_installer/mini_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698