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

Serialize window handles using JsonSerializer

This commit is contained in:
Matthew Horan 2012-12-29 15:58:56 -05:00
parent c0e896b064
commit 17158b7bc5

View file

@ -2,19 +2,20 @@
#include "WebPageManager.h" #include "WebPageManager.h"
#include "CommandFactory.h" #include "CommandFactory.h"
#include "WebPage.h" #include "WebPage.h"
#include "JsonSerializer.h"
#include <QStringList> #include <QStringList>
GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) { GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
} }
void GetWindowHandles::start() { void GetWindowHandles::start() {
QString handles = "["; QVariantList handles;
QStringList stringList;
foreach(WebPage *page, manager()->pages()) foreach(WebPage *page, manager()->pages())
stringList.append("\"" + page->uuid() + "\""); handles << page->uuid();
handles += stringList.join(",") + "]"; JsonSerializer serializer;
QString json = serializer.serialize(handles);
emitFinished(true, handles); emitFinished(true, json);
} }