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

Side by Side Diff: content/browser/web_contents/web_drag_source_mac_unittest.mm

Issue 2509933002: Drag-and-drop: Target drag messages (the sequel). (Closed)
Patch Set: Addressed additional comments by avi@, dcheng@. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "content/browser/web_contents/web_drag_source_mac.h" 5 #import "content/browser/web_contents/web_drag_source_mac.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/common/drop_data.h" 9 #include "content/public/common/drop_data.h"
10 #include "content/public/test/test_renderer_host.h" 10 #include "content/public/test/test_renderer_host.h"
(...skipping 12 matching lines...) Expand all
23 23
24 std::unique_ptr<DropData> dropData(new DropData); 24 std::unique_ptr<DropData> dropData(new DropData);
25 dropData->url = GURL("javascript:%"); 25 dropData->url = GURL("javascript:%");
26 26
27 WebContentsImpl* contentsImpl = static_cast<WebContentsImpl*>(contents.get()); 27 WebContentsImpl* contentsImpl = static_cast<WebContentsImpl*>(contents.get());
28 scoped_refptr<ui::UniquePasteboard> pasteboard1 = new ui::UniquePasteboard; 28 scoped_refptr<ui::UniquePasteboard> pasteboard1 = new ui::UniquePasteboard;
29 base::scoped_nsobject<WebDragSource> source([[WebDragSource alloc] 29 base::scoped_nsobject<WebDragSource> source([[WebDragSource alloc]
30 initWithContents:contentsImpl 30 initWithContents:contentsImpl
31 view:view 31 view:view
32 dropData:dropData.get() 32 dropData:dropData.get()
33 sourceRWH:contentsImpl->GetRenderViewHost()->GetWidget()
33 image:nil 34 image:nil
34 offset:NSZeroPoint 35 offset:NSZeroPoint
35 pasteboard:pasteboard1->get() 36 pasteboard:pasteboard1->get()
36 dragOperationMask:NSDragOperationCopy]); 37 dragOperationMask:NSDragOperationCopy]);
37 38
38 // Test that this call doesn't throw any exceptions: http://crbug.com/128371 39 // Test that this call doesn't throw any exceptions: http://crbug.com/128371
39 scoped_refptr<ui::UniquePasteboard> pasteboard2 = new ui::UniquePasteboard; 40 scoped_refptr<ui::UniquePasteboard> pasteboard2 = new ui::UniquePasteboard;
40 [source lazyWriteToPasteboard:pasteboard2->get() forType:NSURLPboardType]; 41 [source lazyWriteToPasteboard:pasteboard2->get() forType:NSURLPboardType];
41 } 42 }
42 43
43 } // namespace content 44 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_drag_source_mac.mm ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698