#include <apitest.h>
#include <shlobj.h>
#include <atlbase.h>
#include <atlstr.h>
#include <atlcom.h>
#include <atlwin.h>
#include <shellutils.h>
#include <shlwapi.h>
#include <strsafe.h>
#include <initguid.h>
Go to the source code of this file.
|
| #define | _UNICODE |
| |
| #define | UNICODE |
| |
| #define | ok_hex2(file, line, key, expression, result) |
| |
| #define | ok_wstri(x, y) ok(lstrcmpiW(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) |
| |
| #define | INTERFACE IACLCustomMRU |
| |
| #define | verify_mru(mru, ...) verify_mru_(__FILE__, __LINE__, mru, __VA_ARGS__, NULL) |
| |
| #define | TYPED_URLS_KEY L"Software\\Microsoft\\Internet Explorer\\TypedURLs" |
| |
| #define | INVALID_LPOLESTR ((LPOLESTR)(LONG_PTR)0xDEADBEEF) |
| |
|
| ULONG | DbgPrint (PCH Format,...) |
| |
| | DEFINE_GUID (IID_IACLCustomMRU, 0xf729fc5e, 0x8769, 0x4f3e, 0xbd, 0xb2, 0xd7, 0xb5, 0x0f, 0xd2, 0x27, 0x5b) |
| |
| | DECLARE_INTERFACE_IID_ (IACLCustomMRU, IUnknown, "F729FC5E-8769-4F3E-BDB2-D7B50FD2275B") |
| |
| static void | Cleanup_Testdata () |
| |
| static void | verify_mru_ (const char *file, int line, IACLCustomMRU *mru, PCWSTR MRUString,...) |
| |
| static void | test_IACLCustomMRU_Basics () |
| |
| static void | FillDefault (IACLCustomMRU *CustomMRU) |
| |
| static void | test_IACLCustomMRU_UpdateOrder () |
| |
| static void | test_IACLCustomMRU_ExtraChars () |
| |
| static void | test_IACLCustomMRU_Continue () |
| |
| static void | RestoreTypedURLs (const CStringW &url1, const CStringW &url2) |
| |
| static void | test_IACLCustomMRU_TypedURLs () |
| |
| | START_TEST (IACLCustomMRU) |
| |
◆ _UNICODE
◆ INTERFACE
◆ INVALID_LPOLESTR
◆ ok_hex2
Value: do { \
int _value = (expression); \
ok_(
file,
line)(_value == (
result),
"Wrong value for '%s', expected: " #
result " (0x%x), got: 0x%x for %c\n", \
#expression, (
int)(
result), _value, (
char)
key); \
} while (0)
Definition at line 25 of file IACLCustomMRU.cpp.
◆ ok_wstri
◆ TYPED_URLS_KEY
| #define TYPED_URLS_KEY L"Software\\Microsoft\\Internet Explorer\\TypedURLs" |
◆ UNICODE
◆ verify_mru
◆ Cleanup_Testdata()
| static void Cleanup_Testdata |
( |
| ) |
|
|
static |
◆ DbgPrint()
◆ DECLARE_INTERFACE_IID_()
| DECLARE_INTERFACE_IID_ |
( |
IACLCustomMRU |
, |
|
|
IUnknown |
, |
|
|
"F729FC5E-8769-4F3E-BDB2-D7B50FD2275B" |
|
|
) |
| |
Definition at line 43 of file IACLCustomMRU.cpp.
44{
45
49
50
53};
static HRESULT QueryInterface(REFIID, void **)
static ULONG WINAPI AddRef(IStream *iface)
◆ DEFINE_GUID()
| DEFINE_GUID |
( |
IID_IACLCustomMRU |
, |
|
|
0xf729fc5e |
, |
|
|
0x8769 |
, |
|
|
0x4f3e |
, |
|
|
0xbd |
, |
|
|
0xb2 |
, |
|
|
0xd7 |
, |
|
|
0xb5 |
, |
|
|
0x0f |
, |
|
|
0xd2 |
, |
|
|
0x27 |
, |
|
|
0x5b |
|
|
) |
| |
◆ FillDefault()
| static void FillDefault |
( |
IACLCustomMRU * |
CustomMRU | ) |
|
|
static |
◆ RestoreTypedURLs()
◆ START_TEST()
| START_TEST |
( |
IACLCustomMRU |
| ) |
|
Definition at line 544 of file IACLCustomMRU.cpp.
545{
549 return;
550
556
558}
static void test_IACLCustomMRU_ExtraChars()
static void test_IACLCustomMRU_UpdateOrder()
static void test_IACLCustomMRU_Continue()
static void test_IACLCustomMRU_TypedURLs()
static void test_IACLCustomMRU_Basics()
◆ test_IACLCustomMRU_Basics()
| static void test_IACLCustomMRU_Basics |
( |
| ) |
|
|
static |
Definition at line 105 of file IACLCustomMRU.cpp.
106{
111 return;
112
114
115
116
117
120
121
122
126
127 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
130
131 hr = CustomMRU->AddMRUString(
L"SECOND_ENTRY");
133 verify_mru(CustomMRU,
L"ba",
L"FIRST_ENTRY",
L"SECOND_ENTRY");
134
135 hr = CustomMRU->AddMRUString(
L"THIRD_ENTRY");
137 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
138
139
140 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
142 verify_mru(CustomMRU,
L"acb",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
143
144
145 hr = CustomMRU->AddMRUString(
L"FIFTH_ENTRY");
147 verify_mru(CustomMRU,
L"bac",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
148}
#define verify_mru(mru,...)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
#define IID_PPV_ARG(Itype, ppType)
Referenced by START_TEST().
◆ test_IACLCustomMRU_Continue()
| static void test_IACLCustomMRU_Continue |
( |
| ) |
|
|
static |
Definition at line 243 of file IACLCustomMRU.cpp.
244{
249 return;
250
253 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
254
256
260 return;
261
264
265
266 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
268 verify_mru(CustomMRU,
L"acb",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
269
271
275 return;
276
279
280
281 hr = CustomMRU->AddMRUString(
L"FIFTH_ENTRY");
283 verify_mru(CustomMRU,
L"bac",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
284
286
290 return;
291
292
293
296 key.SetStringValue(
L"MRUList",
L"b**");
298
301
303
304
305 verify_mru(CustomMRU,
L"b**",
L"FOURTH_ENTRY",
L"FIFTH_ENTRY",
L"THIRD_ENTRY");
306
310 return;
311
314
315
316 hr = CustomMRU->AddMRUString(
L"SIXTH_ENTRY");
319
321
325 return;
326
329 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
330
332
336 return;
337
339 key.SetStringValue(
L"MRUList",
L"baccccc");
341
345
346 verify_mru(CustomMRU,
L"baccccc",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
347
351 return;
352
355
356 hr = CustomMRU->AddMRUString(
L"FOURTH_ENTRY");
358 verify_mru(CustomMRU,
L"a",
L"FOURTH_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
359
362
366 return;
367
371 return;
372
373 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
376
378
380 key.SetStringValue(
L"MRUList",
L"aaa");
382
386 return;
387
391 return;
392
393 hr = CustomMRU->AddMRUString(
L"SECOND_ENTRY");
395 verify_mru(CustomMRU,
L"ba",
L"FIRST_ENTRY",
L"SECOND_ENTRY");
396}
static void FillDefault(IACLCustomMRU *CustomMRU)
Referenced by START_TEST().
◆ test_IACLCustomMRU_ExtraChars()
| static void test_IACLCustomMRU_ExtraChars |
( |
| ) |
|
|
static |
Definition at line 211 of file IACLCustomMRU.cpp.
212{
217 return;
218
220
221
224
225 for (
int n = 0;
n < 30; ++
n)
226 {
229
230 hr = CustomMRU->AddMRUString(tmp);
232 }
233
234 verify_mru(CustomMRU,
L"a}|{zyxwvutsrqponmlkjihgfedcb",
L"29",
235 L"1",
L"2",
L"3",
L"4",
L"5",
L"6",
L"7",
L"8",
L"9",
236 L"10",
L"11",
L"12",
L"13",
L"14",
L"15",
L"16",
L"17",
L"18",
L"19",
237 L"20",
L"21",
L"22",
L"23",
L"24",
L"25",
L"26",
L"27",
L"28");
238
240}
void __cdecl Format(UINT nFormatID,...)
Referenced by START_TEST().
◆ test_IACLCustomMRU_TypedURLs()
| static void test_IACLCustomMRU_TypedURLs |
( |
| ) |
|
|
static |
Definition at line 416 of file IACLCustomMRU.cpp.
417{
419 {
422
428
433
434
435 key.SetStringValue(
L"url1",
L"aaa");
436 key.SetStringValue(
L"url2",
L"bbb");
437 }
438
444 {
445 skip(
"IACLCustomMRU was NULL\n");
447 return;
448 }
449
451 hr = CustomMRU->QueryInterface(
IID_PPV_ARG(IACList, &ACList));
454 {
455 hr = ACList->Expand(
L"C:");
457 hr = ACList->Expand(
L"C:\\");
459 hr = ACList->Expand(
L"C:\\Program Files");
461 hr = ACList->Expand(
L"C:\\Program Files\\");
463 hr = ACList->Expand(
L"http://");
465 hr = ACList->Expand(
L"https://");
467 hr = ACList->Expand(
L"https://google.co.jp/");
469 }
470
473
474 if (ACList)
475 {
476 hr = ACList->Expand(
L"C:");
478 hr = ACList->Expand(
L"C:\\");
480 hr = ACList->Expand(
L"C:\\Program Files");
482 hr = ACList->Expand(
L"C:\\Program Files\\");
484 hr = ACList->Expand(
L"http://");
486 hr = ACList->Expand(
L"https://");
488 hr = ACList->Expand(
L"https://google.co.jp/");
490 }
491
496 {
497 skip(
"IEnumString was NULL\n");
499 return;
500 }
501
503 hr = pEnum->Clone(&pEnumClone);
505
508
509#define INVALID_LPOLESTR ((LPOLESTR)(LONG_PTR)0xDEADBEEF)
512 hr = pEnum->Next(2, apsz, &
c);
518
521 hr = pEnum->Next(0, &psz, &
c);
525
528 hr = pEnum->Next(1, &psz, &
c);
533
534 hr = CustomMRU->AddMRUString(
L"https://google.co.jp");
536 hr = CustomMRU->AddMRUString(
L"C:");
538 hr = CustomMRU->AddMRUString(
L"C:\\");
540
542}
static void RestoreTypedURLs(const CStringW &url1, const CStringW &url2)
#define ok_int(expression, result)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
void WINAPI CoTaskMemFree(void *ptr)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Referenced by START_TEST().
◆ test_IACLCustomMRU_UpdateOrder()
| static void test_IACLCustomMRU_UpdateOrder |
( |
| ) |
|
|
static |
Definition at line 165 of file IACLCustomMRU.cpp.
166{
171 return;
172
175 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
176
177
178 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
180
181 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
182
184
186
187
191 return;
192
195 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
196
197
198
199 hr = CustomMRU->AddMRUString(
L"FIRST_ENTRY");
201
202 verify_mru(CustomMRU,
L"cba",
L"FIRST_ENTRY",
L"SECOND_ENTRY",
L"THIRD_ENTRY");
203
204 hr = CustomMRU->AddMRUString(
L"SOMETHING_ELSE");
206
207 verify_mru(CustomMRU,
L"bac",
L"FIRST_ENTRY",
L"SOMETHING_ELSE",
L"THIRD_ENTRY");
208}
Referenced by START_TEST().
◆ verify_mru_()
Definition at line 64 of file IACLCustomMRU.cpp.
65{
66
69
75 {
83 {
85 }
87 }
89
91 {
97 {
99 }
100 }
101}
#define ok_hex2(file, line, key, expression, result)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
◆ szTestPath
| const WCHAR szTestPath[] = L"TESTPATH_BROWSEUI_APITEST" |
|
static |