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 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "base/mac/closure_blocks_leopard_compat.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "content/browser/mac/closure_blocks_leopard_compat.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 // Used in ClosureBlocksLeopardCompatTest.Global. Putting a block at global | 10 // Used in ClosureBlocksLeopardCompatTest.Global. Putting a block at global |
11 // scope results in a block structure whose isa field is set to | 11 // scope results in a block structure whose isa field is set to |
12 // NSConcreteGlobalBlock, ensuring that symbol is referenced. This test needs | 12 // NSConcreteGlobalBlock, ensuring that symbol is referenced. This test needs |
13 // to be able to load on 10.5 where that symbol is not present at runtime, so | 13 // to be able to load on 10.5 where that symbol is not present at runtime, so |
14 // the real test here is that the symbol is weakly imported. If not, the | 14 // the real test here is that the symbol is weakly imported. If not, the |
15 // executable will fail to load. | 15 // executable will fail to load. |
16 void (^global_block)(bool*) = ^(bool* ran_pointer) { *ran_pointer = true; }; | 16 void (^global_block)(bool*) = ^(bool* ran_pointer) { *ran_pointer = true; }; |
17 | 17 |
18 namespace { | 18 namespace { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 Block_release(copied_block); | 90 Block_release(copied_block); |
91 | 91 |
92 rv = local_block(); | 92 rv = local_block(); |
93 EXPECT_EQ(4, rv); | 93 EXPECT_EQ(4, rv); |
94 EXPECT_EQ(rv, value); | 94 EXPECT_EQ(rv, value); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 } // namespace | 98 } // namespace |
OLD | NEW |