Commit e06d49ff authored by Thomas Mullaly's avatar Thomas Mullaly Committed by Alexandre Julliard

urlmon: Added basic domain zone support to MapUrlToZone.

parent 1b625bb1
...@@ -498,7 +498,7 @@ static void test_zone_domain_cache(void) ...@@ -498,7 +498,7 @@ static void test_zone_domain_cache(void)
zone = URLZONE_INVALID; zone = URLZONE_INVALID;
hres = IInternetSecurityManager_MapUrlToZone(secmgr, testing_domain_urlW, &zone, 0); hres = IInternetSecurityManager_MapUrlToZone(secmgr, testing_domain_urlW, &zone, 0);
ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres); ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
ok(zone == URLZONE_INTERNET, "Got %d, expected URLZONE_INTERNET\n", zone); todo_wine ok(zone == URLZONE_INTERNET, "Got %d, expected URLZONE_INTERNET\n", zone);
/* FIXME: Play nice with ZoneMaps that existed before the test is run. */ /* FIXME: Play nice with ZoneMaps that existed before the test is run. */
res = RegDeleteKeyA(domains, "testing.domain"); res = RegDeleteKeyA(domains, "testing.domain");
...@@ -655,30 +655,30 @@ typedef struct { ...@@ -655,30 +655,30 @@ typedef struct {
static const zone_mapping_test zone_mapping_tests[] = { static const zone_mapping_test zone_mapping_tests[] = {
/* Tests for "yabadaba.do" zone mappings. */ /* Tests for "yabadaba.do" zone mappings. */
{"http://yabadaba.do/",URLZONE_CUSTOM,TRUE}, {"http://yabadaba.do/",URLZONE_CUSTOM},
{"http://google.yabadaba.do/",URLZONE_CUSTOM,TRUE}, {"http://google.yabadaba.do/",URLZONE_CUSTOM},
{"zip://yabadaba.do/",URLZONE_INTERNET}, {"zip://yabadaba.do/",URLZONE_INTERNET},
/* Tests for "super.cool" zone mappings. */ /* Tests for "super.cool" zone mappings. */
{"ftp://testing.google.super.cool/",URLZONE_INTERNET}, {"ftp://testing.google.super.cool/",URLZONE_INTERNET},
{"ftp://testing.*.super.cool/",URLZONE_CUSTOM2,TRUE}, {"ftp://testing.*.super.cool/",URLZONE_CUSTOM2},
{"ftp://google.testing.super.cool/",URLZONE_CUSTOM2,TRUE}, {"ftp://google.testing.super.cool/",URLZONE_CUSTOM2},
/* Tests for "tests.test" zone mappings. */ /* Tests for "tests.test" zone mappings. */
{"http://tests.test/",URLZONE_CUSTOM,TRUE}, {"http://tests.test/",URLZONE_CUSTOM},
{"http://www.tests.test/",URLZONE_CUSTOM,TRUE}, {"http://www.tests.test/",URLZONE_CUSTOM},
{"ftp://tests.test/",URLZONE_CUSTOM,TRUE}, {"ftp://tests.test/",URLZONE_CUSTOM},
{"ftp://www.tests.test/",URLZONE_CUSTOM,TRUE}, {"ftp://www.tests.test/",URLZONE_CUSTOM},
{"test://www.tests.test/",URLZONE_INTERNET}, {"test://www.tests.test/",URLZONE_INTERNET},
{"test://tests.test/",URLZONE_INTERNET}, {"test://tests.test/",URLZONE_INTERNET},
{"zip://www.tests.test/",URLZONE_INTERNET}, {"zip://www.tests.test/",URLZONE_INTERNET},
{"zip://tests.test/",URLZONE_INTERNET}, {"zip://tests.test/",URLZONE_INTERNET},
/* Tests for "www.testing.com" zone mappings. */ /* Tests for "www.testing.com" zone mappings. */
{"http://google.www.testing.com/",URLZONE_INTERNET}, {"http://google.www.testing.com/",URLZONE_INTERNET},
{"http://www.testing.com/",URLZONE_CUSTOM,TRUE,URLZONE_INTERNET}, {"http://www.testing.com/",URLZONE_CUSTOM,FALSE,URLZONE_INTERNET},
{"http://testing.www.testing.com/",URLZONE_CUSTOM2,TRUE,URLZONE_INTERNET}, {"http://testing.www.testing.com/",URLZONE_CUSTOM2,FALSE,URLZONE_INTERNET},
/* Tests for "org" zone mappings. */ /* Tests for "org" zone mappings. */
{"http://google.org/",URLZONE_INTERNET,FALSE,URLZONE_CUSTOM}, {"http://google.org/",URLZONE_INTERNET,FALSE,URLZONE_CUSTOM},
{"http://org/",URLZONE_CUSTOM,TRUE}, {"http://org/",URLZONE_CUSTOM},
{"http://testing.org/",URLZONE_CUSTOM2,TRUE} {"http://testing.org/",URLZONE_CUSTOM2}
}; };
static void test_zone_domain_mappings(void) static void test_zone_domain_mappings(void)
...@@ -701,7 +701,7 @@ static void test_zone_domain_mappings(void) ...@@ -701,7 +701,7 @@ static void test_zone_domain_mappings(void)
hres = IInternetSecurityManager_MapUrlToZone(secmgr, local_machineW, &zone, 0); hres = IInternetSecurityManager_MapUrlToZone(secmgr, local_machineW, &zone, 0);
ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres); ok(hres == S_OK, "MapUrlToZone failed: %08x\n", hres);
todo_wine ok(zone == URLZONE_CUSTOM, "Expected URLZONE_CUSTOM, but got %d\n", zone); ok(zone == URLZONE_CUSTOM, "Expected URLZONE_CUSTOM, but got %d\n", zone);
RegCloseKey(domains); RegCloseKey(domains);
} }
......
...@@ -607,7 +607,7 @@ static inline void pct_encode_val(WCHAR val, WCHAR *dest) { ...@@ -607,7 +607,7 @@ static inline void pct_encode_val(WCHAR val, WCHAR *dest) {
* It's implied that if there is a domain name its range is: * It's implied that if there is a domain name its range is:
* [host+domain_start, host+host_len). * [host+domain_start, host+host_len).
*/ */
static void find_domain_name(const WCHAR *host, DWORD host_len, void find_domain_name(const WCHAR *host, DWORD host_len,
INT *domain_start) { INT *domain_start) {
const WCHAR *last_tld, *sec_last_tld, *end; const WCHAR *last_tld, *sec_last_tld, *end;
......
...@@ -149,6 +149,8 @@ HRESULT protocol_unlock_request(Protocol*); ...@@ -149,6 +149,8 @@ HRESULT protocol_unlock_request(Protocol*);
HRESULT protocol_abort(Protocol*,HRESULT); HRESULT protocol_abort(Protocol*,HRESULT);
void protocol_close_connection(Protocol*); void protocol_close_connection(Protocol*);
void find_domain_name(const WCHAR*,DWORD,INT*);
typedef struct { typedef struct {
IInternetProtocol IInternetProtocol_iface; IInternetProtocol IInternetProtocol_iface;
IInternetProtocolSink IInternetProtocolSink_iface; IInternetProtocolSink IInternetProtocolSink_iface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment