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

Side by Side Diff: chrome/browser/chrome_elf_init_unittest_win.cc

Issue 272213006: Switching the no-finch default behavior to enable the blacklist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correcting comment and initial beacon value in the test file, as suggested by csharp. Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_elf_init_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return blacklist_version; 47 return blacklist_version;
48 } 48 }
49 49
50 scoped_ptr<base::win::RegKey> blacklist_registry_key_; 50 scoped_ptr<base::win::RegKey> blacklist_registry_key_;
51 registry_util::RegistryOverrideManager override_manager_; 51 registry_util::RegistryOverrideManager override_manager_;
52 52
53 private: 53 private:
54 DISALLOW_COPY_AND_ASSIGN(ChromeBlacklistTrialTest); 54 DISALLOW_COPY_AND_ASSIGN(ChromeBlacklistTrialTest);
55 }; 55 };
56 56
57 57 // Ensure that the default trial sets up the blacklist beacons.
58 // Ensure that the default trial deletes any existing blacklist beacons.
59 TEST_F(ChromeBlacklistTrialTest, DefaultRun) { 58 TEST_F(ChromeBlacklistTrialTest, DefaultRun) {
Cait (Slow) 2014/05/15 18:43:19 This looks a lot like the test below it "VerifyFir
csharp 2014/05/15 20:09:39 Yup, that is probably a good idea :)
krstnmnlsn 2014/05/16 14:15:03 Done.
60 // Set some dummy values as beacons. 59 // Set some dummy values as beacons.
61 blacklist_registry_key_->WriteValue(blacklist::kBeaconState, 60 blacklist_registry_key_->WriteValue(blacklist::kBeaconState,
62 blacklist::BLACKLIST_ENABLED); 61 blacklist::BLACKLIST_DISABLED);
63 blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, L"Data"); 62 blacklist_registry_key_->WriteValue(blacklist::kBeaconVersion, L"Data");
64 63
65 // This setup code should result in the default group, which should remove 64 // This setup code should result in the default group, which should have
66 // all the beacon values. 65 // the blacklist set up.
67 InitializeChromeElf(); 66 InitializeChromeElf();
68 67
69 // Ensure that invalid values are returned to indicate that the 68 // Ensure the beacon values are now correct, indicating the
70 // beacon values are gone. 69 // blacklist beacon was setup.
71 ASSERT_EQ(blacklist::BLACKLIST_STATE_MAX, GetBlacklistState()); 70 ASSERT_EQ(blacklist::BLACKLIST_ENABLED, GetBlacklistState());
72 ASSERT_EQ(base::string16(), GetBlacklistVersion()); 71 chrome::VersionInfo version_info;
72 base::string16 version(base::UTF8ToUTF16(version_info.Version()));
73 ASSERT_EQ(version, GetBlacklistVersion());
73 } 74 }
74 75
75 TEST_F(ChromeBlacklistTrialTest, VerifyFirstRun) { 76 TEST_F(ChromeBlacklistTrialTest, VerifyFirstRun) {
76 BrowserBlacklistBeaconSetup(); 77 BrowserBlacklistBeaconSetup();
77 78
78 // Verify the state is properly set after the first run. 79 // Verify the state is properly set after the first run.
79 ASSERT_EQ(blacklist::BLACKLIST_ENABLED, GetBlacklistState()); 80 ASSERT_EQ(blacklist::BLACKLIST_ENABLED, GetBlacklistState());
80 81
81 chrome::VersionInfo version_info; 82 chrome::VersionInfo version_info;
82 base::string16 version(base::UTF8ToUTF16(version_info.Version())); 83 base::string16 version(base::UTF8ToUTF16(version_info.Version()));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 136
136 BrowserBlacklistBeaconSetup(); 137 BrowserBlacklistBeaconSetup();
137 138
138 // The beacon should now be marked as enabled for the current version. 139 // The beacon should now be marked as enabled for the current version.
139 ASSERT_EQ(blacklist::BLACKLIST_ENABLED, GetBlacklistState()); 140 ASSERT_EQ(blacklist::BLACKLIST_ENABLED, GetBlacklistState());
140 141
141 chrome::VersionInfo version_info; 142 chrome::VersionInfo version_info;
142 base::string16 expected_version(base::UTF8ToUTF16(version_info.Version())); 143 base::string16 expected_version(base::UTF8ToUTF16(version_info.Version()));
143 ASSERT_EQ(expected_version, GetBlacklistVersion()); 144 ASSERT_EQ(expected_version, GetBlacklistVersion());
144 } 145 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_elf_init_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698