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

Unified Diff: ui/gfx/test/ui_cocoa_test_helper.mm

Issue 308713007: [Memory Sheriff] Force a well-defined path for system leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mem_257276
Patch Set: Address review comments. Created 6 years, 7 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: ui/gfx/test/ui_cocoa_test_helper.mm
diff --git a/ui/gfx/test/ui_cocoa_test_helper.mm b/ui/gfx/test/ui_cocoa_test_helper.mm
index bae4af88820488838acc93defecff49d2fe8255d..7f50bb377c8a3eea4c935e8c49df2dea0b87f942 100644
--- a/ui/gfx/test/ui_cocoa_test_helper.mm
+++ b/ui/gfx/test/ui_cocoa_test_helper.mm
@@ -9,6 +9,20 @@
#include "base/stl_util.h"
#include "base/test/test_timeouts.h"
+namespace {
+
+// Some AppKit function leak intentionally, e.g. for caching purposes.
Nico 2014/06/04 22:08:15 Does anything actually report these leaks? I would
+// Force those leaks here, so there can be a unique calling path, allowing
+// to flag intentional leaks without having to suppress all calls to
+// potentially leaky functions.
+void NOINLINE ForceSystemLeaks() {
+ // First NSCursor push always leaks.
+ [[NSCursor openHandCursor] push];
+ [NSCursor pop];
+}
+
+} // namespace.
+
@implementation CocoaTestHelperWindow
- (id)initWithContentRect:(NSRect)contentRect {
@@ -51,6 +65,7 @@
namespace ui {
CocoaTest::CocoaTest() : called_tear_down_(false), test_window_(nil) {
+ ForceSystemLeaks();
Init();
}
« 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