OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chrome_elf_init_win.h" | 5 #include "chrome/browser/chrome_elf_init_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 new metrics::SHA1EntropyProvider("test")); | 163 new metrics::SHA1EntropyProvider("test")); |
164 | 164 |
165 scoped_refptr<base::FieldTrial> trial(base::FieldTrialList::CreateFieldTrial( | 165 scoped_refptr<base::FieldTrial> trial(base::FieldTrialList::CreateFieldTrial( |
166 kBrowserBlacklistTrialName, kBrowserBlacklistTrialEnabledGroupName)); | 166 kBrowserBlacklistTrialName, kBrowserBlacklistTrialEnabledGroupName)); |
167 | 167 |
168 // Set up the trial with the desired parameters. | 168 // Set up the trial with the desired parameters. |
169 std::map<std::string, std::string> desired_params; | 169 std::map<std::string, std::string> desired_params; |
170 desired_params["TestDllName1"] = "TestDll1.dll"; | 170 desired_params["TestDllName1"] = "TestDll1.dll"; |
171 desired_params["TestDllName2"] = "TestDll2.dll"; | 171 desired_params["TestDllName2"] = "TestDll2.dll"; |
172 | 172 |
173 chrome_variations::AssociateVariationParams( | 173 variations::AssociateVariationParams( |
174 kBrowserBlacklistTrialName, | 174 kBrowserBlacklistTrialName, |
175 kBrowserBlacklistTrialEnabledGroupName, | 175 kBrowserBlacklistTrialEnabledGroupName, |
176 desired_params); | 176 desired_params); |
177 | 177 |
178 // This should add the dlls in those parameters to the registry. | 178 // This should add the dlls in those parameters to the registry. |
179 AddFinchBlacklistToRegistry(); | 179 AddFinchBlacklistToRegistry(); |
180 | 180 |
181 // Check that all the values in desired_params were added to the registry. | 181 // Check that all the values in desired_params were added to the registry. |
182 base::win::RegKey finch_blacklist_registry_key( | 182 base::win::RegKey finch_blacklist_registry_key( |
183 HKEY_CURRENT_USER, | 183 HKEY_CURRENT_USER, |
184 blacklist::kRegistryFinchListPath, | 184 blacklist::kRegistryFinchListPath, |
185 KEY_QUERY_VALUE | KEY_SET_VALUE); | 185 KEY_QUERY_VALUE | KEY_SET_VALUE); |
186 | 186 |
187 ASSERT_EQ(desired_params.size(), | 187 ASSERT_EQ(desired_params.size(), |
188 finch_blacklist_registry_key.GetValueCount()); | 188 finch_blacklist_registry_key.GetValueCount()); |
189 | 189 |
190 for (std::map<std::string, std::string>::iterator it = desired_params.begin(); | 190 for (std::map<std::string, std::string>::iterator it = desired_params.begin(); |
191 it != desired_params.end(); | 191 it != desired_params.end(); |
192 ++it) { | 192 ++it) { |
193 std::wstring name = base::UTF8ToWide(it->first); | 193 std::wstring name = base::UTF8ToWide(it->first); |
194 ASSERT_TRUE(finch_blacklist_registry_key.HasValue(name.c_str())); | 194 ASSERT_TRUE(finch_blacklist_registry_key.HasValue(name.c_str())); |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 } // namespace | 198 } // namespace |
OLD | NEW |