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

Unified Diff: chrome/installer/util/google_update_settings_unittest.cc

Issue 11826028: Add a method to read the Omaha experiment_labels value. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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
Index: chrome/installer/util/google_update_settings_unittest.cc
diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc
index 4e1fba28e01da40d4eee01de780b0ea92938fc30..a4b30afb7e7ae933e24945a8372369fe8652bfeb 100644
--- a/chrome/installer/util/google_update_settings_unittest.cc
+++ b/chrome/installer/util/google_update_settings_unittest.cc
@@ -126,29 +126,17 @@ class GoogleUpdateSettingsTest : public testing::Test {
install == SYSTEM_INSTALL, kTestExperimentLabel));
// Validate that something is written. Only worry about the label itself.
- RegKey key;
std::wstring value;
- HKEY root = install == SYSTEM_INSTALL ?
- HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
- string16 state_key = install == SYSTEM_INSTALL ?
- chrome->GetStateMediumKey() : chrome->GetStateKey();
-
- EXPECT_EQ(ERROR_SUCCESS,
- key.Open(root, state_key.c_str(), KEY_QUERY_VALUE));
- EXPECT_EQ(ERROR_SUCCESS,
- key.ReadValue(google_update::kExperimentLabels, &value));
+ EXPECT_TRUE(GoogleUpdateSettings::ReadExperimentLabels(
grt (UTC plus 2) 2013/01/09 18:49:51 this tests that Set/Read round-trips properly, but
SteveT 2013/01/09 19:36:10 Makes sense, assuming we trust the validation code
+ install == SYSTEM_INSTALL, &value));
EXPECT_EQ(kTestExperimentLabel, value);
- key.Close();
// Now that the label is set, test the delete functionality. An empty label
// should result in deleting the value.
EXPECT_TRUE(GoogleUpdateSettings::SetExperimentLabels(
install == SYSTEM_INSTALL, string16()));
- EXPECT_EQ(ERROR_SUCCESS,
- key.Open(root, state_key.c_str(), KEY_QUERY_VALUE));
- EXPECT_EQ(ERROR_FILE_NOT_FOUND,
- key.ReadValue(google_update::kExperimentLabels, &value));
- key.Close();
+ EXPECT_FALSE(GoogleUpdateSettings::ReadExperimentLabels(
+ install == SYSTEM_INSTALL, &value));
#else
EXPECT_FALSE(chrome->ShouldSetExperimentLabels());
grt (UTC plus 2) 2013/01/09 18:49:51 add an expectation that ReadExperimentLables retur
SteveT 2013/01/09 19:36:10 Done.
#endif // GOOGLE_CHROME_BUILD

Powered by Google App Engine
This is Rietveld 408576698