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

Unified Diff: chrome/browser/history/android/android_provider_backend_unittest.cc

Issue 10861006: Fix the failed case AndroidProviderBackendTest.UpdateFavicon on Android (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changes according to the comment Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/android/android_provider_backend_unittest.cc
diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc
index 31a84620498684387a3db5916ee3bea32a08d3de..4e4b463760f42e6991d9cac30455d5cb21b2b438 100644
--- a/chrome/browser/history/android/android_provider_backend_unittest.cc
+++ b/chrome/browser/history/android/android_provider_backend_unittest.cc
@@ -1138,7 +1138,10 @@ TEST_F(AndroidProviderBackendTest, UpdateFavicon) {
// Set favicon.
std::vector<unsigned char> data;
data.push_back('1');
- update_row1.set_favicon(base::RefCountedBytes::TakeVector(&data));
+ // Keep the pointer of RefCountedBytes for it's the expected result
+ // which will be compared with the result of GetFavicon
+ base::RefCountedBytes *data_bytes = base::RefCountedBytes::TakeVector(&data);
+ update_row1.set_favicon(data_bytes);
update_args.push_back(UTF8ToUTF16(row1.raw_url()));
delegate_.ResetDetails();
ASSERT_TRUE(backend->UpdateHistoryAndBookmarks(update_row1, "url = ?",
@@ -1158,7 +1161,7 @@ TEST_F(AndroidProviderBackendTest, UpdateFavicon) {
std::vector<unsigned char> png_icon_data;
EXPECT_TRUE(thumbnail_db_.GetFavicon(icon_mapping.icon_id, &last_updated,
&png_icon_data, NULL, NULL));
- EXPECT_EQ(data, png_icon_data);
+ EXPECT_EQ(data_bytes->data(), png_icon_data);
// Remove favicon.
HistoryAndBookmarkRow update_row2;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698