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

Side by Side Diff: ios/chrome/browser/ui/settings/sync_settings_collection_view_controller_unittest.mm

Issue 2806323003: [ObjC ARC] Converts ios/chrome/browser/ui/settings:unit_tests to ARC. (Closed)
Patch Set: rebase Created 3 years, 8 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 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/chrome/browser/ui/settings/sync_settings_collection_view_controller .h" 5 #import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller .h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #import "base/mac/foundation_util.h" 9 #import "base/mac/foundation_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 12 matching lines...) Expand all
23 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h " 23 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h "
24 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" 24 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
25 #import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h" 25 #import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h"
26 #import "ios/chrome/browser/ui/settings/cells/text_and_error_item.h" 26 #import "ios/chrome/browser/ui/settings/cells/text_and_error_item.h"
27 #import "ios/chrome/browser/ui/sync/sync_util.h" 27 #import "ios/chrome/browser/ui/sync/sync_util.h"
28 #include "ios/chrome/grit/ios_strings.h" 28 #include "ios/chrome/grit/ios_strings.h"
29 #include "ios/web/public/test/test_web_thread_bundle.h" 29 #include "ios/web/public/test/test_web_thread_bundle.h"
30 #import "testing/gtest_mac.h" 30 #import "testing/gtest_mac.h"
31 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
32 32
33 #if !defined(__has_feature) || !__has_feature(objc_arc)
34 #error "This file requires ARC support."
35 #endif
36
33 @interface SyncSettingsCollectionViewController (ExposedForTesting) 37 @interface SyncSettingsCollectionViewController (ExposedForTesting)
34 - (int)titleIdForSyncableDataType:(SyncSetupService::SyncableDatatype)datatype; 38 - (int)titleIdForSyncableDataType:(SyncSetupService::SyncableDatatype)datatype;
35 - (void)onSyncStateChanged; 39 - (void)onSyncStateChanged;
36 @end 40 @end
37 41
38 namespace { 42 namespace {
39 43
40 using testing::DefaultValue; 44 using testing::DefaultValue;
41 using testing::NiceMock; 45 using testing::NiceMock;
42 using testing::Return; 46 using testing::Return;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 chrome_browser_state_.get())); 181 chrome_browser_state_.get()));
178 ON_CALL(*mock_profile_sync_service_, IsEngineInitialized()) 182 ON_CALL(*mock_profile_sync_service_, IsEngineInitialized())
179 .WillByDefault(Return(true)); 183 .WillByDefault(Return(true));
180 ON_CALL(*mock_profile_sync_service_, GetRegisteredDataTypes()) 184 ON_CALL(*mock_profile_sync_service_, GetRegisteredDataTypes())
181 .WillByDefault(Return(syncer::ModelTypeSet())); 185 .WillByDefault(Return(syncer::ModelTypeSet()));
182 mock_profile_sync_service_->Initialize(); 186 mock_profile_sync_service_->Initialize();
183 EXPECT_CALL(*mock_profile_sync_service_, GetPreferredDataTypes()) 187 EXPECT_CALL(*mock_profile_sync_service_, GetPreferredDataTypes())
184 .WillRepeatedly(Return(syncer::UserSelectableTypes())); 188 .WillRepeatedly(Return(syncer::UserSelectableTypes()));
185 } 189 }
186 190
187 CollectionViewController* NewController() override { 191 CollectionViewController* InstantiateController() override {
188 return [[SyncSettingsCollectionViewController alloc] 192 return [[SyncSettingsCollectionViewController alloc]
189 initWithBrowserState:chrome_browser_state_.get() 193 initWithBrowserState:chrome_browser_state_.get()
190 allowSwitchSyncAccount:YES]; 194 allowSwitchSyncAccount:YES];
191 } 195 }
192 196
193 SyncSettingsCollectionViewController* CreateSyncController() { 197 SyncSettingsCollectionViewController* CreateSyncController() {
194 CreateController(); 198 CreateController();
195 CheckTitleWithId(IDS_IOS_SYNC_SETTING_TITLE); 199 CheckTitleWithId(IDS_IOS_SYNC_SETTING_TITLE);
196 return static_cast<SyncSettingsCollectionViewController*>(controller()); 200 return static_cast<SyncSettingsCollectionViewController*>(controller());
197 } 201 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 354
351 TurnSyncErrorOff(); 355 TurnSyncErrorOff();
352 [sync_controller onSyncStateChanged]; 356 [sync_controller onSyncStateChanged];
353 encryptionItem = GetCollectionViewItem(2, 0); 357 encryptionItem = GetCollectionViewItem(2, 0);
354 EXPECT_NSEQ(encryptionItem.text, 358 EXPECT_NSEQ(encryptionItem.text,
355 l10n_util::GetNSString(IDS_IOS_SYNC_ENCRYPTION_TITLE)); 359 l10n_util::GetNSString(IDS_IOS_SYNC_ENCRYPTION_TITLE));
356 CheckErrorIcon(NO, 2, 0); 360 CheckErrorIcon(NO, 2, 0);
357 } 361 }
358 362
359 } // namespace 363 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698