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

Side by Side Diff: chrome/browser/policy/configuration_policy_provider_mac_unittest.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 6
7 #include "base/mac/scoped_cftyperef.h" 7 #include "base/mac/scoped_cftyperef.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" 10 #include "chrome/browser/policy/configuration_policy_pref_store.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return base::SysUTF8ToCFStringRef(v); 71 return base::SysUTF8ToCFStringRef(v);
72 } 72 }
73 case Value::TYPE_LIST: { 73 case Value::TYPE_LIST: {
74 const ListValue* list = 74 const ListValue* list =
75 static_cast<const ListValue*>(test_value_.get()); 75 static_cast<const ListValue*>(test_value_.get());
76 base::mac::ScopedCFTypeRef<CFMutableArrayRef> array( 76 base::mac::ScopedCFTypeRef<CFMutableArrayRef> array(
77 CFArrayCreateMutable(NULL, list->GetSize(), 77 CFArrayCreateMutable(NULL, list->GetSize(),
78 &kCFTypeArrayCallBacks)); 78 &kCFTypeArrayCallBacks));
79 for (ListValue::const_iterator element(list->begin()); 79 for (ListValue::const_iterator element(list->begin());
80 element != list->end(); ++element) { 80 element != list->end(); ++element) {
81 if (!(*element)->IsType(Value::TYPE_STRING)) 81 if (!(*element)->IsString())
82 return NULL; 82 return NULL;
83 std::string element_value; 83 std::string element_value;
84 if (!(*element)->GetAsString(&element_value)) 84 if (!(*element)->GetAsString(&element_value))
85 return NULL; 85 return NULL;
86 base::mac::ScopedCFTypeRef<CFStringRef> cf_element_value( 86 base::mac::ScopedCFTypeRef<CFStringRef> cf_element_value(
87 base::SysUTF8ToCFStringRef(element_value)); 87 base::SysUTF8ToCFStringRef(element_value));
88 CFArrayAppendValue(array, cf_element_value.get()); 88 CFArrayAppendValue(array, cf_element_value.get());
89 } 89 }
90 return array.release(); 90 return array.release();
91 } 91 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 kPolicyDisabledSchemes, 344 kPolicyDisabledSchemes,
345 key::kDisabledSchemes), 345 key::kDisabledSchemes),
346 PolicyTestParams::ForStringPolicy( 346 PolicyTestParams::ForStringPolicy(
347 kPolicyDiskCacheDir, 347 kPolicyDiskCacheDir,
348 key::kDiskCacheDir), 348 key::kDiskCacheDir),
349 PolicyTestParams::ForIntegerPolicy( 349 PolicyTestParams::ForIntegerPolicy(
350 kPolicyMaxConnectionsPerProxy, 350 kPolicyMaxConnectionsPerProxy,
351 key::kMaxConnectionsPerProxy))); 351 key::kMaxConnectionsPerProxy)));
352 352
353 } // namespace policy 353 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698