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

Side by Side Diff: ios/chrome/browser/ui/keyboard/hardware_keyboard_watcher_unittest.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
« no previous file with comments | « ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/hardware_keyboard_watcher.h" 5 #import "ios/chrome/browser/ui/keyboard/hardware_keyboard_watcher.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
11 #import "third_party/ocmock/OCMock/OCMock.h" 11 #import "third_party/ocmock/OCMock/OCMock.h"
12 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support."
15 #endif
16
13 namespace { 17 namespace {
14 18
15 void PostKeyboardWillChangeNotification(CGRect beginFrame, CGRect endFrame) { 19 void PostKeyboardWillChangeNotification(CGRect beginFrame, CGRect endFrame) {
16 [[NSNotificationCenter defaultCenter] 20 [[NSNotificationCenter defaultCenter]
17 postNotificationName:UIKeyboardWillChangeFrameNotification 21 postNotificationName:UIKeyboardWillChangeFrameNotification
18 object:nil 22 object:nil
19 userInfo:@{ 23 userInfo:@{
20 UIKeyboardFrameBeginUserInfoKey : 24 UIKeyboardFrameBeginUserInfoKey :
21 [NSValue valueWithCGRect:beginFrame], 25 [NSValue valueWithCGRect:beginFrame],
22 UIKeyboardFrameEndUserInfoKey : 26 UIKeyboardFrameEndUserInfoKey :
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 [[HardwareKeyboardWatcher alloc] initWithAccessoryView:mockView]); 113 [[HardwareKeyboardWatcher alloc] initWithAccessoryView:mockView]);
110 114
111 PostKeyboardWillChangeNotification(CGRectMake(0, -50, 100, 100), 115 PostKeyboardWillChangeNotification(CGRectMake(0, -50, 100, 100),
112 CGRectMake(0, 0, 100, 100)); 116 CGRectMake(0, 0, 100, 100));
113 117
114 histogram_tester.ExpectUniqueSample("Omnibox.HardwareKeyboardModeEnabled", 118 histogram_tester.ExpectUniqueSample("Omnibox.HardwareKeyboardModeEnabled",
115 true, 1); 119 true, 1);
116 } 120 }
117 121
118 } // namespace 122 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698