summaryrefslogtreecommitdiff
path: root/browser/unit-tests/browserdbus/testbrowserdbus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'browser/unit-tests/browserdbus/testbrowserdbus.cpp')
-rw-r--r--browser/unit-tests/browserdbus/testbrowserdbus.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/browser/unit-tests/browserdbus/testbrowserdbus.cpp b/browser/unit-tests/browserdbus/testbrowserdbus.cpp
index 3744187..f8b0f1b 100644
--- a/browser/unit-tests/browserdbus/testbrowserdbus.cpp
+++ b/browser/unit-tests/browserdbus/testbrowserdbus.cpp
@@ -47,6 +47,7 @@ void TestBrowserDBus::testCallUninitialized() {
void TestBrowserDBus::testGetTitle() {
QSignalSpy spy (m_bdb, SIGNAL (pageloadingChanged(void)));
m_bdb->createPageWindow(1,0,0,10,10);
+ m_bdb->loadurl(testFileUrl());
spy.wait(1000);
QVERIFY (m_bdb->getTitle().compare("") != 0);
}
@@ -238,14 +239,12 @@ void TestBrowserDBus::testSelect() {
QTest::qSleep(300);
m_bdb->select();
QTest::qSleep(300);
- QProcess::execute("xdotool getwindowname `xdotool getwindowfocus`");
}
void TestBrowserDBus::testActivate() {
m_bdb->createPageWindow(1,0,0,800,600);
QTest::qSleep(300);
m_bdb->activate();
QTest::qSleep(300);
- QProcess::execute("xdotool getwindowname `xdotool getwindowfocus`");
}
void TestBrowserDBus::testConfirmDialog() {
@@ -311,13 +310,16 @@ void TestBrowserDBus::testGetPrevEnteredValues() {
m_bdb->createPageWindow(1,0,0,800,600);
m_bdb->loadurl(testFileUrl());
QTest::qSleep(300);
- QProcess::execute("xdotool mousemove 200 375");
+ QProcess::execute("xdotool mousemove 200 350");
QProcess::execute("xdotool click 1");
QTest::qSleep(300);
m_bdb->inputText(conn::brw::DR_OK, "Hello world");
QTest::qSleep(300);
QStringList list = m_bdb->getPrevEnteredValues("input", "", conn::brw::IET_TEXT);
QVERIFY(list.contains("Hello world"));
+
+ QStringList list2 = m_bdb->getPrevEnteredValues("input", "ello", conn::brw::IET_TEXT);
+ QVERIFY(list2.contains("Hello world"));
}
void TestBrowserDBus::testGetsNotifiedWhenSelectIsSelected() {
@@ -335,7 +337,7 @@ void TestBrowserDBus::testGetsNotifiedWhenSelectIsSelected() {
qDebug() << options.at(i).strValue;
}
}
-
+/*
void TestBrowserDBus::testGetsNotifiedOnAuthDialog() {
QSignalSpy spy (m_bdb, SIGNAL(onAuthenticationDialog(const conn::brw::AuthenticationData&)));
m_bdb->createPageWindow(1,0,0,800,600);
@@ -343,26 +345,13 @@ void TestBrowserDBus::testGetsNotifiedOnAuthDialog() {
QVERIFY(spy.wait(1000));
}
-void TestBrowserDBus::testCanCloseAuthDialog() {
- QSignalSpy spy (m_bdb, SIGNAL(onAuthenticationDialog(const conn::brw::AuthenticationData&)));
- m_bdb->createPageWindow(1,0,0,800,600);
- m_bdb->loadurl("http://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx");
- QVERIFY(spy.wait(1000));
-
- conn::brw::AuthenticationData d;
- d.strUserName = "httpwatch";
- d.strPassword = QString(qrand());
- qDebug() << ": user" << d.strUserName << "password:" << d.strPassword;
- m_bdb->closeAuthenticationDialog(conn::brw::DR_OK, d);
-}
-
void TestBrowserDBus::testGetsNotifiedOnBadSSL() {
QSignalSpy spy (m_bdb, SIGNAL(onSslErrorDialog(const conn::brw::SslError&)));
m_bdb->createPageWindow(1,0,0,800,600);
m_bdb->loadurl("https://tv.eurosport.com/");
QVERIFY(spy.wait(1000));
}
-
+*/
void TestBrowserDBus::testCanCloseSslDialog() {
QSignalSpy spy (m_bdb, SIGNAL(onSslErrorDialog(const conn::brw::SslError&)));
m_bdb->createPageWindow(1,0,0,800,600);
@@ -379,9 +368,9 @@ void TestBrowserDBus::testCanCancelSSL() {
QSignalSpy spy2 (m_bdb, SIGNAL(onSslErrorDialogCancel(const conn::brw::SslError&)));
m_bdb->createPageWindow(1,0,0,800,600);
m_bdb->loadurl("https://tv.eurosport.com/");
- QVERIFY(spy.wait(1000));
+ QVERIFY(spy.wait(3000));
m_bdb->closeSslErrorDialog(conn::brw::DR_CANCEL, false);
- QVERIFY(spy2.wait());
+ QVERIFY(spy2.wait(1000));
}
void TestBrowserDBus::testCanCancelAuth() {
@@ -396,6 +385,19 @@ void TestBrowserDBus::testCanCancelAuth() {
QVERIFY(spy2.wait(1000));
}
+void TestBrowserDBus::testCanCloseAuthDialog() {
+ QSignalSpy spy (m_bdb, SIGNAL(onAuthenticationDialog(const conn::brw::AuthenticationData&)));
+ m_bdb->createPageWindow(1,0,0,800,600);
+ m_bdb->loadurl("http://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx");
+ QVERIFY(spy.wait(1000));
+
+ conn::brw::AuthenticationData d;
+ d.strUserName = "httpwatch";
+ d.strPassword = QString(qrand());
+ qDebug() << ": user" << d.strUserName << "password:" << d.strPassword;
+ m_bdb->closeAuthenticationDialog(conn::brw::DR_OK, d);
+}
+
void TestBrowserDBus::testCanSelectOptionsInSelectList() {
QSignalSpy spy (m_bdb, SIGNAL(onSelect(const QString &, const conn::brw::SelectableOptionList &, bool)));
m_bdb->createPageWindow(1,0,0,800,600);