OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/scoped_nsautorelease_pool.h" | 5 #include "base/scoped_nsautorelease_pool.h" |
6 #include "base/sys_string_conversions.h" | 6 #include "base/sys_string_conversions.h" |
7 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 7 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
8 #import "chrome/browser/cocoa/web_drop_target.h" | 8 #import "chrome/browser/cocoa/web_drop_target.h" |
9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #import "third_party/mozilla/include/NSPasteboard+Utils.h" | 11 #import "third_party/mozilla/include/NSPasteboard+Utils.h" |
12 #include "webkit/glue/webdropdata.h" | 12 #include "webkit/glue/webdropdata.h" |
13 | 13 |
14 class WebDropTargetTest : public RenderViewHostTestHarness { | 14 class WebDropTargetTest : public RenderViewHostTestHarness { |
15 public: | 15 public: |
16 WebDropTargetTest() { | 16 WebDropTargetTest() { |
17 RenderViewHostTestHarness::SetUp(); | |
18 drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]); | 17 drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]); |
19 } | 18 } |
20 | 19 |
21 virtual ~WebDropTargetTest() { | 20 virtual ~WebDropTargetTest() { |
22 RenderViewHostTestHarness::TearDown(); | 21 RenderViewHostTestHarness::TearDown(); |
23 | 22 |
24 } | 23 } |
25 | 24 |
26 void PutURLOnPasteboard(NSString* urlString, NSPasteboard* pboard) { | 25 void PutURLOnPasteboard(NSString* urlString, NSPasteboard* pboard) { |
27 [pboard declareTypes:[NSArray arrayWithObject:NSURLPboardType] | 26 [pboard declareTypes:[NSArray arrayWithObject:NSURLPboardType] |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); | 101 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); |
103 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); | 102 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); |
104 | 103 |
105 [pboard releaseGlobally]; | 104 [pboard releaseGlobally]; |
106 } | 105 } |
107 | 106 |
108 TEST_F(WebDropTargetTest, EnterExitDrop) { | 107 TEST_F(WebDropTargetTest, EnterExitDrop) { |
109 // TODO(pinkerton): Call enter/exit/drop and see what happens. This is a bit | 108 // TODO(pinkerton): Call enter/exit/drop and see what happens. This is a bit |
110 // harder to test. | 109 // harder to test. |
111 } | 110 } |
OLD | NEW |