summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/autocomplete_text_field_unittest.mm
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-05 00:56:56 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-05 00:56:56 +0000
commit3266992f388387cb5f731cb36fa75d5ac65a7901 (patch)
treeb3df8fcd06bae3aa200285aac00b289d111d5da0 /chrome/browser/cocoa/autocomplete_text_field_unittest.mm
parent8c96af8431a78412ce6cdec1f5d0cf2c0a2f1e9a (diff)
downloadchromium_src-3266992f388387cb5f731cb36fa75d5ac65a7901.zip
chromium_src-3266992f388387cb5f731cb36fa75d5ac65a7901.tar.gz
chromium_src-3266992f388387cb5f731cb36fa75d5ac65a7901.tar.bz2
[Mac] Add testing code to expose an NSColor memory leak.
AutocompleteTextFieldCell calls -keyboardFocusIndicatorColor when drawing the focus ring, which valgrind considers a leak. While we were testing drawing when not focussed, unit tests could not test drawing when focussed without the window being made key, which is bad for many reasons. This change adds some code to allow faking the key window, then adds tests for drawing when focussed which exposes the memory leak, then adds a suppression for that memory leak. http://crbug.com/21137 TEST=valgrind AutocompleteTextFieldCellTest.Display Review URL: http://codereview.chromium.org/192031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/autocomplete_text_field_unittest.mm')
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field_unittest.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field_unittest.mm b/chrome/browser/cocoa/autocomplete_text_field_unittest.mm
index f8db667..2ae0cdf 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_unittest.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_unittest.mm
@@ -85,6 +85,11 @@ TEST_F(AutocompleteTextFieldTest, Cell) {
TEST_F(AutocompleteTextFieldTest, Display) {
[field_ display];
+ // Test focussed drawing.
+ cocoa_helper_.makeFirstResponder(field_);
+ [field_ display];
+ cocoa_helper_.clearFirstResponder();
+
// Test display of various cell configurations.
AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];