Testing Window Resize

Verify that window snaps into correct ratio
import java.awt.Dimension;
import quicktime.QTException;
import abbot.tester.WindowTester;
import com.elharo.quicktime.*;

public class RatioTest extends junit.extensions.abbot.ComponentTestFixture {
    
    private PlayerFrame frame;
    private WindowTester tester = new WindowTester();
    
    static {
        try {
            QuicktimeInit.setup();
        }
        catch (QTException ex) {
            throw new RuntimeException(ex);
        }   
    }
    
    protected void setUp() throws QTException {
        frame = new PlayerFrame();
        frame.show();
    }

    protected void tearDown() {
        frame.hide();
        frame.dispose();
    }

    
    public void testInitialFrameIsNotTooSmall() { 
        Dimension d = frame.getSize();
        double ratio = d.getHeight() / d.getWidth();
        tester.actionResize(frame, 2*d.width, d.height);
        d = frame.getSize();
        assertEquals(ratio, d.getHeight() / d.getWidth(), 0.01);   
    }
    
}

Previous | Next | Top | Cafe con Leche

Copyright 2005 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 28, 2005