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

Side by Side Diff: chrome_frame/test_utils.cc

Issue 7276037: Remove NPAPI support from Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/test_with_web_server.cc ('k') | chrome_frame/utils.h » ('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 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "chrome_frame/test_utils.h" 7 #include "chrome_frame/test_utils.h"
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlwin.h> 10 #include <atlwin.h>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 if (registration_type == PER_USER) { 71 if (registration_type == PER_USER) {
72 register_server = reinterpret_cast<DllRegisterServerFn>(GetProcAddress( 72 register_server = reinterpret_cast<DllRegisterServerFn>(GetProcAddress(
73 dll_handle, "DllRegisterUserServer")); 73 dll_handle, "DllRegisterUserServer"));
74 } else { 74 } else {
75 register_server = reinterpret_cast<DllRegisterServerFn>(GetProcAddress( 75 register_server = reinterpret_cast<DllRegisterServerFn>(GetProcAddress(
76 dll_handle, "DllRegisterServer")); 76 dll_handle, "DllRegisterServer"));
77 } 77 }
78 ASSERT_TRUE(register_server != NULL); 78 ASSERT_TRUE(register_server != NULL);
79 EXPECT_HRESULT_SUCCEEDED((*register_server)()); 79 EXPECT_HRESULT_SUCCEEDED((*register_server)());
80 80
81 DllRegisterServerFn register_npapi_server = NULL;
82 if (registration_type == PER_USER) {
83 register_npapi_server =
84 reinterpret_cast<DllRegisterServerFn>(GetProcAddress(
85 dll_handle, "RegisterNPAPIUserPlugin"));
86 } else {
87 register_npapi_server =
88 reinterpret_cast<DllRegisterServerFn>(GetProcAddress(
89 dll_handle, "RegisterNPAPIPlugin"));
90 }
91
92 if (register_npapi_server != NULL)
93 EXPECT_HRESULT_SUCCEEDED((*register_npapi_server)());
94
95 ASSERT_TRUE(FreeLibrary(dll_handle)); 81 ASSERT_TRUE(FreeLibrary(dll_handle));
96 } 82 }
97 83
98 // static 84 // static
99 void ScopedChromeFrameRegistrar::UnregisterAtPath( 85 void ScopedChromeFrameRegistrar::UnregisterAtPath(
100 const std::wstring& path, RegistrationType registration_type) { 86 const std::wstring& path, RegistrationType registration_type) {
101 87
102 ASSERT_FALSE(path.empty()); 88 ASSERT_FALSE(path.empty());
103 HMODULE dll_handle = LoadLibrary(path.c_str()); 89 HMODULE dll_handle = LoadLibrary(path.c_str());
104 ASSERT_TRUE(dll_handle != NULL); 90 ASSERT_TRUE(dll_handle != NULL);
105 91
106 typedef HRESULT (STDAPICALLTYPE* DllUnregisterServerFn)(); 92 typedef HRESULT (STDAPICALLTYPE* DllUnregisterServerFn)();
107 DllUnregisterServerFn unregister_server = NULL; 93 DllUnregisterServerFn unregister_server = NULL;
108 if (registration_type == PER_USER) { 94 if (registration_type == PER_USER) {
109 unregister_server = reinterpret_cast<DllUnregisterServerFn> 95 unregister_server = reinterpret_cast<DllUnregisterServerFn>
110 (GetProcAddress(dll_handle, "DllUnregisterUserServer")); 96 (GetProcAddress(dll_handle, "DllUnregisterUserServer"));
111 } else { 97 } else {
112 unregister_server = reinterpret_cast<DllUnregisterServerFn> 98 unregister_server = reinterpret_cast<DllUnregisterServerFn>
113 (GetProcAddress(dll_handle, "DllUnregisterServer")); 99 (GetProcAddress(dll_handle, "DllUnregisterServer"));
114 } 100 }
115 ASSERT_TRUE(unregister_server != NULL); 101 ASSERT_TRUE(unregister_server != NULL);
116 EXPECT_HRESULT_SUCCEEDED((*unregister_server)()); 102 EXPECT_HRESULT_SUCCEEDED((*unregister_server)());
117 103
118 DllUnregisterServerFn unregister_npapi_server = NULL;
119 if (registration_type == PER_USER) {
120 unregister_npapi_server =
121 reinterpret_cast<DllUnregisterServerFn>(GetProcAddress(
122 dll_handle, "UnregisterNPAPIUserPlugin"));
123 } else {
124 unregister_npapi_server =
125 reinterpret_cast<DllUnregisterServerFn>(GetProcAddress(
126 dll_handle, "UnregisterNPAPIPlugin"));
127 }
128
129 if (unregister_npapi_server != NULL)
130 EXPECT_HRESULT_SUCCEEDED((*unregister_npapi_server)());
131
132 ASSERT_TRUE(FreeLibrary(dll_handle)); 104 ASSERT_TRUE(FreeLibrary(dll_handle));
133 } 105 }
134 106
135 FilePath ScopedChromeFrameRegistrar::GetReferenceChromeFrameDllPath() { 107 FilePath ScopedChromeFrameRegistrar::GetReferenceChromeFrameDllPath() {
136 FilePath reference_build_dir; 108 FilePath reference_build_dir;
137 PathService::Get(chrome::DIR_APP, &reference_build_dir); 109 PathService::Get(chrome::DIR_APP, &reference_build_dir);
138 110
139 reference_build_dir = reference_build_dir.DirName(); 111 reference_build_dir = reference_build_dir.DirName();
140 reference_build_dir = reference_build_dir.DirName(); 112 reference_build_dir = reference_build_dir.DirName();
141 113
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 UOI_NAME, 342 UOI_NAME,
371 name, 343 name,
372 sizeof(name), 344 sizeof(name),
373 &needed)) { 345 &needed)) {
374 is_locked = lstrcmpi(name, L"default") != 0; 346 is_locked = lstrcmpi(name, L"default") != 0;
375 } 347 }
376 ::CloseDesktop(input_desk); 348 ::CloseDesktop(input_desk);
377 } 349 }
378 return is_locked; 350 return is_locked;
379 } 351 }
OLDNEW
« no previous file with comments | « chrome_frame/test/test_with_web_server.cc ('k') | chrome_frame/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698