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

Side by Side Diff: base/scoped_native_library_unittest.cc

Issue 303033: Implements AeroPeek of Windows 7.. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « base/scoped_native_library.h ('k') | chrome/browser/aeropeek_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/scoped_native_library.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 // Tests whether or not a function pointer retrieved via ScopedNativeLibrary
10 // is available only in a scope.
11 TEST(ScopedNativeLibrary, Basic) {
12 #if defined(OS_WIN)
13 // Get the pointer to DirectDrawCreate() from "ddraw.dll" and verify it
14 // is valid only in this scope.
15 // FreeLibrary() doesn't actually unload a DLL until its reference count
16 // becomes zero, i.e. this function pointer is still valid if the DLL used
17 // in this test is also used by another part of this executable.
18 // So, this test uses "ddraw.dll", which is not used by Chrome at all but
19 // installed on all versions of Windows.
20 FARPROC test_function;
21 {
22 FilePath path(base::GetNativeLibraryName(L"ddraw"));
23 base::ScopedNativeLibrary library(path);
24 test_function = reinterpret_cast<FARPROC>(
25 library.GetFunctionPointer("DirectDrawCreate"));
26 EXPECT_EQ(0, IsBadCodePtr(test_function));
27 }
28 EXPECT_NE(0, IsBadCodePtr(test_function));
29 #endif
30 }
OLDNEW
« no previous file with comments | « base/scoped_native_library.h ('k') | chrome/browser/aeropeek_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698