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

Unified Diff: chrome/browser/history/history_backend_unittest.cc

Issue 699283002: c++11: Allow lambdas, with some restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month 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 | styleguide/c++/c++11.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend_unittest.cc
diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc
index 8127b01f2f3a0e8cb2e1a57e312649db7890a05f..9ed2b3fba594acf4425b6f72bcdfdbdd4fcb1b4b 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -65,18 +65,6 @@ typedef base::Callback<void(const history::URLRow*,
const history::URLRow*)>
SimulateNotificationCallback;
-// Comparison functions as to make it easier to check results of
-// GetFaviconBitmaps() and GetIconMappingsForPageURL().
-bool IconMappingLessThan(const history::IconMapping& a,
- const history::IconMapping& b) {
- return a.icon_url < b.icon_url;
-}
-
-bool FaviconBitmapLessThan(const history::FaviconBitmap& a,
- const history::FaviconBitmap& b) {
- return a.pixel_size.GetArea() < b.pixel_size.GetArea();
-}
-
class HistoryClientMock : public history::HistoryClientFakeBookmarks {
public:
MOCK_METHOD0(BlockUntilBookmarksLoaded, void());
@@ -368,7 +356,9 @@ class HistoryBackendTest : public HistoryBackendTestBase {
return false;
}
std::sort(icon_mappings->begin(), icon_mappings->end(),
- IconMappingLessThan);
+ [](const history::IconMapping& a, const history::IconMapping& b) {
+ return a.icon_url < b.icon_url;
+ });
return true;
}
@@ -378,8 +368,11 @@ class HistoryBackendTest : public HistoryBackendTestBase {
std::vector<FaviconBitmap>* favicon_bitmaps) {
if (!backend_->thumbnail_db_->GetFaviconBitmaps(icon_id, favicon_bitmaps))
return false;
- std::sort(favicon_bitmaps->begin(), favicon_bitmaps->end(),
- FaviconBitmapLessThan);
+ std::sort(
+ favicon_bitmaps->begin(), favicon_bitmaps->end(),
+ [](const history::FaviconBitmap& a, const history::FaviconBitmap& b) {
+ return a.pixel_size.GetArea() < b.pixel_size.GetArea();
+ });
return true;
}
« no previous file with comments | « no previous file | styleguide/c++/c++11.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698