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