mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 670514 - LNK file test for Windows share security. r=bz
This commit is contained in:
parent
796c450e07
commit
0c07aa9fc7
BIN
netwerk/test/unit/data/system_root.lnk
Normal file
BIN
netwerk/test/unit/data/system_root.lnk
Normal file
Binary file not shown.
@ -12,6 +12,7 @@ const special_type = "application/x-our-special-type";
|
|||||||
test_read_dir_1,
|
test_read_dir_1,
|
||||||
test_read_dir_2,
|
test_read_dir_2,
|
||||||
test_upload_file,
|
test_upload_file,
|
||||||
|
test_load_replace,
|
||||||
do_test_finished
|
do_test_finished
|
||||||
].forEach(add_test);
|
].forEach(add_test);
|
||||||
|
|
||||||
@ -222,6 +223,28 @@ function test_upload_file() {
|
|||||||
chan.asyncOpen(new FileStreamListener(on_upload_complete), null);
|
chan.asyncOpen(new FileStreamListener(on_upload_complete), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_load_replace() {
|
||||||
|
// lnk files should resolve to their targets
|
||||||
|
const isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
|
||||||
|
if (isWindows) {
|
||||||
|
dump("*** test_load_replace\n");
|
||||||
|
file = do_get_file("data/system_root.lnk", false);
|
||||||
|
var chan = new_file_channel(file);
|
||||||
|
|
||||||
|
// The LOAD_REPLACE flag should be set
|
||||||
|
do_check_eq(chan.loadFlags & chan.LOAD_REPLACE, chan.LOAD_REPLACE);
|
||||||
|
|
||||||
|
// The original URI path should differ from the URI path
|
||||||
|
do_check_neq(chan.URI.path, chan.originalURI.path);
|
||||||
|
|
||||||
|
// The original URI path should be the same as the lnk file path
|
||||||
|
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||||
|
getService(Ci.nsIIOService);
|
||||||
|
do_check_eq(chan.originalURI.path, ios.newFileURI(file).path);
|
||||||
|
}
|
||||||
|
run_next_test();
|
||||||
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
run_next_test();
|
run_next_test();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user