|
|
|
@ -68,6 +68,44 @@ class TestWebPage: public QWebPage { |
|
|
|
|
return filename; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
virtual void javaScriptAlert(QWebFrame* frame, const QString& msg) { |
|
|
|
|
LOG("javaScriptAlert: "+msg); |
|
|
|
|
if (_unattended) { |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
return; |
|
|
|
|
//return QWebPage::javaScriptAlert(frame, msg);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
virtual bool javaScriptConfirm(QWebFrame* frame, const QString& msg) { |
|
|
|
|
LOG("javaScriptConfirm "+msg); |
|
|
|
|
if (_unattended) { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return true; |
|
|
|
|
//return QWebPage::javaScriptConfirm(frame, msg);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
virtual void javaScriptConsoleMessage(const QString& msg, |
|
|
|
|
int line, const QString& src) { |
|
|
|
|
LOG("javaScriptConsoleMessage: "+msg); |
|
|
|
|
if (_unattended) { |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
return; |
|
|
|
|
//return QWebPage::javaScriptConsoleMessage(msg, line, src);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
virtual bool javaScriptPrompt(QWebFrame* frame, const QString& msg, |
|
|
|
|
const QString& defaultValue, QString* result) { |
|
|
|
|
LOG("javaScriptPrompt: "+msg); |
|
|
|
|
if (_unattended) { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return true; |
|
|
|
|
//return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private: |
|
|
|
|
bool _unattended; |
|
|
|
|
QString _nextFile; |
|
|
|
|