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

24 lines
622 B
C++
Raw Normal View History

#include "GetWindowHandles.h"
#include "WebPageManager.h"
#include "CommandFactory.h"
#include "WebPage.h"
#include <QStringList>
GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
}
void GetWindowHandles::start() {
QListIterator<WebPage *> pageIterator = manager()->iterator();
QString handles = "[";
QStringList stringList;
while (pageIterator.hasNext()) {
stringList.append("\"" + pageIterator.next()->uuid() + "\"");
}
handles += stringList.join(",") + "]";
emit finished(new Response(true, handles));
}