OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script> | 4 <script> |
5 | 5 |
6 // Test the case where a non-favicon URL is passed. | 6 // Test the case where a non-favicon URL is passed. |
7 function testGetFaviconImageSet_NonFavicon() { | 7 function testGetFavicon_NonFavicon() { |
8 var url = 'http://foo.com'; | 8 var url = 'http://foo.com'; |
9 var expectedDesktop = '-webkit-image-set(' + | 9 var expectedDesktop = '-webkit-image-set(' + |
10 'url("chrome://favicon/size/16@1x/http://foo.com") 1x, ' + | 10 'url("chrome://favicon/size/16@1x/http://foo.com") 1x, ' + |
11 'url("chrome://favicon/size/16@2x/http://foo.com") 2x)'; | 11 'url("chrome://favicon/size/16@2x/http://foo.com") 2x)'; |
12 var expectedOther = '-webkit-image-set(' + | 12 var expectedOther = '-webkit-image-set(' + |
13 'url("chrome://favicon/size/16@1x/http://foo.com") ' + | 13 'url("chrome://favicon/size/16@1x/http://foo.com") ' + |
14 window.devicePixelRatio + 'x)'; | 14 window.devicePixelRatio + 'x)'; |
15 | 15 |
16 var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux; | 16 var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux; |
17 var expected = isDesktop ? expectedDesktop : expectedOther; | 17 var expected = isDesktop ? expectedDesktop : expectedOther; |
18 assertEquals(expected, cr.icon.getFaviconImageSet(url)); | 18 assertEquals(expected, cr.icon.getFavicon(url)); |
19 } | 19 } |
20 | 20 |
21 // Test the case where the favicon URL is passed. | 21 // Test the case where the favicon URL is passed. |
22 function testGetFaviconImageSet_IconUrl() { | 22 function testGetFavicon_IconUrl() { |
23 var url = 'http://foo.com/foo.ico'; | 23 var url = 'http://foo.com/foo.ico'; |
24 var expectedDesktop = '-webkit-image-set(' + | 24 var expectedDesktop = '-webkit-image-set(' + |
25 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") 1x, ' + | 25 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") 1x, ' + |
26 'url("chrome://favicon/size/16@2x/iconurl/http://foo.com/foo.ico") 2x)'; | 26 'url("chrome://favicon/size/16@2x/iconurl/http://foo.com/foo.ico") 2x)'; |
27 var expectedOther = '-webkit-image-set(' + | 27 var expectedOther = '-webkit-image-set(' + |
28 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") ' + | 28 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") ' + |
29 window.devicePixelRatio + 'x)'; | 29 window.devicePixelRatio + 'x)'; |
30 | 30 |
31 var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux; | 31 var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux; |
32 var expected = isDesktop ? expectedDesktop : expectedOther; | 32 var expected = isDesktop ? expectedDesktop : expectedOther; |
33 assertEquals(expected, cr.icon.getFaviconImageSet(url)); | 33 assertEquals(expected, cr.icon.getFavicon(url)); |
34 } | 34 } |
35 | 35 |
36 </script> | 36 </script> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |