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

Side by Side Diff: ios/web/alloc_with_zone_interceptor_unittest.mm

Issue 2577353003: [ios] Removed alloc_with_zone_interceptor as unused. (Closed)
Patch Set: Created 4 years 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/web/alloc_with_zone_interceptor.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/web/alloc_with_zone_interceptor.h"
6
7 #include "base/mac/scoped_nsobject.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/gtest_mac.h"
10 #include "testing/platform_test.h"
11
12 // Testable class to test web::AddAllocWithZoneMethod.
13 @interface CRBTestAlloc : NSObject
14 @end
15 @implementation CRBTestAlloc
16 @end
17
18 namespace web {
19 namespace {
20
21 // Test fixture for alloc_with_zone_interceptor functions.
22 typedef PlatformTest AllocWithZoneInterceptorTest;
23
24 // Tests that AddAllocWithZoneMethod delegates allocation to the caller.
25 TEST_F(AllocWithZoneInterceptorTest, AddAllocWithZoneMethod) {
26 NSZone* const kZone = NSDefaultMallocZone();
27 base::scoped_nsobject<CRBTestAlloc> original_result(
28 [CRBTestAlloc allocWithZone:kZone]);
29 ASSERT_TRUE([original_result isMemberOfClass:[CRBTestAlloc class]]);
30 NSString* const kResult = @"test-result";
31 AddAllocWithZoneMethod([CRBTestAlloc class], ^id(Class klass, NSZone* zone) {
32 EXPECT_EQ([CRBTestAlloc class], klass);
33 EXPECT_EQ(kZone, zone);
34 return kResult;
35 });
36 EXPECT_NSEQ(kResult, [CRBTestAlloc allocWithZone:kZone]);
37 }
38
39 } // namespace
40 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/alloc_with_zone_interceptor.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698