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

Side by Side Diff: chrome/browser/rlz/rlz_unittest.cc

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/rlz/rlz.h" 5 #include "chrome/browser/rlz/rlz.h"
6 6
7 #include "base/registry.h"
8 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/win/registry.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using base::win::RegKey;
12
11 namespace { 13 namespace {
14
12 // Gets rid of registry leftovers from testing. Returns false if there 15 // Gets rid of registry leftovers from testing. Returns false if there
13 // is nothing to clean. 16 // is nothing to clean.
14 bool CleanValue(const wchar_t* key_name, const wchar_t* value) { 17 bool CleanValue(const wchar_t* key_name, const wchar_t* value) {
15 RegKey key; 18 RegKey key;
16 if (!key.Open(HKEY_CURRENT_USER, key_name, KEY_READ | KEY_WRITE)) 19 if (!key.Open(HKEY_CURRENT_USER, key_name, KEY_READ | KEY_WRITE))
17 return false; 20 return false;
18 EXPECT_TRUE(key.DeleteValue(value)); 21 EXPECT_TRUE(key.DeleteValue(value));
19 return true; 22 return true;
20 } 23 }
21 24
(...skipping 30 matching lines...) Expand all
52 rlz_lib::CHROME_OMNIBOX, rlz_lib::FIRST_SEARCH)); 55 rlz_lib::CHROME_OMNIBOX, rlz_lib::FIRST_SEARCH));
53 const wchar_t kEvent1[] = L"C1F"; 56 const wchar_t kEvent1[] = L"C1F";
54 RegKey key1; 57 RegKey key1;
55 EXPECT_TRUE(key1.Open(HKEY_CURRENT_USER, kKeyName, KEY_READ)); 58 EXPECT_TRUE(key1.Open(HKEY_CURRENT_USER, kKeyName, KEY_READ));
56 EXPECT_TRUE(key1.ReadValueDW(kEvent1, &recorded_value)); 59 EXPECT_TRUE(key1.ReadValueDW(kEvent1, &recorded_value));
57 EXPECT_EQ(1, recorded_value); 60 EXPECT_EQ(1, recorded_value);
58 61
59 EXPECT_TRUE(RLZTracker::ClearAllProductEvents(rlz_lib::CHROME)); 62 EXPECT_TRUE(RLZTracker::ClearAllProductEvents(rlz_lib::CHROME));
60 EXPECT_FALSE(CleanValue(kKeyName, kEvent1)); 63 EXPECT_FALSE(CleanValue(kKeyName, kEvent1));
61 } 64 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_provider_win_unittest.cc ('k') | chrome/browser/shell_integration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698