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

Unified Diff: chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm

Issue 1852433004: Fix NSPasteboard leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. Created 4 years, 9 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 | chrome/browser/ui/cocoa/find_pasteboard_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm
diff --git a/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm b/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm
index 41cf86feaf55bb3cd1f24b9ad8ba9680b16e197b..9427a5c2a6d1ff16c412cdb07df15a97369c8776 100644
--- a/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm
+++ b/chrome/browser/ui/cocoa/download/download_util_mac_unittest.mm
@@ -5,6 +5,7 @@
// Download utility test for Mac OS X.
#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
@@ -13,21 +14,18 @@
#include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
+#import "ui/base/clipboard/clipboard_util_mac.h"
namespace {
class DownloadUtilMacTest : public CocoaTest {
public:
- DownloadUtilMacTest() {
- pasteboard_ = [NSPasteboard pasteboardWithUniqueName];
- }
+ DownloadUtilMacTest() { pasteboard_ = new ui::UniquePasteboard; }
- ~DownloadUtilMacTest() override { [pasteboard_ releaseGlobally]; }
-
- NSPasteboard* pasteboard() { return pasteboard_; }
+ NSPasteboard* pasteboard() { return pasteboard_->get(); }
private:
- NSPasteboard* pasteboard_;
+ scoped_refptr<ui::UniquePasteboard> pasteboard_;
};
// Ensure adding files to the pasteboard methods works as expected.
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/find_pasteboard_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698