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 3 // found in the LICENSE file. 4 5 #import "content/browser/web_contents/web_contents_view_mac.h" 6 7 #include "base/mac/scoped_nsobject.h" 8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/platform_test.h" 10 #import "ui/base/test/ui_cocoa_test_helper.h" 11 12 namespace { 13 14 class WebContentsViewCocoaTest : public ui::CocoaTest { 15 }; 16 17 TEST_F(WebContentsViewCocoaTest, NonWebDragSourceTest) { 18 base::scoped_nsobject<WebContentsViewCocoa> view( 19 [[WebContentsViewCocoa alloc] init]); 20 21 // Tests that |draggingSourceOperationMaskForLocal:| returns the expected mask 22 // when dragging without a WebDragSource - i.e. when |startDragWithDropData:| 23 // hasn't yet been called. Dragging a file from the downloads manager, for 24 // example, requires this to work. 25 EXPECT_EQ(NSDragOperationCopy, 26 [view draggingSourceOperationMaskForLocal:YES]); 27 EXPECT_EQ(NSDragOperationCopy, 28 [view draggingSourceOperationMaskForLocal:NO]); 29 } 30 31 } // namespace 32