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 // This file contains unit tests for InterceptionManager. | 5 // This file contains unit tests for InterceptionManager. |
6 // The tests require private information so the whole interception.cc file is | 6 // The tests require private information so the whole interception.cc file is |
7 // included from this file. | 7 // included from this file. |
8 | 8 |
| 9 #include <windows.h> |
| 10 #include <stddef.h> |
| 11 |
9 #include <algorithm> | 12 #include <algorithm> |
10 #include <set> | 13 #include <set> |
11 | 14 |
12 #include <windows.h> | |
13 | |
14 #include "base/bits.h" | 15 #include "base/bits.h" |
15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
16 #include "sandbox/win/src/interception.h" | 17 #include "sandbox/win/src/interception.h" |
| 18 #include "sandbox/win/src/interception_internal.h" |
17 #include "sandbox/win/src/interceptors.h" | 19 #include "sandbox/win/src/interceptors.h" |
18 #include "sandbox/win/src/interception_internal.h" | |
19 #include "sandbox/win/src/target_process.h" | 20 #include "sandbox/win/src/target_process.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
21 | 22 |
22 namespace sandbox { | 23 namespace sandbox { |
23 | 24 |
24 namespace internal { | 25 namespace internal { |
25 size_t GetGranularAlignedRandomOffset(size_t size); | 26 size_t GetGranularAlignedRandomOffset(size_t size); |
26 } | 27 } |
27 | 28 |
28 // Walks the settings buffer, verifying that the values make sense and counting | 29 // Walks the settings buffer, verifying that the values make sense and counting |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 int num_dlls, num_functions, num_names; | 251 int num_dlls, num_functions, num_names; |
251 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, | 252 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, |
252 &num_names); | 253 &num_names); |
253 | 254 |
254 EXPECT_EQ(3, num_dlls); | 255 EXPECT_EQ(3, num_dlls); |
255 EXPECT_EQ(4, num_functions); | 256 EXPECT_EQ(4, num_functions); |
256 EXPECT_EQ(0, num_names); | 257 EXPECT_EQ(0, num_names); |
257 } | 258 } |
258 | 259 |
259 } // namespace sandbox | 260 } // namespace sandbox |
OLD | NEW |