private void checkTransformation(String input, String expected,
int deviceWidth,
boolean convertPercentagesToPixels)
throws Throwable {
ProtocolSupportFactory factory = new DefaultProtocolSupportFactory();
DOMProtocolMock protocolMock = new DOMProtocolMock(
"protocolMock", expectations, factory, null);
TransformationConfigurationMock transformationConfigurationMock =
new TransformationConfigurationMock(
"transformationConfigurationMock", expectations);
MarinerPageContextMock pageContextMock = new MarinerPageContextMock(
"pageContextMock", expectations);
InternalDeviceMock deviceMock = new InternalDeviceMock(
"deviceMock", expectations);
ProtocolConfigurationMock protocolConfigMock =
new ProtocolConfigurationMock("protocolConfigMock",
expectations);
// XHTML Mobile 1.0 doesn't support nested tables.
protocolMock.expects.supportsNestedTables().returns(false).any();
protocolMock.expects.getMarinerPageContext().returns(pageContextMock).any();
protocolMock.expects.getDOMFactory().returns(factory.getDOMFactory()).any();
protocolMock.expects.getProtocolConfiguration().returns(protocolConfigMock).any();
pageContextMock.expects.getDevice().returns(deviceMock).any();
deviceMock.expects.getPolicyValue(DevicePolicyConstants.PROTOCOL_CSS_EMULATE_WIDTH_PERCENTAGE_TABLE)