web_contents_view_mac_unittest.mm revision 5821806d5e7f356e8fa4b058a389a808ea183019
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/memory/scoped_nsobject.h"
8#import "ui/base/test/ui_cocoa_test_helper.h"
9#include "testing/gtest/include/gtest/gtest.h"
10#include "testing/platform_test.h"
11
12namespace {
13
14class WebContentsViewCocoaTest : public ui::CocoaTest {
15};
16
17TEST_F(WebContentsViewCocoaTest, NonWebDragSourceTest) {
18  scoped_nsobject<WebContentsViewCocoa>
19      view([[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