allow local storage; prevent crash if line is missing

master
Marc Wäckerlin 9 years ago
parent 1198cac399
commit 14fb15f117
  1. 25
      ChangeLog
  2. 4
      bootstrap.sh
  3. 1
      src/commands.hxx
  4. 6
      src/exceptions.hxx
  5. 6
      src/webpage.hxx

@ -1,3 +1,28 @@
2015-11-07 10:47 marc
* bootstrap.sh, debian/control.in: there is no qt4-default
2015-11-07 09:23 marc
* bootstrap.sh: there is no qt4-default
2015-11-04 11:59 marc
* src/commands.hxx: removed empty lines and comments from test
results
2015-11-04 10:34 marc
* bootstrap.sh, build-in-docker.sh, configure.ac,
debian/control.in, examples, resolve-debbuilddeps.sh,
webtester.spec.in: build in docker tested
2015-11-04 08:52 marc
* ChangeLog, ax_init_standard_project.m4, bootstrap.sh,
configure.ac, examples, examples/makefile.am, makefile.am, test,
test/makefile.am: examples is test
2015-11-03 21:54 marc 2015-11-03 21:54 marc
* debian/control.in: updated dependencies * debian/control.in: updated dependencies

@ -196,7 +196,7 @@ FILES
<ou can access the readme by calling <ou can access the readme by calling
${DEFAULT_PROJECT_NAME}::description(). ${DEFAULT_PROJECT_NAME}::description().
* ChangeLog: Your changelog is automatically maintained from * ChangeLog: Your changelog is automatically maintained from
subversion history, using svn2cl | subversion-tools. You don't need to subversion history, using svn2cl. You don't need to
care about. care about.
* configure.ac: This file becomes very short and simple. You provide * configure.ac: This file becomes very short and simple. You provide
the project name, the major and minor version. The the project name, the major and minor version. The
@ -1014,7 +1014,7 @@ if test -f makefile; then
fi fi
#### Bootstrap Before Configure #### #### Bootstrap Before Configure ####
run --no-check svn2cl | subversion-tools run --no-check svn2cl
run aclocal run aclocal
if testtag AX_USE_LIBTOOL; then run libtoolize --force; fi if testtag AX_USE_LIBTOOL; then run libtoolize --force; fi
run automake -a run automake -a

@ -537,6 +537,7 @@ class Script: public QObject {
QString filename, int linenr, QString filename, int linenr,
int indent) try { int indent) try {
std::shared_ptr<Command> command; std::shared_ptr<Command> command;
if (!in.size()) throw MissingLine();
QString line(in.takeFirst().trimmed()); QString line(in.takeFirst().trimmed());
QString cmd(line), args; QString cmd(line), args;
int space(line.indexOf(' ')); int space(line.indexOf(' '));

@ -49,6 +49,12 @@ class MissingArguments: public ParseError {
ParseError("missing arguments, requires "+req+", got: "+args) {} ParseError("missing arguments, requires "+req+", got: "+args) {}
}; };
class MissingLine: public ParseError {
public:
MissingLine():
ParseError("line expectet at end of file") {}
};
class TestFailed: public Exception { class TestFailed: public Exception {
public: public:
TestFailed(QString why): Exception("Test Failed: "+why) {} TestFailed(QString why): Exception("Test Failed: "+why) {}

@ -11,6 +11,7 @@
#include <networkaccessmanager.hxx> #include <networkaccessmanager.hxx>
#include <QWebPage> #include <QWebPage>
#include <QWebFrame> #include <QWebFrame>
#include <QWebSettings>
#include <QWidget> #include <QWidget>
#include <QFileDialog> #include <QFileDialog>
#include <QFile> #include <QFile>
@ -31,6 +32,11 @@ class TestWebPage: public QWebPage {
QWebPage(parent), QWebPage(parent),
_unattended(unattended) { _unattended(unattended) {
setNetworkAccessManager(new NetworkAccessManager(this)); setNetworkAccessManager(new NetworkAccessManager(this));
settings()->setOfflineStorageDefaultQuota(1024*1024*1024);
settings()->setOfflineStoragePath("/tmp/");
settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
//settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
} }
virtual ~TestWebPage() { virtual ~TestWebPage() {
if (!_nextFile.isEmpty() && !std::uncaught_exception()) if (!_nextFile.isEmpty() && !std::uncaught_exception())

Loading…
Cancel
Save