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> | 9 #include <windows.h> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "sandbox/src/interception.h" | 12 #include "sandbox/win/src/interception.h" |
13 #include "sandbox/src/interceptors.h" | 13 #include "sandbox/win/src/interceptors.h" |
14 #include "sandbox/src/interception_internal.h" | 14 #include "sandbox/win/src/interception_internal.h" |
15 #include "sandbox/src/target_process.h" | 15 #include "sandbox/win/src/target_process.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace sandbox { | 18 namespace sandbox { |
19 | 19 |
20 // Walks the settings buffer, verifying that the values make sense and counting | 20 // Walks the settings buffer, verifying that the values make sense and counting |
21 // objects. | 21 // objects. |
22 // Arguments: | 22 // Arguments: |
23 // buffer (in): the buffer to walk. | 23 // buffer (in): the buffer to walk. |
24 // size (in): buffer size | 24 // size (in): buffer size |
25 // num_dlls (out): count of the dlls on the buffer. | 25 // num_dlls (out): count of the dlls on the buffer. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 int num_dlls, num_functions, num_names; | 203 int num_dlls, num_functions, num_names; |
204 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, | 204 WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions, |
205 &num_names); | 205 &num_names); |
206 | 206 |
207 EXPECT_EQ(3, num_dlls); | 207 EXPECT_EQ(3, num_dlls); |
208 EXPECT_EQ(4, num_functions); | 208 EXPECT_EQ(4, num_functions); |
209 EXPECT_EQ(0, num_names); | 209 EXPECT_EQ(0, num_names); |
210 } | 210 } |
211 | 211 |
212 } // namespace sandbox | 212 } // namespace sandbox |
OLD | NEW |