Class WindowResizer
- java.lang.Object
-
- com.github.loyada.jdollarx.singlebrowser.sizing.WindowResizer
-
- All Implemented Interfaces:
AutoCloseable
public class WindowResizer extends Object implements AutoCloseable
An AutoCloseable resizer for the browser. When closing, it reverts the the original state
-
-
Constructor Summary
Constructors Constructor Description WindowResizer(int expectedWidth, int expectedHeight)Resize a browser to the requested dimensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Revert stateLonggetTotalHeight()get total scrollable height of the browserLonggetTotalWidth()get total scrollable width of the browserLonggetVisibleHeight()get visible height of the browserLonggetVisibleWidth()get visible width of the browser
-
-
-
Constructor Detail
-
WindowResizer
public WindowResizer(int expectedWidth, int expectedHeight)Resize a browser to the requested dimensions. First it changes the window size, and then it updates the size of the html inside it.- Parameters:
expectedWidth- expected widthexpectedHeight- expected height
-
-
Method Detail
-
getVisibleHeight
public Long getVisibleHeight()
get visible height of the browser- Returns:
- height
-
getVisibleWidth
public Long getVisibleWidth()
get visible width of the browser- Returns:
- width
-
getTotalHeight
public Long getTotalHeight()
get total scrollable height of the browser- Returns:
- height
-
getTotalWidth
public Long getTotalWidth()
get total scrollable width of the browser- Returns:
- width
-
close
public void close()
Revert state- Specified by:
closein interfaceAutoCloseable
-
-