diff options
| author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 23:53:51 +0000 |
|---|---|---|
| committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 23:53:51 +0000 |
| commit | 01c022ac4ee3ba1c3840544f3493cf0690e03125 (patch) | |
| tree | d766d13e66261240e6393ceb7b601ea0c24d1706 /chrome/browser/cocoa/cocoa_test_helper.h | |
| parent | 28d0c9c14970a0e1c3c6dcc0746529446c692393 (diff) | |
| download | chromium_src-01c022ac4ee3ba1c3840544f3493cf0690e03125.zip chromium_src-01c022ac4ee3ba1c3840544f3493cf0690e03125.tar.gz chromium_src-01c022ac4ee3ba1c3840544f3493cf0690e03125.tar.bz2 | |
[Mac] Window titles for Expose.
http://crbug.com/18854
TEST=Titles on mouse-over in Expose. No extra title in titlebar.
Review URL: http://codereview.chromium.org/259023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/cocoa_test_helper.h')
| -rw-r--r-- | chrome/browser/cocoa/cocoa_test_helper.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/cocoa_test_helper.h b/chrome/browser/cocoa/cocoa_test_helper.h index ebcb4d4..8eb3438 100644 --- a/chrome/browser/cocoa/cocoa_test_helper.h +++ b/chrome/browser/cocoa/cocoa_test_helper.h @@ -47,9 +47,14 @@ // added. If your test wants one, it can derive from PlatformTest instead of // testing::Test. -class CocoaTestHelper { +// Provides the Cocoa goodness without the extraneous window. +// TODO(shess): It might make more sense to have CocoaTest as a +// PlatformTest subclass which adds the Cocoa magic, then +// CocoaViewTest as a further subclass which provides a convenience +// window. +class CocoaNoWindowTestHelper { public: - CocoaTestHelper() { + CocoaNoWindowTestHelper() { // Look in the framework bundle for resources. FilePath path; PathService::Get(base::DIR_EXE, &path); @@ -62,17 +67,21 @@ class CocoaTestHelper { // Bootstrap Cocoa. It's very unhappy without this. [NSApplication sharedApplication]; - // Create a window. + // 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]; + } +}; + +class CocoaTestHelper : public CocoaNoWindowTestHelper { + public: + CocoaTestHelper() { window_.reset([[CocoaTestHelperWindow alloc] init]); if (DebugUtil::BeingDebugged()) { [window_ orderFront:nil]; } else { [window_ orderBack:nil]; } - - // 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]; } // Access the Cocoa window created for the test. |
