OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/web/public/crw_browsing_data_store.h" | 5 #import "ios/web/public/crw_browsing_data_store.h" |
6 | 6 |
7 #include "base/ios/ios_util.h" | 7 #include "base/ios/ios_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 @property(nonatomic, assign) NSUInteger modeChangeCount; | 25 @property(nonatomic, assign) NSUInteger modeChangeCount; |
26 | 26 |
27 // |browsingDataStore| cannot be null. | 27 // |browsingDataStore| cannot be null. |
28 - (instancetype)initWithBrowsingDataStore: | 28 - (instancetype)initWithBrowsingDataStore: |
29 (CRWBrowsingDataStore*)browsingDataStore NS_DESIGNATED_INITIALIZER; | 29 (CRWBrowsingDataStore*)browsingDataStore NS_DESIGNATED_INITIALIZER; |
30 - (instancetype)init NS_UNAVAILABLE; | 30 - (instancetype)init NS_UNAVAILABLE; |
31 @end | 31 @end |
32 | 32 |
33 @implementation CRWTestBrowsingDataStoreObserver { | 33 @implementation CRWTestBrowsingDataStoreObserver { |
34 // The underlying CRWBrowsingDataStore. | 34 // The underlying CRWBrowsingDataStore. |
35 __weak CRWBrowsingDataStore* _browsingDataStore; | 35 CRWBrowsingDataStore* _browsingDataStore; // weak |
36 } | 36 } |
37 | 37 |
38 @synthesize modeChangeCount = _modeChangeCount; | 38 @synthesize modeChangeCount = _modeChangeCount; |
39 | 39 |
40 - (instancetype)initWithBrowsingDataStore: | 40 - (instancetype)initWithBrowsingDataStore: |
41 (CRWBrowsingDataStore*)browsingDataStore { | 41 (CRWBrowsingDataStore*)browsingDataStore { |
42 self = [super init]; | 42 self = [super init]; |
43 if (self) { | 43 if (self) { |
44 DCHECK(browsingDataStore); | 44 DCHECK(browsingDataStore); |
45 [browsingDataStore addObserver:self | 45 [browsingDataStore addObserver:self |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 ASSERT_EQ(ACTIVE, [browsing_data_store_ mode]); | 241 ASSERT_EQ(ACTIVE, [browsing_data_store_ mode]); |
242 | 242 |
243 [browsing_data_store_ makeInactiveWithCompletionHandler:nil]; | 243 [browsing_data_store_ makeInactiveWithCompletionHandler:nil]; |
244 // |removeDataOfTypes| is called immediately after a |makeInactive| call. | 244 // |removeDataOfTypes| is called immediately after a |makeInactive| call. |
245 RemoveDataOfTypes(BROWSING_DATA_TYPE_COOKIES); | 245 RemoveDataOfTypes(BROWSING_DATA_TYPE_COOKIES); |
246 EXPECT_EQ(INACTIVE, [browsing_data_store_ mode]); | 246 EXPECT_EQ(INACTIVE, [browsing_data_store_ mode]); |
247 } | 247 } |
248 | 248 |
249 } // namespace web | 249 } // namespace web |
OLD | NEW |