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:
parent
c0e896b064
commit
17158b7bc5
1 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue