| <script src="../../../resources/js-test-pre.js"></script> |
| <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script> |
| <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script> |
| <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-item.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| |
| description("Testing the <code>LayoutItem</code> class."); |
| |
| const layoutDelegate = new class |
| { |
| get layoutTraits() |
| { |
| return LayoutTraits.macOS | LayoutTraits.Fullscreen; |
| } |
| }; |
| |
| debug("Creating a LayoutItem and setting a layout delegate after construction."); |
| const itemWithNoParameter = new LayoutItem; |
| shouldBeTrue("itemWithNoParameter.layoutTraits === LayoutTraits.Unknown"); |
| |
| itemWithNoParameter.layoutDelegate = layoutDelegate; |
| shouldBeTrue("!!(itemWithNoParameter.layoutTraits | LayoutTraits.macOS)"); |
| shouldBeTrue("!!(itemWithNoParameter.layoutTraits | LayoutTraits.Fullscreen)"); |
| |
| debug(""); |
| debug("Creating a LayoutItem with a layout delegate set at construction."); |
| const itemWithLayoutDelegate = new LayoutItem({ layoutDelegate }); |
| shouldBeTrue("!!(itemWithLayoutDelegate.layoutTraits | LayoutTraits.macOS)"); |
| shouldBeTrue("!!(itemWithLayoutDelegate.layoutTraits | LayoutTraits.Fullscreen)"); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |