| 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/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 virtual void SetUp() { | 16 virtual void SetUp() { |
| 17 RenderViewHostTestHarness::SetUp(); | 17 RenderViewHostTestHarness::SetUp(); |
| 18 CocoaTest::BootstrapCocoa(); | 18 CocoaTest::BootstrapCocoa(); |
| 19 drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]); | 19 drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]); |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 NSString* textString = @"hi there"; | 124 NSString* textString = @"hi there"; |
| 125 [pboard setString:htmlString forType:NSHTMLPboardType]; | 125 [pboard setString:htmlString forType:NSHTMLPboardType]; |
| 126 [pboard setString:textString forType:NSStringPboardType]; | 126 [pboard setString:textString forType:NSStringPboardType]; |
| 127 [drop_target_ populateWebDropData:&data fromPasteboard:pboard]; | 127 [drop_target_ populateWebDropData:&data fromPasteboard:pboard]; |
| 128 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); | 128 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); |
| 129 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); | 129 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); |
| 130 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); | 130 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); |
| 131 | 131 |
| 132 [pboard releaseGlobally]; | 132 [pboard releaseGlobally]; |
| 133 } | 133 } |
| OLD | NEW |