1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/WindowSize.cpp

18 lines
510 B
C++
Raw Normal View History

#include "WindowSize.h"
#include "WebPage.h"
#include "WebPageManager.h"
#include "JsonSerializer.h"
WindowSize::WindowSize(WebPageManager *manager, QStringList &arguments, QObject *parent) : WindowCommand(manager, arguments, parent) {
}
void WindowSize::windowFound(WebPage *page) {
QSize size = page->viewportSize();
QVariantList elements;
elements << size.width();
elements << size.height();
JsonSerializer serializer;
QByteArray json = serializer.serialize(elements);
finish(true, json);
}