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

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

Issue 656293003: [Mac] Do not initialize the MockCrApplication in base::TestSuite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review Created 6 years, 2 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
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 7f50bb377c8a3eea4c935e8c49df2dea0b87f942..63e32c3cf09092d7e2b5e1331a6c381df64fbe18 100644
--- a/ui/gfx/test/ui_cocoa_test_helper.mm
+++ b/ui/gfx/test/ui_cocoa_test_helper.mm
@@ -7,6 +7,7 @@
#include "base/debug/debugger.h"
#include "base/logging.h"
#include "base/stl_util.h"
+#include "base/test/mock_chrome_application_mac.h"
#include "base/test/test_timeouts.h"
namespace {
@@ -16,6 +17,11 @@ namespace {
// to flag intentional leaks without having to suppress all calls to
// potentially leaky functions.
void NOINLINE ForceSystemLeaks() {
+ // If a test suite hasn't already initialized NSApp, register the mock one
+ // now.
+ if (!NSApp)
+ mock_cr_app::RegisterMockCrApp();
+
// First NSCursor push always leaks.
[[NSCursor openHandCursor] push];
[NSCursor pop];

Powered by Google App Engine
This is Rietveld 408576698