browser_UITour_annotation_size_attributes.js (1752B)
1 /* 2 * Test that width and height attributes don't get set by widget code on the highlight panel. 3 */ 4 5 "use strict"; 6 7 var gTestTab; 8 var gContentAPI; 9 var highlight = UITour.getHighlightContainerAndMaybeCreate(document); 10 var tooltip = UITour.getTooltipAndMaybeCreate(document); 11 12 add_task(setup_UITourTest); 13 14 add_UITour_task(async function test_highlight_size_attributes() { 15 await gContentAPI.showHighlight("appMenu"); 16 await elementVisiblePromise( 17 highlight, 18 "Highlight should be shown after showHighlight() for the appMenu" 19 ); 20 await gContentAPI.showHighlight("urlbar"); 21 await elementVisiblePromise( 22 highlight, 23 "Highlight should be moved to the urlbar" 24 ); 25 await new Promise(resolve => { 26 SimpleTest.executeSoon(() => { 27 is( 28 highlight.style.height, 29 "", 30 "Highlight panel should have no explicit height set" 31 ); 32 is( 33 highlight.style.width, 34 "", 35 "Highlight panel should have no explicit width set" 36 ); 37 resolve(); 38 }); 39 }); 40 }); 41 42 add_UITour_task(async function test_info_size_attributes() { 43 await gContentAPI.showInfo("appMenu", "test title", "test text"); 44 await elementVisiblePromise( 45 tooltip, 46 "Tooltip should be shown after showInfo() for the appMenu" 47 ); 48 await gContentAPI.showInfo("urlbar", "new title", "new text"); 49 await elementVisiblePromise(tooltip, "Tooltip should be moved to the urlbar"); 50 await new Promise(resolve => { 51 SimpleTest.executeSoon(() => { 52 is( 53 tooltip.style.height, 54 "", 55 "Info panel should have no explicit height set" 56 ); 57 is( 58 tooltip.style.width, 59 "", 60 "Info panel should have no explicit width set" 61 ); 62 resolve(); 63 }); 64 }); 65 });