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

Side by Side Diff: ios/chrome/app/deferred_initialization_runner_unittest.mm

Issue 2935713002: [ObjC ARC] Converts ios/chrome/app:unit_tests to ARC. (Closed)
Patch Set: Removed spurious include. Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/app/deferred_initialization_runner.h" 5 #import "ios/chrome/app/deferred_initialization_runner.h"
6 6
7 #import "base/test/ios/wait_util.h" 7 #import "base/test/ios/wait_util.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "testing/platform_test.h" 9 #include "testing/platform_test.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 TEST(DeferredInitializationRunnerTest, TestSharedInstance) { 15 TEST(DeferredInitializationRunnerTest, TestSharedInstance) {
12 EXPECT_TRUE([DeferredInitializationRunner sharedInstance]); 16 EXPECT_TRUE([DeferredInitializationRunner sharedInstance]);
13 // Cancelling a non-existing block does nothing. 17 // Cancelling a non-existing block does nothing.
14 [[DeferredInitializationRunner sharedInstance] 18 [[DeferredInitializationRunner sharedInstance]
15 cancelBlockNamed:@"Invalid Name"]; 19 cancelBlockNamed:@"Invalid Name"];
16 } 20 }
17 21
18 // Tests that all blocks added on the queue are executed after a delay. 22 // Tests that all blocks added on the queue are executed after a delay.
19 TEST(DeferredInitializationRunnerTest, TestRunBlockSequentially) { 23 TEST(DeferredInitializationRunnerTest, TestRunBlockSequentially) {
20 // Setup. 24 // Setup.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // Action. 159 // Action.
156 [runner enqueueBlockNamed:@"multiple" block:runBlock]; 160 [runner enqueueBlockNamed:@"multiple" block:runBlock];
157 [runner enqueueBlockNamed:@"multiple" block:runBlock]; 161 [runner enqueueBlockNamed:@"multiple" block:runBlock];
158 162
159 // Test: |runBlock| was executed only once. 163 // Test: |runBlock| was executed only once.
160 EXPECT_EQ(1U, [runner numberOfBlocksRemaining]); 164 EXPECT_EQ(1U, [runner numberOfBlocksRemaining]);
161 [runner runBlockIfNecessary:@"multiple"]; 165 [runner runBlockIfNecessary:@"multiple"];
162 EXPECT_EQ(0U, [runner numberOfBlocksRemaining]); 166 EXPECT_EQ(0U, [runner numberOfBlocksRemaining]);
163 EXPECT_EQ(1, blockRunCount); 167 EXPECT_EQ(1, blockRunCount);
164 } 168 }
OLDNEW
« no previous file with comments | « ios/chrome/app/chrome_app_startup_parameters_unittest.mm ('k') | ios/chrome/app/main_application_delegate_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698