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

Unified Diff: base/memory/ref_counted_memory_unittest.cc

Issue 11830007: Avoid sending notifications when the bitmap data in history has not changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split the changes to MergeFavicon() and SetFavicons() into two CLs as only the changes to MergeFavi… Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/ref_counted_memory.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted_memory_unittest.cc
diff --git a/base/memory/ref_counted_memory_unittest.cc b/base/memory/ref_counted_memory_unittest.cc
index 19360400c14a762deecf462bd6f18636711bb979..c6f2b9c3d1c8f0878dca40c5f91fd91a7a8c8a9b 100644
--- a/base/memory/ref_counted_memory_unittest.cc
+++ b/base/memory/ref_counted_memory_unittest.cc
@@ -42,4 +42,30 @@ TEST(RefCountedMemoryUnitTest, RefCountedString) {
EXPECT_EQ('e', mem->front()[1]);
}
+TEST(RefCountedMemoryUnitTest, Equals) {
+ std::string s1("same");
+ scoped_refptr<RefCountedMemory> mem1 = RefCountedString::TakeString(&s1);
+
+ std::vector<unsigned char> d2;
+ d2.push_back('s');
+ d2.push_back('a');
+ d2.push_back('m');
+ d2.push_back('e');
+ scoped_refptr<RefCountedMemory> mem2 = RefCountedBytes::TakeVector(&d2);
+
+ EXPECT_TRUE(mem1->Equals(mem2));
+
+ std::string s3("diff");
+ scoped_refptr<RefCountedMemory> mem3 = RefCountedString::TakeString(&s3);
+
+ EXPECT_FALSE(mem1->Equals(mem3));
+ EXPECT_FALSE(mem2->Equals(mem3));
+}
+
+TEST(RefCountedMemoryUnitTest, EqualsNull) {
+ std::string s("str");
+ scoped_refptr<RefCountedMemory> mem = RefCountedString::TakeString(&s);
+ EXPECT_FALSE(mem->Equals(NULL));
+}
+
} // namespace base
« no previous file with comments | « base/memory/ref_counted_memory.cc ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698