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

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 test for assert handlers nesting. Created 3 years, 8 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 | « chrome/common/logging_chrome.cc ('k') | net/test/scoped_disable_exit_on_dfatal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ae764afdf33cf01574418b864e2991bf54a8d4d7..0ae51f2be05803ed275eb7ff04ebaa8b2045749f 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,7 +4,10 @@
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
+#include "base/bind.h"
+#include "base/logging.h"
#include "base/mac/foundation_util.h"
+#include "base/strings/string_piece.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"
@@ -54,7 +57,10 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeWeasleyFooter,
};
-void LogSink(const std::string& str) {
+void LogSink(const char* file,
+ int line,
+ const base::StringPiece message,
+ const base::StringPiece stack_trace) {
// No-op.
}
@@ -312,7 +318,7 @@ void LogSink(const std::string& str) {
CollectionViewModel* model = [[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
@@ -323,7 +329,6 @@ void LogSink(const std::string& str) {
}
}
EXPECT_TRUE(out_of_bounds_exception_thrown);
- logging::SetLogAssertHandler(nullptr);
}
TEST(CollectionViewModelTest, RemoveItems) {
« no previous file with comments | « chrome/common/logging_chrome.cc ('k') | net/test/scoped_disable_exit_on_dfatal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698