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

Unified Diff: chrome/browser/cocoa/chrome_event_processing_window_unittest.mm

Issue 334016: First set of unittest fixes. Many more to come ;-)... (Closed) Base URL: svn://svn.chromium.org/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/cocoa/extension_shelf_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/chrome_event_processing_window_unittest.mm
===================================================================
--- chrome/browser/cocoa/chrome_event_processing_window_unittest.mm (revision 29973)
+++ chrome/browser/cocoa/chrome_event_processing_window_unittest.mm (working copy)
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import <Cocoa/Cocoa.h>
#include "base/scoped_nsobject.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -10,8 +9,6 @@
#import "chrome/browser/cocoa/browser_window_controller.h"
#import "chrome/browser/cocoa/browser_frame_view.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
namespace {
@@ -29,17 +26,18 @@
keyCode:keyCode];
}
-class ChromeEventProcessingWindowTest : public PlatformTest {
+class ChromeEventProcessingWindowTest : public CocoaTest {
public:
- ChromeEventProcessingWindowTest() {
+ virtual void SetUp() {
+ CocoaTest::SetUp();
// Create a window.
const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask;
- window_.reset([[ChromeEventProcessingWindow alloc]
- initWithContentRect:NSMakeRect(0, 0, 800, 600)
- styleMask:mask
- backing:NSBackingStoreBuffered
- defer:NO]);
+ window_ = [[ChromeEventProcessingWindow alloc]
+ initWithContentRect:NSMakeRect(0, 0, 800, 600)
+ styleMask:mask
+ backing:NSBackingStoreBuffered
+ defer:NO];
if (DebugUtil::BeingDebugged()) {
[window_ orderFront:nil];
} else {
@@ -47,6 +45,11 @@
}
}
+ virtual void TearDown() {
+ [window_ close];
+ CocoaTest::TearDown();
+ }
+
// Returns a canonical snapshot of the window.
NSData* WindowContentsAsTIFF() {
NSRect frame([window_ frame]);
@@ -60,8 +63,7 @@
return [image TIFFRepresentation];
}
- CocoaNoWindowTestHelper cocoa_helper_;
- scoped_nsobject<ChromeEventProcessingWindow> window_;
+ ChromeEventProcessingWindow* window_;
};
// Verify that the window intercepts a particular key event and
@@ -107,5 +109,4 @@
[delegate verify];
}
-
} // namespace
« no previous file with comments | « no previous file | chrome/browser/cocoa/extension_shelf_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698