| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/install_verification/win/module_list.h" | 5 #include "chrome/browser/install_verification/win/module_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 7 #include <Windows.h> | 8 #include <Windows.h> |
| 8 #include <vector> | 9 #include <vector> |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 11 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/install_verification/win/loaded_modules_snapshot.h" | 14 #include "chrome/browser/install_verification/win/loaded_modules_snapshot.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 TEST(ModuleListTest, TestCase) { | 17 TEST(ModuleListTest, TestCase) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 // Reset module_list here. That should typically be the last ref on | 45 // Reset module_list here. That should typically be the last ref on |
| 45 // msvidc32.dll, so it will be unloaded now. | 46 // msvidc32.dll, so it will be unloaded now. |
| 46 module_list.reset(); | 47 module_list.reset(); |
| 47 ASSERT_EQ(NULL, ::GetModuleHandle(L"msvidc32.dll")); | 48 ASSERT_EQ(NULL, ::GetModuleHandle(L"msvidc32.dll")); |
| 48 | 49 |
| 49 // List the modules from the stale snapshot (including a dangling HMODULE to | 50 // List the modules from the stale snapshot (including a dangling HMODULE to |
| 50 // msvidc32.dll), simulating a race condition. | 51 // msvidc32.dll), simulating a race condition. |
| 51 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot); | 52 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot); |
| 52 ASSERT_EQ(module_list->size(), original_list_size); | 53 ASSERT_EQ(module_list->size(), original_list_size); |
| 53 } | 54 } |
| OLD | NEW |