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 #include "base/mac/scoped_nsautorelease_pool.h" | 5 #include "base/mac/scoped_nsautorelease_pool.h" |
6 #import "base/memory/scoped_nsobject.h" | 6 #import "base/memory/scoped_nsobject.h" |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/renderer_host/test_render_view_host.h" | 9 #include "content/browser/renderer_host/test_render_view_host.h" |
10 #include "content/browser/tab_contents/test_web_contents.h" | 10 #include "content/browser/web_contents/test_web_contents.h" |
11 #import "content/browser/web_contents/web_drag_dest_mac.h" | 11 #import "content/browser/web_contents/web_drag_dest_mac.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #import "third_party/mozilla/NSPasteboard+Utils.h" | 13 #import "third_party/mozilla/NSPasteboard+Utils.h" |
14 #import "ui/base/dragdrop/cocoa_dnd_util.h" | 14 #import "ui/base/dragdrop/cocoa_dnd_util.h" |
15 #import "ui/base/test/ui_cocoa_test_helper.h" | 15 #import "ui/base/test/ui_cocoa_test_helper.h" |
16 #include "webkit/glue/webdropdata.h" | 16 #include "webkit/glue/webdropdata.h" |
17 | 17 |
18 using content::RenderViewHostImplTestHarness; | 18 using content::RenderViewHostImplTestHarness; |
19 | 19 |
20 namespace { | 20 namespace { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 NSString* textString = @"hi there"; | 155 NSString* textString = @"hi there"; |
156 [pboard setString:htmlString forType:NSHTMLPboardType]; | 156 [pboard setString:htmlString forType:NSHTMLPboardType]; |
157 [pboard setString:textString forType:NSStringPboardType]; | 157 [pboard setString:textString forType:NSStringPboardType]; |
158 [drag_dest_ populateWebDropData:&data fromPasteboard:pboard]; | 158 [drag_dest_ populateWebDropData:&data fromPasteboard:pboard]; |
159 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); | 159 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); |
160 EXPECT_EQ(base::SysNSStringToUTF16(textString), data.plain_text); | 160 EXPECT_EQ(base::SysNSStringToUTF16(textString), data.plain_text); |
161 EXPECT_EQ(base::SysNSStringToUTF16(htmlString), data.text_html); | 161 EXPECT_EQ(base::SysNSStringToUTF16(htmlString), data.text_html); |
162 | 162 |
163 [pboard releaseGlobally]; | 163 [pboard releaseGlobally]; |
164 } | 164 } |
OLD | NEW |