Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/install_verification/win/module_list_unittest.cc

Issue 2094803005: Fix PrepareTextureCopyOutputResult to avoid ScopedCallbackRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_closure_runner
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/callback_helpers_unittest.cc ('k') | content/browser/compositor/surface_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <Windows.h> 7 #include <Windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 26 matching lines...) Expand all
37 base::ScopedClosureRunner release_new_dll( 37 base::ScopedClosureRunner release_new_dll(
38 base::Bind(base::IgnoreResult(&::FreeLibrary), new_dll)); 38 base::Bind(base::IgnoreResult(&::FreeLibrary), new_dll));
39 39
40 // Verify that there is an increase in the snapshot size. 40 // Verify that there is an increase in the snapshot size.
41 ASSERT_TRUE( 41 ASSERT_TRUE(
42 base::win::GetLoadedModulesSnapshot(::GetCurrentProcess(), &snapshot)); 42 base::win::GetLoadedModulesSnapshot(::GetCurrentProcess(), &snapshot));
43 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot); 43 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot);
44 ASSERT_GT(module_list->size(), original_list_size); 44 ASSERT_GT(module_list->size(), original_list_size);
45 45
46 // Unload the module. 46 // Unload the module.
47 release_new_dll.Reset(); 47 release_new_dll.RunAndReset();
48 48
49 // Reset module_list here. That should typically be the last ref on 49 // Reset module_list here. That should typically be the last ref on
50 // msvidc32.dll, so it will be unloaded now. 50 // msvidc32.dll, so it will be unloaded now.
51 module_list.reset(); 51 module_list.reset();
52 ASSERT_EQ(NULL, ::GetModuleHandle(L"msvidc32.dll")); 52 ASSERT_EQ(NULL, ::GetModuleHandle(L"msvidc32.dll"));
53 53
54 // List the modules from the stale snapshot (including a dangling HMODULE to 54 // List the modules from the stale snapshot (including a dangling HMODULE to
55 // msvidc32.dll), simulating a race condition. 55 // msvidc32.dll), simulating a race condition.
56 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot); 56 module_list = ModuleList::FromLoadedModuleSnapshot(snapshot);
57 ASSERT_EQ(module_list->size(), original_list_size); 57 ASSERT_EQ(module_list->size(), original_list_size);
58 } 58 }
OLDNEW
« no previous file with comments | « base/callback_helpers_unittest.cc ('k') | content/browser/compositor/surface_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698