Bug 22795: favicons should be saved to webarchives
[WebKit-https.git] / LayoutTests / webarchive / test-link-rel-icon.html
1 <html>
2 <head>
3 <script>
4 function runTest()
5 {
6     if (!location.href.match('\\?')) {
7         if (window.layoutTestController) {
8             layoutTestController.setIconDatabaseEnabled(true);
9             layoutTestController.dumpDOMAsWebArchive();
10             layoutTestController.waitUntilDone();
11         }
12         // Reload once since we just enabled the icon database
13         redirect('1');
14     } else if (!location.href.match('\\?2')) {
15         // Reload twice to work around Bug 21026 / <rdar://problem/6240826>
16         redirect('2');
17     } else {
18         if (window.layoutTestController) {
19             layoutTestController.notifyDone();
20         }
21     }
22 }
23
24 function redirect(arg)
25 {
26     var loc = '' + document.location;
27     if (loc.indexOf('?') > 0)
28         loc = loc.substring(0, loc.indexOf('?'));
29     document.location = loc + '?' + arg;
30 }
31 </script>
32 <link rel="icon" href="resources/favicon.ico" type="image/x-icon">
33 </head>
34 <body onload="runTest()">
35 </body>
36 </html>