| Index: chrome/test/data/webui/util_test.html
|
| diff --git a/chrome/test/data/webui/util_test.html b/chrome/test/data/webui/util_test.html
|
| index 0c8c4eabf43456b81243084ea5de692a6e0c649b..a93b48f89375fc2dcf6befdc8cc99c3c6fde8346 100644
|
| --- a/chrome/test/data/webui/util_test.html
|
| +++ b/chrome/test/data/webui/util_test.html
|
| @@ -20,6 +20,36 @@ function testQuoteString() {
|
| assertEquals(null, match);
|
| }
|
|
|
| +// Test the case where the origin URL is passed.
|
| +function testGetFaviconImageSet_Origin() {
|
| + var url = 'http://foo.com';
|
| + var expectedDesktop = '-webkit-image-set(' +
|
| + 'url("chrome://favicon/size/16@1x/origin/http://foo.com") 1x, ' +
|
| + 'url("chrome://favicon/size/16@2x/origin/http://foo.com") 2x)';
|
| + var expectedOther = '-webkit-image-set(' +
|
| + 'url("chrome://favicon/size/16@1x/origin/http://foo.com") ' +
|
| + window.devicePixelRatio + 'x)';
|
| +
|
| + var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux;
|
| + var expected = isDesktop ? expectedDesktop : expectedOther;
|
| + assertEquals(expected, getFaviconImageSet(url));
|
| +}
|
| +
|
| +// Test the case where the favicon URL is passed.
|
| +function testGetFaviconImageSet_IconUrl() {
|
| + var url = 'http://foo.com/foo.ico';
|
| + var expectedDesktop = '-webkit-image-set(' +
|
| + 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") 1x, ' +
|
| + 'url("chrome://favicon/size/16@2x/iconurl/http://foo.com/foo.ico") 2x)';
|
| + var expectedOther = '-webkit-image-set(' +
|
| + 'url("chrome://favicon/size/16@1x/iconurl/http://foo.com/foo.ico") ' +
|
| + window.devicePixelRatio + 'x)';
|
| +
|
| + var isDesktop = cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux;
|
| + var expected = isDesktop ? expectedDesktop : expectedOther;
|
| + assertEquals(expected, getFaviconImageSet(url));
|
| +}
|
| +
|
| </script>
|
| </body>
|
| </html>
|
|
|