diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 09:45:39 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 09:45:39 +0000 |
commit | 191b853fd4b0178094f79ba352462280c1b72f10 (patch) | |
tree | d484ec6fa45591fa6532ad8ddd007b64f0a8db1c /ui | |
parent | 9a5fd60b166d80da7a3202bf22620db2fe83542a (diff) | |
download | chromium_src-191b853fd4b0178094f79ba352462280c1b72f10.zip chromium_src-191b853fd4b0178094f79ba352462280c1b72f10.tar.gz chromium_src-191b853fd4b0178094f79ba352462280c1b72f10.tar.bz2 |
[Memory Sheriff] Force a well-defined path for system leak.
BUG=379331
Review URL: https://codereview.chromium.org/308713007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/test/ui_cocoa_test_helper.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/gfx/test/ui_cocoa_test_helper.mm b/ui/gfx/test/ui_cocoa_test_helper.mm index bae4af8..7f50bb3 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 { @@ -51,6 +65,7 @@ namespace ui { CocoaTest::CocoaTest() : called_tear_down_(false), test_window_(nil) { + ForceSystemLeaks(); Init(); } |