OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #include <dlfcn.h> | 6 #include <dlfcn.h> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #import "base/memory/scoped_nsobject.h" | 9 #import "base/memory/scoped_nsobject.h" |
10 #import "chrome/browser/ui/cocoa/objc_zombie.h" | 10 #import "chrome/common/mac/objc_zombie.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Dynamically look up |objc_setAssociatedObject()|, which isn't | 16 // Dynamically look up |objc_setAssociatedObject()|, which isn't |
17 // available until the 10.6 SDK. | 17 // available until the 10.6 SDK. |
18 | 18 |
19 typedef void objc_setAssociatedObjectFn(id object, void *key, id value, | 19 typedef void objc_setAssociatedObjectFn(id object, void *key, id value, |
20 int policy); | 20 int policy); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // should be released. | 125 // should be released. |
126 soonInfected.reset(); | 126 soonInfected.reset(); |
127 EXPECT_EQ(1u, [anObject retainCount]); | 127 EXPECT_EQ(1u, [anObject retainCount]); |
128 | 128 |
129 // The local reference should remain (associated objects not re-released). | 129 // The local reference should remain (associated objects not re-released). |
130 ObjcEvilDoers::ZombieDisable(); | 130 ObjcEvilDoers::ZombieDisable(); |
131 EXPECT_EQ(1u, [anObject retainCount]); | 131 EXPECT_EQ(1u, [anObject retainCount]); |
132 } | 132 } |
133 | 133 |
134 } // namespace | 134 } // namespace |
OLD | NEW |