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

Unified Diff: base/mac/mac_util_unittest.mm

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with NSApp changes in r73581 Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mac/mac_util.mm ('k') | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_util_unittest.mm
diff --git a/base/mac/mac_util_unittest.mm b/base/mac/mac_util_unittest.mm
index 17fc04f03224fd87f6c3b324efa8b3432ca050e0..bae00194787e8ee7587799dc957d1a19ee633783 100644
--- a/base/mac/mac_util_unittest.mm
+++ b/base/mac/mac_util_unittest.mm
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
-#include <vector>
#include "base/mac/mac_util.h"
@@ -11,7 +10,6 @@
#include "base/file_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/scoped_nsobject.h"
-#include "base/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -52,36 +50,6 @@ TEST_F(MacUtilTest, TestLibraryPath) {
EXPECT_FALSE(library_dir.value().empty());
}
-TEST_F(MacUtilTest, TestGrabWindowSnapshot) {
- // Launch a test window so we can take a snapshot.
- NSRect frame = NSMakeRect(0, 0, 400, 400);
- scoped_nsobject<NSWindow> window(
- [[NSWindow alloc] initWithContentRect:frame
- styleMask:NSBorderlessWindowMask
- backing:NSBackingStoreBuffered
- defer:NO]);
- [window setBackgroundColor:[NSColor whiteColor]];
- [window makeKeyAndOrderFront:NSApp];
-
- scoped_ptr<std::vector<unsigned char> > png_representation(
- new std::vector<unsigned char>);
- int width, height;
- GrabWindowSnapshot(window, png_representation.get(),
- &width, &height);
-
- // Copy png back into NSData object so we can make sure we grabbed a png.
- scoped_nsobject<NSData> image_data(
- [[NSData alloc] initWithBytes:&(*png_representation)[0]
- length:png_representation->size()]);
- NSBitmapImageRep* rep = [NSBitmapImageRep imageRepWithData:image_data.get()];
- EXPECT_TRUE([rep isKindOfClass:[NSBitmapImageRep class]]);
- EXPECT_TRUE(CGImageGetWidth([rep CGImage]) == 400);
- NSColor* color = [rep colorAtX:200 y:200];
- CGFloat red = 0, green = 0, blue = 0, alpha = 0;
- [color getRed:&red green:&green blue:&blue alpha:&alpha];
- EXPECT_GE(red + green + blue, 3.0);
-}
-
TEST_F(MacUtilTest, TestGetAppBundlePath) {
FilePath out;
« no previous file with comments | « base/mac/mac_util.mm ('k') | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698