blob: db00f0297edb9e089376b1f31edfcdc5106ab6e8 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
description("Testing the <code>iconService</code> singleton.");
iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
debug("Checking path to images is computed according to traits");
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.macOS).src.includes("macOS/Airplay.svg")');
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.iOS).src.includes("iOS/Airplay.svg")');
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.macOS | LayoutTraits.Fullscreen).src.includes("macOS/Airplay-fullscreen.svg")');
debug("");
debug("Checking fullscreen layout traits are ignored on iOS");
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.iOS | LayoutTraits.Fullscreen) === iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.iOS)');
debug("");
debug("Checking requested images are cached");
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.macOS) === iconService.imageForIconAndLayoutTraits(Icons.Airplay, LayoutTraits.macOS)');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>