OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "chrome/browser/cocoa/browser_test_helper.h" | 6 #include "chrome/browser/cocoa/browser_test_helper.h" |
7 #import "chrome/browser/cocoa/custom_home_pages_model.h" | 7 #import "chrome/browser/cocoa/custom_home_pages_model.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 isEqualToString:@"www.google.com"]); | 125 isEqualToString:@"www.google.com"]); |
126 | 126 |
127 [model_ removeObserver:kvo_helper forKeyPath:@"customHomePages"]; | 127 [model_ removeObserver:kvo_helper forKeyPath:@"customHomePages"]; |
128 } | 128 } |
129 | 129 |
130 @interface NSObject() | 130 @interface NSObject() |
131 - (void)setURL:(NSString*)url; | 131 - (void)setURL:(NSString*)url; |
132 @end | 132 @end |
133 | 133 |
134 // Test that when individual items are changed that they broadcast a message. | 134 // Test that when individual items are changed that they broadcast a message. |
135 // Crashy, see http://crbug.com/17452. | 135 TEST_F(CustomHomePagesModelTest, ModelChangedNotification) { |
136 TEST_F(CustomHomePagesModelTest, DISABLED_ModelChangedNotification) { | |
137 scoped_nsobject<CustomHomePageHelper> kvo_helper( | 136 scoped_nsobject<CustomHomePageHelper> kvo_helper( |
138 [[CustomHomePageHelper alloc] init]); | 137 [[CustomHomePageHelper alloc] init]); |
139 [[NSNotificationCenter defaultCenter] | 138 [[NSNotificationCenter defaultCenter] |
140 addObserver:kvo_helper | 139 addObserver:kvo_helper |
141 selector:@selector(entryChanged:) | 140 selector:@selector(entryChanged:) |
142 name:kHomepageEntryChangedNotification | 141 name:kHomepageEntryChangedNotification |
143 object:nil]; | 142 object:nil]; |
144 | 143 |
145 std::vector<GURL> urls; | 144 std::vector<GURL> urls; |
146 urls.push_back(GURL("http://www.google.com")); | 145 urls.push_back(GURL("http://www.google.com")); |
147 [model_ setURLs:urls]; | 146 [model_ setURLs:urls]; |
148 NSObject* entry = [model_ objectInCustomHomePagesAtIndex:0]; | 147 NSObject* entry = [model_ objectInCustomHomePagesAtIndex:0]; |
149 [entry setURL:@"http://www.foo.bar"]; | 148 [entry setURL:@"http://www.foo.bar"]; |
150 EXPECT_TRUE(kvo_helper.get()->sawNotification_); | 149 EXPECT_TRUE(kvo_helper.get()->sawNotification_); |
151 [[NSNotificationCenter defaultCenter] removeObserver:kvo_helper]; | 150 [[NSNotificationCenter defaultCenter] removeObserver:kvo_helper]; |
152 } | 151 } |
OLD | NEW |