| 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 | |
| 12 #include <algorithm> | 9 #include <algorithm> |
| 13 #include <set> | 10 #include <set> |
| 14 | 11 |
| 12 #include <windows.h> |
| 13 |
| 15 #include "base/bits.h" | 14 #include "base/bits.h" |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "sandbox/win/src/interception.h" | 16 #include "sandbox/win/src/interception.h" |
| 17 #include "sandbox/win/src/interceptors.h" |
| 18 #include "sandbox/win/src/interception_internal.h" | 18 #include "sandbox/win/src/interception_internal.h" |
| 19 #include "sandbox/win/src/interceptors.h" | |
| 20 #include "sandbox/win/src/target_process.h" | 19 #include "sandbox/win/src/target_process.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 21 |
| 23 namespace sandbox { | 22 namespace sandbox { |
| 24 | 23 |
| 25 namespace internal { | 24 namespace internal { |
| 26 size_t GetGranularAlignedRandomOffset(size_t size); | 25 size_t GetGranularAlignedRandomOffset(size_t size); |
| 27 } | 26 } |
| 28 | 27 |
| 29 // Walks the settings buffer, verifying that the values make sense and counting | 28 // 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... |
| 251 int num_dlls, num_functions, num_names; | 250 int num_dlls, num_functions, num_names; |
| 252 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, | 251 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, |
| 253 &num_names); | 252 &num_names); |
| 254 | 253 |
| 255 EXPECT_EQ(3, num_dlls); | 254 EXPECT_EQ(3, num_dlls); |
| 256 EXPECT_EQ(4, num_functions); | 255 EXPECT_EQ(4, num_functions); |
| 257 EXPECT_EQ(0, num_names); | 256 EXPECT_EQ(0, num_names); |
| 258 } | 257 } |
| 259 | 258 |
| 260 } // namespace sandbox | 259 } // namespace sandbox |
| OLD | NEW |