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

Side by Side Diff: sandbox/src/service_resolver_unittest.cc

Issue 6816024: Revert 80819 due to failed tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/src/sandbox_utils.cc ('k') | sandbox/tests/common/controller.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 (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 ServiceResolverThunk. 5 // This file contains unit tests for ServiceResolverThunk.
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "sandbox/src/resolver.h" 10 #include "sandbox/src/resolver.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ret = resolver->Setup(ntdll_base, NULL, function, NULL, function_entry, 113 ret = resolver->Setup(ntdll_base, NULL, function, NULL, function_entry,
114 thunk.get(), thunk_size, &used); 114 thunk.get(), thunk_size, &used);
115 CheckJump(service, thunk.get()); 115 CheckJump(service, thunk.get());
116 } 116 }
117 } 117 }
118 118
119 return ret; 119 return ret;
120 } 120 }
121 121
122 sandbox::ServiceResolverThunk* GetTestResolver(bool relaxed) { 122 sandbox::ServiceResolverThunk* GetTestResolver(bool relaxed) {
123 if (base::win::OSInfo::GetInstance()->wow64_status() == 123 if (base::win::GetWOW64Status() == base::win::WOW64_ENABLED)
124 base::win::OSInfo::WOW64_ENABLED)
125 return new Wow64ResolverTest(relaxed); 124 return new Wow64ResolverTest(relaxed);
126 if (!sandbox::IsXPSP2OrLater()) 125 if (!sandbox::IsXPSP2OrLater())
127 return new Win2kResolverTest(relaxed); 126 return new Win2kResolverTest(relaxed);
128 return new WinXpResolverTest(relaxed); 127 return new WinXpResolverTest(relaxed);
129 } 128 }
130 129
131 NTSTATUS PatchNtdll(const char* function, bool relaxed) { 130 NTSTATUS PatchNtdll(const char* function, bool relaxed) {
132 sandbox::ServiceResolverThunk* resolver = GetTestResolver(relaxed); 131 sandbox::ServiceResolverThunk* resolver = GetTestResolver(relaxed);
133 132
134 NTSTATUS ret = PatchNtdllWithResolver(function, relaxed, resolver); 133 NTSTATUS ret = PatchNtdllWithResolver(function, relaxed, resolver);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ::GetLastError(); 196 ::GetLastError();
198 197
199 ret = PatchNtdllWithResolver("NtMapViewOfSection", true, resolver); 198 ret = PatchNtdllWithResolver("NtMapViewOfSection", true, resolver);
200 EXPECT_EQ(STATUS_SUCCESS, ret) << "NtMapViewOfSection, last error: " << 199 EXPECT_EQ(STATUS_SUCCESS, ret) << "NtMapViewOfSection, last error: " <<
201 ::GetLastError(); 200 ::GetLastError();
202 delete resolver; 201 delete resolver;
203 #endif 202 #endif
204 } 203 }
205 204
206 } // namespace 205 } // namespace
OLDNEW
« no previous file with comments | « sandbox/src/sandbox_utils.cc ('k') | sandbox/tests/common/controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698