OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/private_working_set_snapshot.h" | 5 #include "chrome/browser/win/private_working_set_snapshot.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 using PrivateWorkingSetSnapshotWinTest = testing::Test; | 12 using PrivateWorkingSetSnapshotWinTest = testing::Test; |
13 | 13 |
14 TEST_F(PrivateWorkingSetSnapshotWinTest, FindPidSelfTest) { | 14 TEST_F(PrivateWorkingSetSnapshotWinTest, FindPidSelfTest) { |
15 // The Pdh APIs are supported on Windows XP and above, but the "Working Set - | 15 // The Pdh APIs are supported on Windows XP and above, but the "Working Set - |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 size_t private_ws2 = private_ws_snapshot.GetPrivateWorkingSet(pid); | 57 size_t private_ws2 = private_ws_snapshot.GetPrivateWorkingSet(pid); |
58 EXPECT_EQ(private_ws, private_ws2) << "GetPrivateWorkingSet should be " | 58 EXPECT_EQ(private_ws, private_ws2) << "GetPrivateWorkingSet should be " |
59 "consistent until the next call to " | 59 "consistent until the next call to " |
60 "Sample()"; | 60 "Sample()"; |
61 | 61 |
62 private_ws_snapshot.Sample(); | 62 private_ws_snapshot.Sample(); |
63 size_t private_ws3 = private_ws_snapshot.GetPrivateWorkingSet(pid); | 63 size_t private_ws3 = private_ws_snapshot.GetPrivateWorkingSet(pid); |
64 EXPECT_GT(private_ws3, private_ws2 + alloc_size / 2) | 64 EXPECT_GT(private_ws3, private_ws2 + alloc_size / 2) |
65 << "GetPrivateWorkingSet should increase as we allocate more memory"; | 65 << "GetPrivateWorkingSet should increase as we allocate more memory"; |
66 } | 66 } |
OLD | NEW |