OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/session_startup_pref.h" | 8 #include "chrome/browser/prefs/session_startup_pref.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #import "testing/gtest_mac.h" | 10 #import "testing/gtest_mac.h" |
11 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
12 | 12 |
13 // A helper for KVO and NSNotifications. Makes a note that it's been called | 13 // A helper for KVO and NSNotifications. Makes a note that it's been called |
14 // back. | 14 // back. |
15 @interface CustomHomePageHelper : NSObject { | 15 @interface CustomHomePageHelper : NSObject { |
16 @public | 16 @public |
17 BOOL sawNotification_; | 17 BOOL sawNotification_; |
18 } | 18 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 EXPECT_TRUE(kvo_helper.get()->sawNotification_); | 188 EXPECT_TRUE(kvo_helper.get()->sawNotification_); |
189 EXPECT_EQ([model_ countOfCustomHomePages], 1U); | 189 EXPECT_EQ([model_ countOfCustomHomePages], 1U); |
190 EXPECT_NSEQ(@"http://www.google.com/", | 190 EXPECT_NSEQ(@"http://www.google.com/", |
191 EntryURL([model_ objectInCustomHomePagesAtIndex:0])); | 191 EntryURL([model_ objectInCustomHomePagesAtIndex:0])); |
192 | 192 |
193 [model_ removeObserver:kvo_helper.get() forKeyPath:@"customHomePages"]; | 193 [model_ removeObserver:kvo_helper.get() forKeyPath:@"customHomePages"]; |
194 } | 194 } |
195 | 195 |
196 } // namespace | 196 } // namespace |
OLD | NEW |