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(); |
} |