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..38a2b935bed48b34749bd6fccd4040eb3be7e6e7 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. |
+// 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 { |
@@ -76,6 +90,8 @@ void CocoaTest::Init() { |
// that we don't wait for them to close in TearDown. Has to be done |
// after BootstrapCocoa is called. |
initial_windows_ = ApplicationWindows(); |
+ |
+ ForceSystemLeaks(); |
Scott Hess - ex-Googler
2014/05/30 23:58:06
Stepping back and putting on my "What would anothe
groby-ooo-7-16
2014/05/31 00:37:04
Moved to top of ctor.
|
} |
void CocoaTest::TearDown() { |