setViewportSize = function setViewportSize(size, type) {
    /**
     * parameter check
     */
    if (typeof size !== 'object' || typeof size.width !== 'number' || typeof size.height !== 'number' || typeof type !== 'undefined' && typeof type !== 'boolean') {
        throw new _ErrorHandler.CommandError('number or type of arguments don\'t agree with setViewportSize command');
    }

    var shouldIndent = typeof type === 'undefined' ? true : type;
    return shouldIndent ? _setViewportSize.call(this, size) : this.windowHandleSize(size);
}
This command changes the viewport size of the browser. When talking about browser size we have to differentiate
between the actual window size of the browser application and the document/viewport size of the website. The
window size will always be bigger since it includes the height of any menu or status bars.

The command tries to resize the browser multiple times (max 5 times) because Webdriver only allows to change
the window size and doesn't take the viewport into consideration. This is handled by WebdriverIO internally.

<example>
    :setViewportSize.js
    it('should resize the current viewport', function () {
        browser.setViewportSize({
            width: 500,
            height: 500
        });

        var windowSize = browser.windowHandleSize();
        console.log(windowSize.value); // outputs: { width: 500, height: 602 }
    });
</example>

@alias browser.setViewportSize
@param {Object}   size  window width/height
@param {Boolean}  type  set to `false` to change window size, `true` (default) to change viewport size
@uses protocol/execute, protocol/windowHandleSize
@type window