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

Unified Diff: ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Add comment. Fix missed usage of SetLogAssertHandler. Created 3 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
Index: ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm
diff --git a/ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm b/ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm
index 09d7543e47f9aa6b1d96626cd4261168b0fd0e91..d351af764f46ebef8892340d80cafe9671358760 100644
--- a/ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm
+++ b/ios/chrome/browser/ui/collection_view/collection_view_model_unittest.mm
@@ -4,8 +4,10 @@
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
+#include "base/bind.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/test/logging_utils.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
@@ -47,7 +49,11 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeWeasleyFooter,
};
-void LogSink(const std::string& str) {
+void LogSink(const char* file,
+ int line,
+ size_t message_start,
+ size_t stack_start,
+ const std::string& str) {
// No-op.
}
@@ -302,7 +308,7 @@ void LogSink(const std::string& str) {
[[CollectionViewModel alloc] init]);
[model addSectionWithIdentifier:SectionIdentifierCheese];
- logging::SetLogAssertHandler(&LogSink);
+ logging::ScopedLogAssertHandler scoped_assert_handler(base::Bind(LogSink));
bool out_of_bounds_exception_thrown = false;
@try {
[model indexInItemTypeForIndexPath:[NSIndexPath indexPathForItem:0
@@ -313,7 +319,6 @@ void LogSink(const std::string& str) {
}
}
EXPECT_TRUE(out_of_bounds_exception_thrown);
- logging::SetLogAssertHandler(nullptr);
}
TEST(CollectionViewModelTest, RemoveItems) {

Powered by Google App Engine
This is Rietveld 408576698