Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / testing / sisyphus / tests / mozilla.org / download-page / userhook-ftp.js
blob9395a394cdcd8d3aa84147a8ab1e55dd37446a93
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 var gOS;
4 var gURLS = {};
6 function userOnStart()
8 dlog('userOnStart()');
10 if (navigator.oscpu.search(/Linux/) != -1)
11 gOS = 'linux';
12 else if (navigator.oscpu.search(/Mac/) != -1)
13 gOS = 'mac';
14 else if (navigator.oscpu.search(/Windows/) != -1)
15 gOS = 'win32';
19 function userOnBeforePage()
21 dlog('userOnBeforePage()');
24 function userOnPause()
26 dlog('userOnPause()');
29 function userOnAfterPage()
31 dlog('userOnAfterPage()');
33 var win = gSpider.mDocument.defaultView;
34 if (win.wrappedJSObject)
36 win = win.wrappedJSObject;
39 //cdump('processing = ' + win.location.href);
41 var links = win.document.links;
42 var length = links.length;
45 for (var ilink = 0; ilink < length; ilink++)
48 var href = links[ilink].href;
50 if (typeof gURLS[href] != 'undefined')
51 continue;
53 gURLS[href] = 1;
55 switch(gOS)
57 case 'linux':
58 if (/\.linux-i686\.tar\.(gz|bz2)$/.test(href))
60 cdump('href: ' + href);
62 break;
64 case 'mac':
65 if (/\.mac\.dmg$/.test(href))
67 cdump('href: ' + href);
69 break;
71 case 'win32':
72 if (/\.win32\.(zip|installer\.exe)$/.test(href))
74 cdump('href: ' + href);
76 break;
78 default:
79 break;
83 gPageCompleted = true;
87 function userOnStop()
89 dlog('userOnStop()');