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

Side by Side Diff: ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm

Issue 2514863002: [ObjC ARC] Converts ios/chrome/browser/ui/keyboard:unit_tests to ARC.Automatically generated ARCM… (Closed)
Patch Set: Created 4 years, 1 month 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/keyboard/UIKeyCommand+Chrome.h" 5 #import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
10 namespace { 14 namespace {
11 15
12 // Tests that UIApplication correctly calls the keyboard command action block 16 // Tests that UIApplication correctly calls the keyboard command action block
13 // when invoked. 17 // when invoked.
14 TEST(UIKeyCommandChromeTest, UIApplicationHandleKeyCommand_CallsBlock) { 18 TEST(UIKeyCommandChromeTest, UIApplicationHandleKeyCommand_CallsBlock) {
15 __block BOOL called = NO; 19 __block BOOL called = NO;
16 UIKeyCommand* command = 20 UIKeyCommand* command =
17 [UIKeyCommand cr_keyCommandWithInput:@"" 21 [UIKeyCommand cr_keyCommandWithInput:@""
18 modifierFlags:Cr_UIKeyModifierNone 22 modifierFlags:Cr_UIKeyModifierNone
19 title:nil 23 title:nil
20 action:^{ 24 action:^{
21 called = YES; 25 called = YES;
22 }]; 26 }];
23 [[UIApplication sharedApplication] cr_handleKeyCommand:command]; 27 [[UIApplication sharedApplication] cr_handleKeyCommand:command];
24 EXPECT_TRUE(called); 28 EXPECT_TRUE(called);
25 } 29 }
26 30
27 } // namespace 31 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/keyboard/BUILD.gn ('k') | ios/chrome/browser/ui/keyboard/hardware_keyboard_watcher_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698