Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5306ce9d
Commit
5306ce9d
authored
May 28, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
May 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Test if content is read from cache in INTERNET_FLAG_FROM_CACHE tests.
parent
6a335ca5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
http.c
dlls/wininet/tests/http.c
+18
-2
No files found.
dlls/wininet/tests/http.c
View file @
5306ce9d
...
...
@@ -1432,7 +1432,9 @@ static void test_http_cache(void)
BYTE
buf
[
100
];
HANDLE
file
;
BOOL
ret
;
FILETIME
filetime_zero
=
{
0
};
static
const
char
cached_content
[]
=
"data read from cache"
;
static
const
char
*
types
[]
=
{
"*"
,
""
,
NULL
};
session
=
InternetOpenA
(
"Wine Regression Test"
,
INTERNET_OPEN_TYPE_PRECONFIG
,
NULL
,
NULL
,
0
);
...
...
@@ -1492,9 +1494,13 @@ static void test_http_cache(void)
ok
(
InternetCloseHandle
(
request
),
"Close request handle failed
\n
"
);
file
=
CreateFileA
(
file_name
,
GENERIC_
READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
file
=
CreateFileA
(
file_name
,
GENERIC_
WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Could not create file: %u
\n
"
,
GetLastError
());
ret
=
WriteFile
(
file
,
cached_content
,
sizeof
(
cached_content
),
&
size
,
NULL
);
ok
(
ret
&&
size
,
"WriteFile failed: %d, %d
\n
"
,
ret
,
size
);
ret
=
CommitUrlCacheEntryA
(
url
,
file_name
,
filetime_zero
,
filetime_zero
,
NORMAL_CACHE_ENTRY
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"CommitUrlCacheEntry failed: %d
\n
"
,
GetLastError
());
CloseHandle
(
file
);
/* Send the same request, requiring it to be retrieved from the cache */
...
...
@@ -1507,7 +1513,17 @@ static void test_http_cache(void)
ret
=
InternetReadFile
(
request
,
buf
,
sizeof
(
buf
),
&
size
);
ok
(
ret
,
"InternetReadFile failed: %u
\n
"
,
GetLastError
());
ok
(
size
==
100
,
"size = %u
\n
"
,
size
);
buf
[
99
]
=
0
;
todo_wine
ok
(
!
strcmp
((
char
*
)
buf
,
cached_content
),
"incorrect page data: %s
\n
"
,
(
char
*
)
buf
);
ok
(
InternetCloseHandle
(
request
),
"Close request handle failed
\n
"
);
DeleteUrlCacheEntryA
(
url
);
request
=
HttpOpenRequestA
(
connect
,
"GET"
,
"/tests/hello.html"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_FROM_CACHE
,
0
);
ret
=
HttpSendRequestA
(
request
,
NULL
,
0
,
NULL
,
0
);
todo_wine
ok
(
!
ret
,
"HttpSendRequest succeeded
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetLastError() = %d
\n
"
,
GetLastError
());
ok
(
InternetCloseHandle
(
request
),
"Close request handle failed
\n
"
);
request
=
HttpOpenRequestA
(
connect
,
NULL
,
"/"
,
NULL
,
NULL
,
types
,
INTERNET_FLAG_NO_CACHE_WRITE
,
0
);
...
...
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