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

Unified Diff: ui/views/cocoa/drag_drop_client_mac_unittest.mm

Issue 2537953002: Fix a leak in a MacViews pasteboard test. (Closed)
Patch Set: Comment from tapted. Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/drag_drop_client_mac_unittest.mm
diff --git a/ui/views/cocoa/drag_drop_client_mac_unittest.mm b/ui/views/cocoa/drag_drop_client_mac_unittest.mm
index 364b73e0d6991b27205bbb58e3892dc1517a5b94..979010e5a1cee4beb0dbe78cde66f223d24b59b2 100644
--- a/ui/views/cocoa/drag_drop_client_mac_unittest.mm
+++ b/ui/views/cocoa/drag_drop_client_mac_unittest.mm
@@ -10,6 +10,7 @@
#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
+#import "ui/base/clipboard/clipboard_util_mac.h"
#import "ui/views/cocoa/bridged_native_widget.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/view.h"
@@ -279,17 +280,17 @@ TEST_F(DragDropClientMacTest, InvalidFormatDragDrop) {
TEST_F(DragDropClientMacTest, PasteboardToOSExchangeTest) {
target_->set_formats(ui::OSExchangeData::STRING);
- NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName];
+ scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard;
// The test should reject the data if the pasteboard is empty.
- EXPECT_EQ(DragUpdate(pasteboard), NSDragOperationNone);
+ EXPECT_EQ(DragUpdate(pasteboard->get()), NSDragOperationNone);
EXPECT_EQ(Drop(), NSDragOperationNone);
drag_drop_client()->EndDrag();
// Add valid data to the pasteboard and check to see if the target accepts
// it.
- [pasteboard setString:@"text" forType:NSPasteboardTypeString];
- EXPECT_EQ(DragUpdate(pasteboard), NSDragOperationCopy);
+ [pasteboard->get() setString:@"text" forType:NSPasteboardTypeString];
+ EXPECT_EQ(DragUpdate(pasteboard->get()), NSDragOperationCopy);
EXPECT_EQ(Drop(), NSDragOperationMove);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698