summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonatan Pålsson <jonatan.palsson@pelagicore.com>2014-02-05 17:58:43 +0100
committerJonatan Pålsson <jonatan.palsson@pelagicore.com>2014-02-16 15:26:15 +0100
commite14bdeed5ff22042e57883399d5a936403d33c55 (patch)
treeaf93440d5b6769ec7de83a572f4f768e8e703cfe
parent95fa56690ff7e968ab1e487b406f047ab431514b (diff)
downloadbrowser-poc-e14bdeed5ff22042e57883399d5a936403d33c55.tar.gz
Added manual test for getPageIcon and modified client-side API a bit
-rw-r--r--browser/unit-tests/browserdbus/testbrowserdbus.cpp3
-rw-r--r--common/browserdbus.cpp4
-rw-r--r--common/browserdbus.h2
-rw-r--r--testapp/qml/testapp/WebPageWindow.qml40
-rw-r--r--testapp/qml/testapp/main.qml2
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 112ec13..51c93b6 100644
--- a/common/browserdbus.cpp
+++ b/common/browserdbus.cpp
@@ -603,8 +603,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);
@@ -615,4 +616,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 0ec4e00..09192d1 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 {