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

Unified Diff: base/mac_util_unittest.mm

Issue 463028: Separate ProxyResolverMac and ProxyConfigServiceMac into their own files (Closed)
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mac_util.mm ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac_util_unittest.mm
===================================================================
--- base/mac_util_unittest.mm (revision 34241)
+++ base/mac_util_unittest.mm (working copy)
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/scoped_cftyperef.h"
#include "base/scoped_nsobject.h"
#include "base/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -125,3 +126,19 @@
EXPECT_TRUE(mac_util::SetFileBackupExclusion(file_path, false));
EXPECT_FALSE(CSBackupIsItemExcluded((CFURLRef)fileURL, &excludeByPath));
}
+
+TEST_F(MacUtilTest, TestGetValueFromDictionary) {
+ scoped_cftyperef<CFMutableDictionaryRef> dict(
+ CFDictionaryCreateMutable(0, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks));
+ CFDictionarySetValue(dict.get(), CFSTR("key"), CFSTR("value"));
+
+ EXPECT_TRUE(CFEqual(CFSTR("value"),
+ mac_util::GetValueFromDictionary(
+ dict, CFSTR("key"), CFStringGetTypeID())));
+ EXPECT_FALSE(mac_util::GetValueFromDictionary(
+ dict, CFSTR("key"), CFNumberGetTypeID()));
+ EXPECT_FALSE(mac_util::GetValueFromDictionary(
+ dict, CFSTR("no-exist"), CFStringGetTypeID()));
+}
« no previous file with comments | « base/mac_util.mm ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698