Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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
wine
wine-cw
Commits
b4ce0760
Commit
b4ce0760
authored
Jul 04, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Added INTERNET_COOKIE_HTTPONLY tests.
parent
db441cf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
internet.c
dlls/wininet/tests/internet.c
+41
-0
No files found.
dlls/wininet/tests/internet.c
View file @
b4ce0760
...
...
@@ -557,6 +557,46 @@ static void test_complicated_cookie(void)
todo_wine
ok
(
!
ret
,
"InternetSetCookie succeeded
\n
"
);
}
static
void
test_cookie_attrs
(
void
)
{
char
buf
[
100
];
DWORD
size
,
state
;
BOOL
ret
;
if
(
!
GetProcAddress
(
GetModuleHandleA
(
"wininet.dll"
),
"InternetGetSecurityInfoByURLA"
))
{
win_skip
(
"Skipping cookie attributes tests. Too old IE.
\n
"
);
return
;
}
ret
=
InternetSetCookieA
(
"http://cookie.attrs.com/bar"
,
NULL
,
"A=data; httponly"
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_OPERATION
,
"InternetSetCookie returned: %x (%u)
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
state
=
InternetSetCookieExA
(
"http://cookie.attrs.com/bar"
,
NULL
,
"A=data; httponly"
,
0
,
0
);
ok
(
state
==
COOKIE_STATE_REJECT
&&
GetLastError
()
==
ERROR_INVALID_OPERATION
,
"InternetSetCookieEx returned: %x (%u)
\n
"
,
ret
,
GetLastError
());
size
=
sizeof
(
buf
);
ret
=
InternetGetCookieExA
(
"http://cookie.attrs.com/"
,
NULL
,
buf
,
&
size
,
INTERNET_COOKIE_HTTPONLY
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NO_MORE_ITEMS
,
"InternetGetCookieEx returned: %x (%u)
\n
"
,
ret
,
GetLastError
());
state
=
InternetSetCookieExA
(
"http://cookie.attrs.com/bar"
,
NULL
,
"A=data; httponly"
,
INTERNET_COOKIE_HTTPONLY
,
0
);
ok
(
state
==
COOKIE_STATE_ACCEPT
,
"InternetSetCookieEx failed: %u
\n
"
,
GetLastError
());
size
=
sizeof
(
buf
);
ret
=
InternetGetCookieA
(
"http://cookie.attrs.com/"
,
NULL
,
buf
,
&
size
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NO_MORE_ITEMS
,
"InternetGetCookie returned: %x (%u)
\n
"
,
ret
,
GetLastError
());
size
=
sizeof
(
buf
);
ret
=
InternetGetCookieExA
(
"http://cookie.attrs.com/"
,
NULL
,
buf
,
&
size
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NO_MORE_ITEMS
,
"InternetGetCookieEx returned: %x (%u)
\n
"
,
ret
,
GetLastError
());
size
=
sizeof
(
buf
);
ret
=
InternetGetCookieExA
(
"http://cookie.attrs.com/"
,
NULL
,
buf
,
&
size
,
INTERNET_COOKIE_HTTPONLY
,
NULL
);
ok
(
ret
,
"InternetGetCookieEx failed: %u
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
buf
,
"A=data"
),
"data = %s
\n
"
,
buf
);
}
static
void
test_cookie_url
(
void
)
{
WCHAR
bufw
[
512
];
...
...
@@ -1618,6 +1658,7 @@ START_TEST(internet)
test_get_cookie
();
test_complicated_cookie
();
test_cookie_url
();
test_cookie_attrs
();
test_version
();
test_null
();
test_Option_PerConnectionOption
();
...
...
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