Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
c34bc977
Commit
c34bc977
authored
Oct 01, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added basic persistent cookie tests.
parent
b49c980d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
internet.c
dlls/wininet/tests/internet.c
+25
-0
No files found.
dlls/wininet/tests/internet.c
View file @
c34bc977
...
...
@@ -19,6 +19,7 @@
*/
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -368,6 +369,7 @@ static void test_complicated_cookie(void)
BOOL
ret
;
CHAR
buffer
[
1024
];
CHAR
user
[
256
];
ret
=
InternetSetCookie
(
"http://www.example.com/bar"
,
NULL
,
"A=B; domain=.example.com"
);
ok
(
ret
==
TRUE
,
"InternetSetCookie failed
\n
"
);
...
...
@@ -471,6 +473,29 @@ static void test_complicated_cookie(void)
ok
(
strstr
(
buffer
,
"K=L"
)
!=
NULL
,
"K=L missing
\n
"
);
ok
(
strstr
(
buffer
,
"M=N"
)
==
NULL
,
"M=N present
\n
"
);
ok
(
strstr
(
buffer
,
"O=P"
)
==
NULL
,
"O=P present
\n
"
);
/* test persistent cookies */
ret
=
InternetSetCookie
(
"http://testing.example.com"
,
NULL
,
"A=B; expires=Fri, 01-Jan-2038 00:00:00 GMT"
);
ok
(
ret
,
"InternetSetCookie failed with error %d
\n
"
,
GetLastError
());
len
=
sizeof
(
user
);
ret
=
GetUserName
(
user
,
&
len
);
ok
(
ret
,
"GetUserName failed with error %d
\n
"
,
GetLastError
());
for
(;
len
>
0
;
len
--
)
user
[
len
-
1
]
=
tolower
(
user
[
len
-
1
]);
sprintf
(
buffer
,
"Cookie:%s@testing.example.com/"
,
user
);
ret
=
GetUrlCacheEntryInfo
(
buffer
,
NULL
,
&
len
);
ok
(
!
ret
,
"GetUrlCacheEntryInfo succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"GetLastError() = %d
\n
"
,
GetLastError
());
/* remove persistent cookie */
ret
=
InternetSetCookie
(
"http://testing.example.com"
,
NULL
,
"A=B"
);
ok
(
ret
,
"InternetSetCookie failed with error %d
\n
"
,
GetLastError
());
ret
=
GetUrlCacheEntryInfo
(
buffer
,
NULL
,
&
len
);
ok
(
!
ret
,
"GetUrlCacheEntryInfo succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetLastError() = %d
\n
"
,
GetLastError
());
}
static
void
test_cookie_url
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment