blob: bf72e0638cafb4dfadad2d80d982cf2d1f85f7ad [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, new MacOSLayoutTraits(LayoutTraits.Mode.Inline)).src.includes("macOS/Airplay.svg")');
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, new IOSLayoutTraits(LayoutTraits.Mode.Inline)).src.includes("iOS/Airplay.svg")');
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, new MacOSLayoutTraits(LayoutTraits.Mode.Fullscreen)).src.includes("macOS/Airplay-fullscreen.svg")');
debug("");
debug("Checking fullscreen layout traits are ignored on iOS");
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, new IOSLayoutTraits(LayoutTraits.Mode.Fullscreen)) === iconService.imageForIconAndLayoutTraits(Icons.Airplay, new IOSLayoutTraits(LayoutTraits.Mode.Inline))');
debug("");
debug("Checking requested images are cached");
shouldBeTrue('iconService.imageForIconAndLayoutTraits(Icons.Airplay, new MacOSLayoutTraits(LayoutTraits.Mode.Inline)) === iconService.imageForIconAndLayoutTraits(Icons.Airplay, new MacOSLayoutTraits(LayoutTraits.Mode.Inline))');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>