diff options
author | Jonatan Pålsson <jonatan.palsson@pelagicore.com> | 2014-02-05 17:58:43 +0100 |
---|---|---|
committer | Jonatan Pålsson <jonatan.palsson@pelagicore.com> | 2014-02-05 17:58:43 +0100 |
commit | 3dd286e11a433ad9b0ca1d95f22d6447744e8911 (patch) | |
tree | 6e1dec4731d69ca6a3551a70c178e45d57c46431 | |
parent | 016f6a47bfe026016e318d150bfee7bd07393d82 (diff) | |
download | browser-poc-3dd286e11a433ad9b0ca1d95f22d6447744e8911.tar.gz |
Added manual test for getPageIcon and modified client-side API a bit
-rw-r--r-- | browser/unit-tests/browserdbus/testbrowserdbus.cpp | 3 | ||||
-rw-r--r-- | common/browserdbus.cpp | 4 | ||||
-rw-r--r-- | common/browserdbus.h | 2 | ||||
-rw-r--r-- | testapp/qml/testapp/WebPageWindow.qml | 40 | ||||
-rw-r--r-- | testapp/qml/testapp/main.qml | 2 |
5 files changed, 46 insertions, 5 deletions
diff --git a/browser/unit-tests/browserdbus/testbrowserdbus.cpp b/browser/unit-tests/browserdbus/testbrowserdbus.cpp index ca462ef..3490c10 100644 --- a/browser/unit-tests/browserdbus/testbrowserdbus.cpp +++ b/browser/unit-tests/browserdbus/testbrowserdbus.cpp @@ -181,8 +181,7 @@ void TestBrowserDBus::testCanSetAndGetScrollPosition() { void TestBrowserDBus::testCanGeneratePageIcon() { m_bdb->loadurl(testFileUrl()); QTest::qSleep(300); - QString iconPath; - m_bdb->getPageIcon(testFileUrl(), iconPath); + QString iconPath = m_bdb->getPageIcon(testFileUrl()); qDebug() << iconPath; QVERIFY(iconPath.compare(QString("")) != 0); } diff --git a/common/browserdbus.cpp b/common/browserdbus.cpp index 7c4996e..41746fa 100644 --- a/common/browserdbus.cpp +++ b/common/browserdbus.cpp @@ -601,8 +601,9 @@ void BrowserDbus::setScrollPosition(uint &x, uint &y) { } } -void BrowserDbus::getPageIcon(QString iconPath, QString &iconFilePath) { +QString BrowserDbus::getPageIcon(QString iconPath) { qDebug() << __PRETTY_FUNCTION__; + QString iconFilePath; QDBusReply<conn::brw::ERROR_IDS> reply = actualtab->getPageIcon(iconPath,iconFilePath); @@ -613,4 +614,5 @@ void BrowserDbus::getPageIcon(QString iconPath, QString &iconFilePath) { QDBusError error = reply.error(); qDebug() << "ERROR " << error.name() << error.message(); } + return iconFilePath; } diff --git a/common/browserdbus.h b/common/browserdbus.h index 6482ef0..81b22cf 100644 --- a/common/browserdbus.h +++ b/common/browserdbus.h @@ -68,7 +68,7 @@ public: Q_INVOKABLE void setZoomFactor(double); Q_INVOKABLE void getScrollPosition(uint &x, uint &y); Q_INVOKABLE void setScrollPosition(uint &x, uint &y); - Q_INVOKABLE void getPageIcon(QString, QString &); + Q_INVOKABLE QString getPageIcon(QString); QString title() { return m_title; } void setTitle(QString title) { m_title = title; } diff --git a/testapp/qml/testapp/WebPageWindow.qml b/testapp/qml/testapp/WebPageWindow.qml index 65dd840..b4966c9 100644 --- a/testapp/qml/testapp/WebPageWindow.qml +++ b/testapp/qml/testapp/WebPageWindow.qml @@ -432,6 +432,46 @@ Item { anchors.top: groupsetgeometry.bottom title: "set/getZoomFactor(double)" } + + GroupBox { + id: grouppageicon + x: 536 + y: 543 + width: 164 + height: 150 + anchors.left: groupsetgeometry.right + anchors.leftMargin: 66 + anchors.top: groupsetvisible.bottom + anchors.topMargin: 10 + + Image { + id: pageiconimage + anchors.left: parent.left + anchors.leftMargin: 5 + anchors.right: parent.right + anchors.rightMargin: 5 + anchors.top: parent.top + anchors.topMargin: -1 + anchors.bottom: parent.bottom + anchors.bottomMargin: 32 + } + + Button { + id: pageiconbutton + text: "Fetch image" + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.top: pageiconimage.bottom + anchors.topMargin: 10 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + onClicked: { + pageiconimage.source = browserinterface.getPageIcon(browserinterface.getUrl()); +} + } + } } diff --git a/testapp/qml/testapp/main.qml b/testapp/qml/testapp/main.qml index 931981d..fe30f3e 100644 --- a/testapp/qml/testapp/main.qml +++ b/testapp/qml/testapp/main.qml @@ -6,7 +6,7 @@ ApplicationWindow { id: root title: "Genivi Browser PoC test application" width: 800 - height: 700 + height: 1000 color: "gray" BrowserInterface { |