forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebShare: Test that .apk and .dex are rejected
Test that executable .apk and .dex files are rejected on Android. BUG=903010 Change-Id: I5a000f5a129fad0d324aa8f830a173c09e798cde Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1588068 Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Eric Willigers <ericwilligers@chromium.org> Cr-Commit-Position: refs/heads/master@{#655431}
- Loading branch information
1 parent
69b258c
commit 3a39216
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Share</title> | ||
<script> | ||
function initiate_share() { | ||
if (navigator.share === undefined) { | ||
window.document.title = 'Fail: navigator.share === undefined'; | ||
return; | ||
} | ||
|
||
const fileBits = ['contents']; | ||
const fileName = 'blocked.apk'; | ||
const options = {type: 'text/plain'}; | ||
const data = {files: [new File(fileBits, fileName, options)]}; | ||
navigator.share(data).then(() => { | ||
window.document.title = 'Success'; | ||
}).catch(e => { | ||
window.document.title = 'Fail: ' + e; | ||
}); | ||
} | ||
|
||
window.addEventListener('load', () => { | ||
window.addEventListener('click', initiate_share); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Share</title> | ||
<script> | ||
function initiate_share() { | ||
if (navigator.share === undefined) { | ||
window.document.title = 'Fail: navigator.share === undefined'; | ||
return; | ||
} | ||
|
||
const fileBits = ['contents']; | ||
const fileName = 'blocked.dex'; | ||
const options = {type: 'text/plain'}; | ||
const data = {files: [new File(fileBits, fileName, options)]}; | ||
navigator.share(data).then(() => { | ||
window.document.title = 'Success'; | ||
}).catch(e => { | ||
window.document.title = 'Fail: ' + e; | ||
}); | ||
} | ||
|
||
window.addEventListener('load', () => { | ||
window.addEventListener('click', initiate_share); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |