scrapinghub/splash — pull request #131 by sardok (2014-12-10 11:51:18+00:00)
Title: [WIP] Web view geometry inheritance revisited.

I tried to bring the notion of different device screen option which allows you to render the page as though the webpage is visited from a particular screen sized device.

The motivation:
I've come across with a website which dynamically changes its content and hides some of information if the device is smaller than a desktop. QWebPage inherits screen geometry information from QWebView (which does the same from QWidget most probably). So far, the geometry run at default value (640x480 if i'm not wrong). This PR, make QWebPage to set geometry immediate after it is created, i didnt test the effect changing the geometry at runtime and what happens to QWebPage.

This PR brings a simple unit test which expects a screen width to be a default value. I added custom yield_fixtures, having thinking to run TestServer() with different settings object which should be carried down to the WebpageRender. Now, there is no way to write test which uses different settings/configuration unless defaults.py is physically changed on disk.

So, do you think, is there a need for small refactoring about about running server at different configuration or is it better to look for an update which allows you to change the geometry (device screen size) at runtime, based on a url parameter for example?