OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/test/integration/bookmarks_helper.h" | 5 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return true; | 183 return true; |
184 if ((bitmap_a.getSize() != bitmap_b.getSize()) || | 184 if ((bitmap_a.getSize() != bitmap_b.getSize()) || |
185 (bitmap_a.width() != bitmap_b.width()) || | 185 (bitmap_a.width() != bitmap_b.width()) || |
186 (bitmap_a.height() != bitmap_b.height())) { | 186 (bitmap_a.height() != bitmap_b.height())) { |
187 LOG(ERROR) << "Favicon size mismatch: " << bitmap_a.getSize() << " (" | 187 LOG(ERROR) << "Favicon size mismatch: " << bitmap_a.getSize() << " (" |
188 << bitmap_a.width() << "x" << bitmap_a.height() << ") vs. " | 188 << bitmap_a.width() << "x" << bitmap_a.height() << ") vs. " |
189 << bitmap_b.getSize() << " (" << bitmap_b.width() << "x" | 189 << bitmap_b.getSize() << " (" << bitmap_b.width() << "x" |
190 << bitmap_b.height() << ")"; | 190 << bitmap_b.height() << ")"; |
191 return false; | 191 return false; |
192 } | 192 } |
193 SkAutoLockPixels bitmap_lock_a(bitmap_a); | |
194 SkAutoLockPixels bitmap_lock_b(bitmap_b); | |
195 void* node_pixel_addr_a = bitmap_a.getPixels(); | 193 void* node_pixel_addr_a = bitmap_a.getPixels(); |
196 EXPECT_TRUE(node_pixel_addr_a); | 194 EXPECT_TRUE(node_pixel_addr_a); |
197 void* node_pixel_addr_b = bitmap_b.getPixels(); | 195 void* node_pixel_addr_b = bitmap_b.getPixels(); |
198 EXPECT_TRUE(node_pixel_addr_b); | 196 EXPECT_TRUE(node_pixel_addr_b); |
199 if (memcmp(node_pixel_addr_a, node_pixel_addr_b, bitmap_a.getSize()) != 0) { | 197 if (memcmp(node_pixel_addr_a, node_pixel_addr_b, bitmap_a.getSize()) != 0) { |
200 LOG(ERROR) << "Favicon bitmap mismatch"; | 198 LOG(ERROR) << "Favicon bitmap mismatch"; |
201 return false; | 199 return false; |
202 } else { | 200 } else { |
203 return true; | 201 return true; |
204 } | 202 } |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 } // namespace | 953 } // namespace |
956 | 954 |
957 BookmarksUrlChecker::BookmarksUrlChecker(int profile, | 955 BookmarksUrlChecker::BookmarksUrlChecker(int profile, |
958 const GURL& url, | 956 const GURL& url, |
959 int expected_count) | 957 int expected_count) |
960 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, | 958 : AwaitMatchStatusChangeChecker(base::Bind(BookmarkCountsByUrlMatch, |
961 profile, | 959 profile, |
962 base::ConstRef(url), | 960 base::ConstRef(url), |
963 expected_count), | 961 expected_count), |
964 "Bookmark URL counts match.") {} | 962 "Bookmark URL counts match.") {} |
OLD | NEW |