Sha256: 803fc9d28aaa5b54afb9528eea621f93c0d6afe24bbdf342e801f33ce71ab233

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 Bytes

Contents

#include <QtGui>
#include <QtWebKit>
#include <iostream>

#include "Page.h"

  Page::Page() : QWebPage(), confirmResult(true) {}

  void Page::javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &sourceID) {
    emit consoleLog(message, lineNumber, sourceID);
  }

  bool Page::javaScriptConfirm(QWebFrame*, const QString&) {
    if (confirmResult) {
      emit internalLog("TODO", "jasmine-headless-webkit can't handle confirm() yet! You should mock window.confirm for now. Returning true.");
      return true;
    } else {
      confirmResult = true;
      return false;
    }
  }

  void Page::javaScriptAlert(QWebFrame*, const QString &msg) {
    emit internalLog("alert", msg);
  }

  void Page::oneFalseConfirm() {
    confirmResult = false;
  }

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jasmine-headless-webkit-0.7.3.1 ext/jasmine-webkit-specrunner/Page.cpp
jasmine-headless-webkit-0.7.2 ext/jasmine-webkit-specrunner/Page.cpp
jasmine-headless-webkit-0.7.1 ext/jasmine-webkit-specrunner/Page.cpp
jasmine-headless-webkit-0.7.0 ext/jasmine-webkit-specrunner/Page.cpp