Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Side by Side Diff: chrome/browser/cocoa/web_drop_target_unittest.mm

Issue 330001: Disable the Web drop target unittests because they (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 19 matching lines...) Expand all
30 EXPECT_TRUE(url); 30 EXPECT_TRUE(url);
31 [url writeToPasteboard:pboard]; 31 [url writeToPasteboard:pboard];
32 } 32 }
33 33
34 base::ScopedNSAutoreleasePool pool_; 34 base::ScopedNSAutoreleasePool pool_;
35 CocoaTestHelper cocoa_helper_; 35 CocoaTestHelper cocoa_helper_;
36 scoped_nsobject<WebDropTarget> drop_target_; 36 scoped_nsobject<WebDropTarget> drop_target_;
37 }; 37 };
38 38
39 // Make sure nothing leaks. 39 // Make sure nothing leaks.
40 TEST_F(WebDropTargetTest, Init) { 40 TEST_F(WebDropTargetTest, DISABLED_Init) {
41 EXPECT_TRUE(drop_target_); 41 EXPECT_TRUE(drop_target_);
42 } 42 }
43 43
44 // Test flipping of coordinates given a point in window coordinates. 44 // Test flipping of coordinates given a point in window coordinates.
45 TEST_F(WebDropTargetTest, Flip) { 45 TEST_F(WebDropTargetTest, DISABLED_Flip) {
46 NSPoint windowPoint = NSZeroPoint; 46 NSPoint windowPoint = NSZeroPoint;
47 NSPoint viewPoint = 47 NSPoint viewPoint =
48 [drop_target_ flipWindowPointToView:windowPoint 48 [drop_target_ flipWindowPointToView:windowPoint
49 view:cocoa_helper_.contentView()]; 49 view:cocoa_helper_.contentView()];
50 NSPoint screenPoint = 50 NSPoint screenPoint =
51 [drop_target_ flipWindowPointToScreen:windowPoint 51 [drop_target_ flipWindowPointToScreen:windowPoint
52 view:cocoa_helper_.contentView()]; 52 view:cocoa_helper_.contentView()];
53 EXPECT_EQ(viewPoint.x, 0); 53 EXPECT_EQ(viewPoint.x, 0);
54 EXPECT_EQ(viewPoint.y, 600); 54 EXPECT_EQ(viewPoint.y, 600);
55 EXPECT_EQ(screenPoint.x, 0); 55 EXPECT_EQ(screenPoint.x, 0);
56 // We can't put a value on the screen size since everyone will have a 56 // We can't put a value on the screen size since everyone will have a
57 // different one. 57 // different one.
58 EXPECT_NE(screenPoint.y, 0); 58 EXPECT_NE(screenPoint.y, 0);
59 } 59 }
60 60
61 TEST_F(WebDropTargetTest, URL) { 61 TEST_F(WebDropTargetTest, DISABLED_URL) {
62 WebDropData data; 62 WebDropData data;
63 63
64 // Put a URL on the pasteboard and check it. 64 // Put a URL on the pasteboard and check it.
65 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName]; 65 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName];
66 PutURLOnPasteboard(@"http://www.google.com", pboard); 66 PutURLOnPasteboard(@"http://www.google.com", pboard);
67 [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard]; 67 [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard];
68 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); 68 EXPECT_EQ(data.url.spec(), "http://www.google.com/");
69 [pboard releaseGlobally]; 69 [pboard releaseGlobally];
70 70
71 // Put a 'url ' and 'urln' on the pasteboard and check it. 71 // Put a 'url ' and 'urln' on the pasteboard and check it.
72 NSString* title = @"Title of Awesomeness!"; 72 NSString* title = @"Title of Awesomeness!";
73 pboard = [NSPasteboard pasteboardWithUniqueName]; 73 pboard = [NSPasteboard pasteboardWithUniqueName];
74 [pboard declareTypes:[NSArray arrayWithObjects:kCorePasteboardFlavorType_url, 74 [pboard declareTypes:[NSArray arrayWithObjects:kCorePasteboardFlavorType_url,
75 kCorePasteboardFlavorType_urln, nil] 75 kCorePasteboardFlavorType_urln, nil]
76 owner:nil]; 76 owner:nil];
77 [pboard setString:@"http://www.something.com/" 77 [pboard setString:@"http://www.something.com/"
78 forType:kCorePasteboardFlavorType_url]; 78 forType:kCorePasteboardFlavorType_url];
79 [pboard setString:title 79 [pboard setString:title
80 forType:kCorePasteboardFlavorType_urln]; 80 forType:kCorePasteboardFlavorType_urln];
81 [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard]; 81 [drop_target_ populateURLAndTitle:&data fromPasteboard:pboard];
82 EXPECT_EQ(data.url.spec(), "http://www.something.com/"); 82 EXPECT_EQ(data.url.spec(), "http://www.something.com/");
83 EXPECT_EQ(data.url_title, base::SysNSStringToUTF16(title)); 83 EXPECT_EQ(data.url_title, base::SysNSStringToUTF16(title));
84 84
85 [pboard releaseGlobally]; 85 [pboard releaseGlobally];
86 } 86 }
87 87
88 TEST_F(WebDropTargetTest, Data) { 88 TEST_F(WebDropTargetTest, DISABLED_Data) {
89 WebDropData data; 89 WebDropData data;
90 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName]; 90 NSPasteboard* pboard = [NSPasteboard pasteboardWithUniqueName];
91 91
92 PutURLOnPasteboard(@"http://www.google.com", pboard); 92 PutURLOnPasteboard(@"http://www.google.com", pboard);
93 [pboard addTypes:[NSArray arrayWithObjects:NSHTMLPboardType, 93 [pboard addTypes:[NSArray arrayWithObjects:NSHTMLPboardType,
94 NSStringPboardType, nil] 94 NSStringPboardType, nil]
95 owner:nil]; 95 owner:nil];
96 NSString* htmlString = @"<html><body><b>hi there</b></body></html>"; 96 NSString* htmlString = @"<html><body><b>hi there</b></body></html>";
97 NSString* textString = @"hi there"; 97 NSString* textString = @"hi there";
98 [pboard setString:htmlString forType:NSHTMLPboardType]; 98 [pboard setString:htmlString forType:NSHTMLPboardType];
99 [pboard setString:textString forType:NSStringPboardType]; 99 [pboard setString:textString forType:NSStringPboardType];
100 [drop_target_ populateWebDropData:&data fromPasteboard:pboard]; 100 [drop_target_ populateWebDropData:&data fromPasteboard:pboard];
101 EXPECT_EQ(data.url.spec(), "http://www.google.com/"); 101 EXPECT_EQ(data.url.spec(), "http://www.google.com/");
102 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString)); 102 EXPECT_EQ(data.plain_text, base::SysNSStringToUTF16(textString));
103 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString)); 103 EXPECT_EQ(data.text_html, base::SysNSStringToUTF16(htmlString));
104 104
105 [pboard releaseGlobally]; 105 [pboard releaseGlobally];
106 } 106 }
107 107
108 TEST_F(WebDropTargetTest, EnterExitDrop) { 108 TEST_F(WebDropTargetTest, DISABLED_EnterExitDrop) {
109 // TODO(pinkerton): Call enter/exit/drop and see what happens. This is a bit 109 // TODO(pinkerton): Call enter/exit/drop and see what happens. This is a bit
110 // harder to test. 110 // harder to test.
111 } 111 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698