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

Side by Side Diff: chrome_frame/test/policy_settings_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
« no previous file with comments | « chrome_frame/test/perf/chrome_frame_perftest.cc ('k') | chrome_frame/test/util_unittests.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/registry.h"
8 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
9 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/win/registry.h"
11 #include "chrome/common/policy_constants.h" 11 #include "chrome/common/policy_constants.h"
12 #include "chrome_frame/policy_settings.h" 12 #include "chrome_frame/policy_settings.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 using base::win::RegKey;
16
15 namespace { 17 namespace {
16 18
17 // A best effort way to zap CF policy entries that may be in the registry. 19 // A best effort way to zap CF policy entries that may be in the registry.
18 void DeleteChromeFramePolicyEntries(HKEY root) { 20 void DeleteChromeFramePolicyEntries(HKEY root) {
19 RegKey key; 21 RegKey key;
20 if (key.Open(root, policy::kRegistrySubKey, KEY_ALL_ACCESS)) { 22 if (key.Open(root, policy::kRegistrySubKey, KEY_ALL_ACCESS)) {
21 key.DeleteValue( 23 key.DeleteValue(
22 ASCIIToWide(policy::key::kChromeFrameRendererSettings).c_str()); 24 ASCIIToWide(policy::key::kChromeFrameRendererSettings).c_str());
23 key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str()); 25 key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str());
24 key.DeleteKey(ASCIIToWide(policy::key::kRenderInHostList).c_str()); 26 key.DeleteKey(ASCIIToWide(policy::key::kRenderInHostList).c_str());
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 kTestPolicyContentTypes[type])); 208 kTestPolicyContentTypes[type]));
207 } 209 }
208 210
209 EXPECT_EQ(PolicySettings::RENDERER_NOT_SPECIFIED, 211 EXPECT_EQ(PolicySettings::RENDERER_NOT_SPECIFIED,
210 settings->GetRendererForContentType(L"text/html")); 212 settings->GetRendererForContentType(L"text/html"));
211 213
212 DeleteChromeFramePolicyEntries(root[i]); 214 DeleteChromeFramePolicyEntries(root[i]);
213 } 215 }
214 } 216 }
215 217
OLDNEW
« no previous file with comments | « chrome_frame/test/perf/chrome_frame_perftest.cc ('k') | chrome_frame/test/util_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698