Chromium Code Reviews| 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..5b11aa266e1f83cc3fadc5f99144947d9dc344e4 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. */ |
|
Dan Beam
2016/04/27 02:18:31
nit: single-line comments, i.e. // Test ...
dpapad
2016/04/27 17:21:47
Done.
|
| +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> |