Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/test/data/safe_browsing/download_protection/navigation_observer/navigation_observer_tests.html

Issue 2538483002: Add management related code to SafeBrowsingNavigationObserverManager (Closed)
Patch Set: address nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 // Click on a link by id to star a test case. 4 // Click on a link by id to star a test case.
5 function clickLink(linkId) { 5 function clickLink(linkId) {
6 var node = document.getElementById(linkId); 6 var node = document.getElementById(linkId);
7 if (node != null) { 7 if (node != null) {
8 // Click and open link in the same tab. 8 // Click and open link in the same tab.
9 node.click(); 9 node.click();
10 } 10 }
11 } 11 }
12 12
13 // Redirect via window.location. 13 // Redirect via window.location.
14 function windowLocationRedirection() { 14 function windowLocationRedirection() {
15 window.location.assign("../signed.exe"); 15 window.location.assign("../signed.exe");
16 } 16 }
17 17
18 function mixRedirectDownload() { 18 function mixRedirectDownload() {
19 window.location.assign("redirect.html"); 19 window.location.assign("redirect.html");
20 } 20 }
21 21
22 // This triggers a download in a new tab with no opener. 22 // This triggers a download in a new tab with no opener.
23 function downloadInNewTab() { 23 function downloadInNewTab() {
24 var tab = window.open(''); 24 var tab = window.open('');
25 tab.opener = null; 25 tab.opener = null;
26 tab.document.write('<META HTTP-EQUIV="refresh" content="0; url=../signed.e xe">'); 26 tab.document.write('<META HTTP-EQUIV="refresh" content="0; url=../signed.e xe">');
27 tab.document.close(); 27 tab.document.close();
28 } 28 }
29 29
30 // Trigger download in a new tab and the download is from a data url. 30 // Trigger download in a new tab and the download is from a data url.
31 function downloadInNewTabWithDataURL() { 31 function downloadInNewTabWithDataURL() {
32 var tab = window.open(''); 32 var tab = window.open('');
33 tab.opener = null; 33 tab.opener = null;
34 tab.document.write('<META HTTP-EQUIV="refresh" content="0; url=data:appli cation/octet-stream;base64,a2poYWxrc2hkbGtoYXNka2xoYXNsa2RoYWxraGtoYWxza2hka2xza mFoZGxramhhc2xka2hhc2xrZGgKYXNrZGpoa2FzZGpoYWtzaGRrYXNoZGtoYXNrZGhhc2tkaGthc2hka 2Foc2RraGFrc2hka2FzaGRraGFzCmFza2pkaGFrc2hkbSxjbmtzamFoZGtoYXNrZGhhc2tka2hrYXNkC jg3MzQ2ODEyNzQ2OGtqc2hka2FoZHNrZGhraApha3NqZGthc2Roa3NkaGthc2hka2FzaGtkaAohISomX kAqJl4qYWhpZGFzeWRpeWlhc1xcb1wKa2Fqc2Roa2FzaGRrYXNoZGsKYWtzamRoc2tkaAplbmQK">'); 34 tab.document.write('<META HTTP-EQUIV="refresh" content="0; url=data:appli cation/octet-stream;base64,a2poYWxrc2hkbGtoYXNka2xoYXNsa2RoYWxraGtoYWxza2hka2xza mFoZGxramhhc2xka2hhc2xrZGgKYXNrZGpoa2FzZGpoYWtzaGRrYXNoZGtoYXNrZGhhc2tkaGthc2hka 2Foc2RraGFrc2hka2FzaGRraGFzCmFza2pkaGFrc2hkbSxjbmtzamFoZGtoYXNrZGhhc2tka2hrYXNkC jg3MzQ2ODEyNzQ2OGtqc2hka2FoZHNrZGhraApha3NqZGthc2Roa3NkaGthc2hka2FzaGtkaAohISomX kAqJl4qYWhpZGFzeWRpeWlhc1xcb1wKa2Fqc2Roa2FzaGRrYXNoZGsKYWtzamRoc2tkaAplbmQK">');
35 tab.document.close(); 35 tab.document.close();
36 } 36 }
37 37
38 // Create a data blob and save it as a test.exe file in filesystem's 38 // Create a data blob and save it as a test.exe file in filesystem's
39 // space with use URL filesystem:http://test_host/temporary/test.exe 39 // space with use URL filesystem:http://test_host/temporary/test.exe
40 // to download it. 40 // to download it.
41 function downloadViaFileApi(){ 41 function downloadViaFileApi(){
42 var errorize = function(e){console.log(e);}; 42 var errorize = function(e){console.log(e);};
43 var filename = 'test.exe'; 43 var filename = 'test.exe';
44 var blob = new Blob([new Uint8Array([1, 2, 3, 4])],{type:'application/octe t-stream'}); 44 var blob = new Blob([new Uint8Array([1, 2, 3, 4])],{type:'application/octe t-stream'});
45 window.webkitRequestFileSystem( 45 window.webkitRequestFileSystem(
46 window.TEMPORARY,1048576, 46 window.TEMPORARY,1048576,
47 function(fs){ 47 function(fs){
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 <a id="new_tab_download" href="#" onclick="downloadInNewTab(); return false; "> 110 <a id="new_tab_download" href="#" onclick="downloadInNewTab(); return false; ">
111 Open download in new tab 111 Open download in new tab
112 </a><br> 112 </a><br>
113 113
114 <a id="new_tab_download_with_data_url" href="#" onclick="downloadInNewTabWit hDataURL(); return false;"> 114 <a id="new_tab_download_with_data_url" href="#" onclick="downloadInNewTabWit hDataURL(); return false;">
115 Open download in new tab with data url 115 Open download in new tab with data url
116 </a><br> 116 </a><br>
117 117
118 <a id="html5_file_api" href="" onclick="downloadViaFileApi()"> 118 <a id="html5_file_api" href="" onclick="downloadViaFileApi()">
119 Download via HTML5 file system API 119 Download via HTML5 file system API
120 </a> 120 </a><br>
121
122 <a id="complete_referrer_chain" href="redirect_to_landing.html">
123 Click on landing referrer and landing page then reach download
124 </a><br>
125
126 <a id="attribution_within_two_user_gestures" href="page_before_landing_refer rer.html">
127 Attribution should not trace back more than 2 user gestures.
128 </a><br>
121 </body> 129 </body>
122 </html> 130 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698