diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 14:20:54 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 14:20:54 +0000 |
commit | 06c7acaf1674b0b0fc91fe8f86144729fb7e9e57 (patch) | |
tree | 184c8dba6742fa38de2b91a08b47be971bea79b0 /chrome | |
parent | fa6ebe2bd946c49c06039fcccbc3578117569931 (diff) | |
download | chromium_src-06c7acaf1674b0b0fc91fe8f86144729fb7e9e57.zip chromium_src-06c7acaf1674b0b0fc91fe8f86144729fb7e9e57.tar.gz chromium_src-06c7acaf1674b0b0fc91fe8f86144729fb7e9e57.tar.bz2 |
Remove deprecated code in cocoa_test_helper.h.
BUG=none
TEST=unit_tests
Review URL: http://codereview.chromium.org/3129004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/cocoa_test_helper.h | 65 | ||||
-rw-r--r-- | chrome/browser/cocoa/html_dialog_window_controller_unittest.mm | 5 |
2 files changed, 2 insertions, 68 deletions
diff --git a/chrome/browser/cocoa/cocoa_test_helper.h b/chrome/browser/cocoa/cocoa_test_helper.h index 70fe78e..dce544e 100644 --- a/chrome/browser/cocoa/cocoa_test_helper.h +++ b/chrome/browser/cocoa/cocoa_test_helper.h @@ -124,71 +124,6 @@ class CocoaTest : public PlatformTest { [test_view display]; \ } -// The classes below are deprecated and will be removed shortly. Do not write -// any tests based on them. - -// A class that initializes Cocoa and sets up resources for many of our -// Cocoa controller unit tests. It does several key things: -// - Creates and displays an empty Cocoa window for views to live in -// - Loads the appropriate bundle so nib loading works. When loading the -// nib in the class being tested, your must use |mac_util::MainAppBundle()| -// as the bundle. If you do not specify a bundle, your test will likely -// fail. -// It currently does not create an autorelease pool, though that can easily be -// added. If your test wants one, it can derive from PlatformTest instead of -// testing::Test. - -// Provides the Cocoa goodness without the extraneous window. - -// DEPRECATED -// TODO(dmaclach): remove as soon as I can get my other CLs in that get rid -// of any dependencies on this. 10/30/09 at the latest. -class CocoaNoWindowTestHelper { - public: - CocoaNoWindowTestHelper() { - CocoaTest::BootstrapCocoa(); - - // Set the duration of AppKit-evaluated animations (such as frame changes) - // to zero for testing purposes. That way they take effect immediately. - [[NSAnimationContext currentContext] setDuration:0.0]; - } -}; - -// DEPRECATED -// TODO(dmaclach): remove as soon as I can get my other CLs in that get rid -// of any dependencies on this. 11/30/09 at the latest. -class CocoaTestHelper : public CocoaNoWindowTestHelper { - public: - CocoaTestHelper() { - window_.reset([[CocoaTestHelperWindow alloc] init]); - if (DebugUtil::BeingDebugged()) { - [window_ orderFront:nil]; - } else { - [window_ orderBack:nil]; - } - } - - // Access the Cocoa window created for the test. - NSWindow* window() const { return window_.get(); } - NSView* contentView() const { return [window_ contentView]; } - - // Set |window_| to pretend to be key and make |aView| its - // firstResponder. - void makeFirstResponder(NSView* aView) { - [window_ makeFirstResponder:aView]; - [window_ setPretendIsKeyWindow:YES]; - } - - // Clear |window_| firstResponder and stop pretending to be key. - void clearFirstResponder() { - [window_ setPretendIsKeyWindow:NO]; - [window_ makeFirstResponder:nil]; - } - - private: - scoped_nsobject<CocoaTestHelperWindow> window_; -}; - // A macro which determines the proper float epsilon for a CGFloat. #if CGFLOAT_IS_DOUBLE #define CGFLOAT_EPSILON DBL_EPSILON diff --git a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm index 8b64443..932c266 100644 --- a/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm +++ b/chrome/browser/cocoa/html_dialog_window_controller_unittest.mm @@ -40,6 +40,7 @@ class HtmlDialogWindowControllerTest : public BrowserWithTestWindowTest { public: virtual void SetUp() { BrowserWithTestWindowTest::SetUp(); + CocoaTest::BootstrapCocoa(); title_ = L"Mock Title"; size_ = gfx::Size(50, 100); gurl_ = GURL(""); @@ -51,7 +52,6 @@ class HtmlDialogWindowControllerTest : public BrowserWithTestWindowTest { GURL gurl_; // Order here is important. - CocoaTestHelper cocoa_helper_; MockDelegate delegate_; }; @@ -65,8 +65,7 @@ using ::testing::SetArgumentPointee; TEST_F(HtmlDialogWindowControllerTest, showDialog) { // We want to make sure html_dialog_window_controller below gets - // destroyed before cocoa_helper_ and delegate_, so we specify our - // own autorelease pool. + // destroyed before delegate_, so we specify our own autorelease pool. // // TODO(dmaclach): Remove this once // http://code.google.com/p/chromium/issues/detail?id=26133 is fixed. |