diff --git a/ext/jasmine-webkit-specrunner/specrunner.cpp b/ext/jasmine-webkit-specrunner/specrunner.cpp index 939b59e..b0f78d6 100644 --- a/ext/jasmine-webkit-specrunner/specrunner.cpp +++ b/ext/jasmine-webkit-specrunner/specrunner.cpp @@ -36,6 +36,8 @@ signals: void consoleLog(const QString &msg, int lineNumber, const QString &sourceID); protected: void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID); + bool javaScriptConfirm(QWebFrame *frame, const QString &msg); + void javaScriptAlert(QWebFrame *frame, const QString &msg); }; void HeadlessSpecRunnerPage::javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &sourceID) @@ -43,6 +45,19 @@ void HeadlessSpecRunnerPage::javaScriptConsoleMessage(const QString &message, in emit consoleLog(message, lineNumber, sourceID); } +bool HeadlessSpecRunnerPage::javaScriptConfirm(QWebFrame *frame, const QString &msg) +{ + std::cout << "[TODO] "; + std::cout << "jasmine-headless-webkit can't handle confirm() yet! You should mock window.confirm for now. Returning true." << std::endl; + return true; +} + +void HeadlessSpecRunnerPage::javaScriptAlert(QWebFrame *frame, const QString &msg) +{ + std::cout << "[alert] "; + std::cout << qPrintable(msg) << std::endl; +} + class HeadlessSpecRunner: public QObject { Q_OBJECT