Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: base/ios/crb_protocol_observers_unittest.mm

Issue 1171203004: Correct iOS build for latest Xcode beta. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UNAVAILABLE_ATTRIBUTE->NS_UNAVAILABLE Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/ios/crb_protocol_observers.h" 5 #import "base/ios/crb_protocol_observers.h"
6 #include "base/ios/weak_nsobject.h" 6 #include "base/ios/weak_nsobject.h"
sdefresne 2015/06/10 16:15:55 #include "base/logging.h" so that you don't break
justincohen 2015/06/10 16:33:35 Done.
7 #include "base/mac/scoped_nsautorelease_pool.h" 7 #include "base/mac/scoped_nsautorelease_pool.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/gtest_mac.h" 10 #include "testing/gtest_mac.h"
11 #include "testing/platform_test.h" 11 #include "testing/platform_test.h"
12 12
13 @protocol TestObserver 13 @protocol TestObserver
14 14
15 @required 15 @required
16 - (void)requiredMethod; 16 - (void)requiredMethod;
(...skipping 12 matching lines...) Expand all
29 @interface TestPartialObserver : NSObject<TestObserver> 29 @interface TestPartialObserver : NSObject<TestObserver>
30 @property(nonatomic, readonly) BOOL requiredMethodInvoked; 30 @property(nonatomic, readonly) BOOL requiredMethodInvoked;
31 @end 31 @end
32 32
33 // Implements all the methods in the TestObserver protocol. 33 // Implements all the methods in the TestObserver protocol.
34 @interface TestCompleteObserver : TestPartialObserver<TestObserver> 34 @interface TestCompleteObserver : TestPartialObserver<TestObserver>
35 @property(nonatomic, readonly) BOOL optionalMethodInvoked; 35 @property(nonatomic, readonly) BOOL optionalMethodInvoked;
36 @end 36 @end
37 37
38 @interface TestMutateObserver : TestCompleteObserver 38 @interface TestMutateObserver : TestCompleteObserver
39 39 - (instancetype)init NS_UNAVAILABLE;
40 - (instancetype)initWithObserver:(CRBProtocolObservers*)observer 40 - (instancetype)initWithObserver:(CRBProtocolObservers*)observer
41 NS_DESIGNATED_INITIALIZER; 41 NS_DESIGNATED_INITIALIZER;
42 42
43 @end 43 @end
44 44
45 namespace { 45 namespace {
46 46
47 class CRBProtocolObserversTest : public PlatformTest { 47 class CRBProtocolObserversTest : public PlatformTest {
48 public: 48 public:
49 CRBProtocolObserversTest() {} 49 CRBProtocolObserversTest() {}
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 [super reset]; 251 [super reset];
252 _optionalMethodInvoked = NO; 252 _optionalMethodInvoked = NO;
253 } 253 }
254 254
255 @end 255 @end
256 256
257 @implementation TestMutateObserver { 257 @implementation TestMutateObserver {
258 __weak id _observers; 258 __weak id _observers;
259 } 259 }
260 260
261 - (instancetype)init {
262 NOTREACHED();
263 return nil;
264 }
265
261 - (instancetype)initWithObserver:(CRBProtocolObservers*)observers { 266 - (instancetype)initWithObserver:(CRBProtocolObservers*)observers {
262 self = [super init]; 267 self = [super init];
263 if (self) { 268 if (self) {
264 _observers = observers; 269 _observers = observers;
265 } 270 }
266 return self; 271 return self;
267 } 272 }
268 273
269 - (void)mutateByAddingObserver:(id<TestObserver>)observer { 274 - (void)mutateByAddingObserver:(id<TestObserver>)observer {
270 [_observers addObserver:observer]; 275 [_observers addObserver:observer];
271 } 276 }
272 277
273 - (void)mutateByRemovingObserver:(id<TestObserver>)observer { 278 - (void)mutateByRemovingObserver:(id<TestObserver>)observer {
274 [_observers removeObserver:observer]; 279 [_observers removeObserver:observer];
275 } 280 }
276 281
277 - (void)nestedMutateByAddingObserver:(id<TestObserver>)observer { 282 - (void)nestedMutateByAddingObserver:(id<TestObserver>)observer {
278 [_observers mutateByAddingObserver:observer]; 283 [_observers mutateByAddingObserver:observer];
279 } 284 }
280 285
281 - (void)nestedMutateByRemovingObserver:(id<TestObserver>)observer { 286 - (void)nestedMutateByRemovingObserver:(id<TestObserver>)observer {
282 [_observers mutateByRemovingObserver:observer]; 287 [_observers mutateByRemovingObserver:observer];
283 } 288 }
284 289
285 @end 290 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/infobars/infobar_controller.h » ('j') | ios/crnet/crnet_environment.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698