summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 18:38:10 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 18:38:10 +0000
commit036d0771d2c0de61eb4897dc95c436f965118db4 (patch)
tree6bf68e3d2cf9bb97fd43a0502710617226ef28b1
parentb17a1a7fa91f4416b31fbc6fc622b901e37ae199 (diff)
downloadchromium_src-036d0771d2c0de61eb4897dc95c436f965118db4.zip
chromium_src-036d0771d2c0de61eb4897dc95c436f965118db4.tar.gz
chromium_src-036d0771d2c0de61eb4897dc95c436f965118db4.tar.bz2
Removes notification observers at the end of each CustomHomePagesModel unittest.
This gets rid of some scary warnings and may also fix a flaky test. BUG=http://crbug.com/17452 TEST=None Review URL: http://codereview.chromium.org/160643 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22501 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/custom_home_pages_model_unittest.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/custom_home_pages_model_unittest.mm b/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
index 645dfef..30a3261 100644
--- a/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
+++ b/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
@@ -86,6 +86,8 @@ TEST_F(CustomHomePagesModelTest, KVOObserveWhenListChanges) {
urls.push_back(GURL("http://www.google.com"));
[model_ setURLs:urls]; // Should send kvo change notification.
EXPECT_TRUE(kvo_helper.get()->sawNotification_);
+
+ [model_ removeObserver:kvo_helper forKeyPath:@"customHomePages"];
}
// Test the KVO "to-many" bindings for |customHomePages| and the KVO
@@ -120,6 +122,8 @@ TEST_F(CustomHomePagesModelTest, KVO) {
isEqualToString:@"dev.chromium.org"]);
EXPECT_TRUE([[model_ objectInCustomHomePagesAtIndex:0]
isEqualToString:@"www.google.com"]);
+
+ [model_ removeObserver:kvo_helper forKeyPath:@"customHomePages"];
}
// Test that when individual items are changed that they broadcast a message.
@@ -139,4 +143,5 @@ TEST_F(CustomHomePagesModelTest, DISABLED_ModelChangedNotification) {
id entry = [model_ objectInCustomHomePagesAtIndex:0];
[entry setURL:@"http://www.foo.bar"];
EXPECT_TRUE(kvo_helper.get()->sawNotification_);
+ [[NSNotificationCenter defaultCenter] removeObserver:kvo_helper];
}