Skip to content

Commit ecb2641

Browse files
committed
Introducing Arora
0 parents  commit ecb2641

File tree

114 files changed

+75056
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+75056
-0
lines changed

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
arora
2+
Arora.app
3+
Makefile
4+
.DS_Store
5+
.ui
6+
.moc
7+
.obj
8+
.rcc
9+
10+
autotests/addbookmarkdialog/addbookmarkdialog
11+
autotests/autosaver/autosaver
12+
autotests/downloadmanager/downloadmanager
13+
autotests/history/history
14+
autotests/historyfiltermodel/historyfiltermodel
15+
autotests/searchlineedit/searchlineedit
16+
autotests/tabwidget/tabwidget
17+
autotests/webactionmapper/webactionmapper
18+
autotests/xbel/xbel
19+
20+
manualtests/bookmarks/bookmarks
21+
manualtests/downloadmanager/downloadmanager
22+
manualtests/history/history
23+
manualtests/searchlineedit/searchlineedit
24+
manualtests/urllineedit/urllineedit
25+

GPLHEADER

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2008 Name <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301 USA
18+
*/

LICENSE.GPL2

+351
Large diffs are not rendered by default.

LICENSE.GPL3

+688
Large diffs are not rendered by default.

README

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Arora web browser
2+
3+
http://arora.googlecode.com/
4+
5+
Arora is a cross platform web browser built using Qt and WebKit.
6+
7+
Arora is a fork of the Demo Browser that was shipped with Qt 4.4.0. All new development is no longer going into the demo browser, but here. Some have critizized the demo browser for being to large already and should have been kicked out earlier.

arora.pro

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
QMAKEVERSION = $$[QMAKE_VERSION]
2+
ISQT4 = $$find(QMAKEVERSION, ^[2-9])
3+
isEmpty( ISQT4 ) {
4+
error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
5+
}
6+
7+
TEMPLATE = subdirs
8+
SUBDIRS = src/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TEMPLATE = app
2+
TARGET =
3+
DEPENDPATH += .
4+
INCLUDEPATH += .
5+
6+
include(../autotests.pri)
7+
8+
# Input
9+
SOURCES += tst_addbookmarkdialog.cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/*
2+
* Copyright 2008 Benjamin C. Meyer <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301 USA
18+
*/
19+
20+
#include <QtTest/QtTest>
21+
22+
#include <bookmarks.h>
23+
#include <xbel.h>
24+
#include <browserapplication.h>
25+
26+
class tst_AddBookmarkDialog : public QObject
27+
{
28+
Q_OBJECT
29+
30+
public slots:
31+
void initTestCase();
32+
void cleanupTestCase();
33+
void init();
34+
void cleanup();
35+
36+
private slots:
37+
void addbookmarkdialog_data();
38+
void addbookmarkdialog();
39+
};
40+
41+
// Subclass that exposes the protected functions.
42+
class SubAddBookmarkDialog : public AddBookmarkDialog
43+
{
44+
45+
public:
46+
SubAddBookmarkDialog(const QString &url, const QString &title, QWidget *parent, BookmarksManager *manager)
47+
: AddBookmarkDialog(url, title, parent, manager){}
48+
49+
};
50+
51+
// This will be called before the first test function is executed.
52+
// It is only called once.
53+
void tst_AddBookmarkDialog::initTestCase()
54+
{
55+
QCoreApplication::setApplicationName("addbookmarkdialogtest");
56+
}
57+
58+
// This will be called after the last test function is executed.
59+
// It is only called once.
60+
void tst_AddBookmarkDialog::cleanupTestCase()
61+
{
62+
}
63+
64+
// This will be called before each test function is executed.
65+
void tst_AddBookmarkDialog::init()
66+
{
67+
BookmarksManager *manager = BrowserApplication::bookmarksManager();
68+
BookmarkNode *root = manager->bookmarks();
69+
QList<BookmarkNode*> nodes = root->children();
70+
BookmarkNode *menu = nodes[0];
71+
BookmarkNode *toolbar = nodes[1];
72+
while (!menu->children().isEmpty())
73+
manager->removeBookmark(menu->children().first());
74+
while (!toolbar->children().isEmpty())
75+
manager->removeBookmark(toolbar->children().first());
76+
}
77+
78+
// This will be called after every test function.
79+
void tst_AddBookmarkDialog::cleanup()
80+
{
81+
}
82+
83+
Q_DECLARE_METATYPE(QDialogButtonBox::StandardButton)
84+
void tst_AddBookmarkDialog::addbookmarkdialog_data()
85+
{
86+
QTest::addColumn<QString>("url");
87+
QTest::addColumn<QString>("title");
88+
QTest::addColumn<QDialogButtonBox::StandardButton>("button");
89+
QTest::addColumn<int>("menuCount");
90+
QTest::addColumn<int>("toolbarCount");
91+
QTest::addColumn<int>("select");
92+
93+
// select invalid, menu, toolbar, submenu
94+
QTest::newRow("cancel") << "url" << "title" << QDialogButtonBox::Cancel << 0 << 0 << -1;
95+
QTest::newRow("ok default") << "url" << "title" << QDialogButtonBox::Ok << 1 << 0 << -1;
96+
QTest::newRow("ok toolbar") << "url" << "title" << QDialogButtonBox::Ok << 0 << 1 << 0;
97+
QTest::newRow("ok menu") << "url" << "title" << QDialogButtonBox::Ok << 1 << 0 << 1;
98+
}
99+
100+
void tst_AddBookmarkDialog::addbookmarkdialog()
101+
{
102+
QFETCH(QString, url);
103+
QFETCH(QString, title);
104+
QFETCH(QDialogButtonBox::StandardButton, button);
105+
QFETCH(int, menuCount);
106+
QFETCH(int, toolbarCount);
107+
QFETCH(int, select);
108+
109+
BookmarksManager *manager = BrowserApplication::bookmarksManager();
110+
qRegisterMetaType<BookmarkNode *>("BookmarkNode *");
111+
QSignalSpy spy(manager, SIGNAL(entryAdded(BookmarkNode *)));
112+
BookmarkNode *menu = manager->menu();
113+
BookmarkNode *toolbar = manager->toolbar();
114+
QCOMPARE(menu->children().count(), 0);
115+
QCOMPARE(toolbar->children().count(), 0);
116+
117+
SubAddBookmarkDialog dialog(url, title, 0, manager);
118+
QComboBox *combobox = dialog.findChild<QComboBox*>();
119+
QVERIFY(combobox);
120+
if (select != -1) {
121+
combobox->setCurrentIndex(select);
122+
combobox->view()->setCurrentIndex(combobox->model()->index(select, 0));
123+
}
124+
QDialogButtonBox *buttonBox = dialog.findChild<QDialogButtonBox*>();
125+
QVERIFY(buttonBox);
126+
QPushButton *pushButton = buttonBox->button(button);
127+
pushButton->click();
128+
129+
QCOMPARE(spy.count(), menuCount + toolbarCount);
130+
131+
QCOMPARE(menu->children().count(), menuCount);
132+
QCOMPARE(toolbar->children().count(), toolbarCount);
133+
BookmarkNode *node = 0;
134+
if (menuCount == 1) node = menu->children()[0];
135+
if (toolbarCount == 1) node = toolbar->children()[0];
136+
if (node) {
137+
QCOMPARE(node->title, title);
138+
QCOMPARE(node->url, url);
139+
}
140+
}
141+
142+
QTEST_MAIN(tst_AddBookmarkDialog)
143+
#include "tst_addbookmarkdialog.moc"
144+

autotests/autosaver/autosaver.pro

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TEMPLATE = app
2+
TARGET =
3+
DEPENDPATH += .
4+
INCLUDEPATH += .
5+
6+
include(../autotests.pri)
7+
8+
# Input
9+
SOURCES = tst_autosaver.cpp autosaver.cpp
10+
HEADERS = autosaver.h

autotests/autosaver/tst_autosaver.cpp

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/*
2+
* Copyright 2008 Benjamin C. Meyer <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301 USA
18+
*/
19+
20+
#include <QtTest/QtTest>
21+
#include <autosaver.h>
22+
23+
class tst_AutoSaver : public QObject
24+
{
25+
Q_OBJECT
26+
27+
public slots:
28+
void initTestCase();
29+
void cleanupTestCase();
30+
void init();
31+
void cleanup();
32+
33+
private slots:
34+
void AutoSaver_data();
35+
void AutoSaver();
36+
void changeOccurred_data();
37+
void changeOccurred();
38+
39+
void deleted();
40+
};
41+
42+
// Subclass that exposes the protected functions.
43+
class SubAutoSaver : public AutoSaver
44+
{
45+
public:
46+
SubAutoSaver(QObject *parent = 0) : AutoSaver(parent){}
47+
void call_timerEvent(QTimerEvent* event)
48+
{ return SubAutoSaver::timerEvent(event); }
49+
};
50+
51+
class TestClass : public QObject
52+
{
53+
Q_OBJECT
54+
55+
signals:
56+
void saveCalled();
57+
58+
public:
59+
TestClass(QObject *parent = 0) : QObject(parent), AutoSaver(new SubAutoSaver(this))
60+
{
61+
}
62+
63+
~TestClass()
64+
{
65+
AutoSaver->saveIfNeccessary();
66+
}
67+
68+
SubAutoSaver *AutoSaver;
69+
70+
public slots:
71+
void save() {
72+
emit saveCalled();
73+
}
74+
};
75+
76+
// This will be called before the first test function is executed.
77+
// It is only called once.
78+
void tst_AutoSaver::initTestCase()
79+
{
80+
}
81+
82+
// This will be called after the last test function is executed.
83+
// It is only called once.
84+
void tst_AutoSaver::cleanupTestCase()
85+
{
86+
}
87+
88+
// This will be called before each test function is executed.
89+
void tst_AutoSaver::init()
90+
{
91+
}
92+
93+
// This will be called after every test function.
94+
void tst_AutoSaver::cleanup()
95+
{
96+
}
97+
98+
void tst_AutoSaver::AutoSaver_data()
99+
{
100+
}
101+
102+
void tst_AutoSaver::AutoSaver()
103+
{
104+
SubAutoSaver save(this);
105+
save.changeOccurred();
106+
}
107+
108+
typedef QList<int> IntList;
109+
Q_DECLARE_METATYPE(IntList)
110+
void tst_AutoSaver::changeOccurred_data()
111+
{
112+
QTest::addColumn<IntList>("changed");
113+
QTest::addColumn<int>("saved");
114+
QTest::newRow("no changes") << (QList<int>()) << 0;
115+
QTest::newRow("1 changes") << (QList<int>() << 0) << 1;
116+
QTest::newRow("3 changes in a row") << (QList<int>() << 0 << 0 << 0) << 1;
117+
QTest::newRow("2 changes 4 secs, 1 change") << (QList<int>() << 0 << 0 << 4000) << 2;
118+
QTest::newRow("0, 1.5s, 2s, 12s(force save), 100m, 100m") << (QList<int>() << 0 << 1500 << 2000 << 12000 << 100 << 100) << 2;
119+
}
120+
121+
// public void changeOccurred()
122+
void tst_AutoSaver::changeOccurred()
123+
{
124+
QFETCH(IntList, changed);
125+
QFETCH(int, saved);
126+
127+
TestClass *test = new TestClass;
128+
QSignalSpy spy(test, SIGNAL(saveCalled()));
129+
for (int i = 0; i < changed.count(); ++i) {
130+
QTest::qWait(changed.at(i));
131+
test->AutoSaver->changeOccurred();
132+
}
133+
delete test;
134+
QCOMPARE(spy.count(), saved);
135+
}
136+
137+
void tst_AutoSaver::deleted()
138+
{
139+
TestClass *test = new TestClass;
140+
QSignalSpy spy(test, SIGNAL(saveCalled()));
141+
test->AutoSaver->changeOccurred();
142+
delete test;
143+
QCOMPARE(spy.count(), 1);
144+
}
145+
146+
QTEST_MAIN(tst_AutoSaver)
147+
#include "tst_autosaver.moc"
148+

autotests/autotests.pri

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
win32: CONFIG += console
2+
mac:CONFIG -= app_bundle
3+
4+
CONFIG += qtestlib
5+
6+
include($$PWD/../src/src.pri)
7+
include($$PWD/modeltest/modeltest.pri)
8+
9+
HEADERS += qtest_arora.h
10+
11+
INCLUDEPATH += $$PWD
12+
DEPENDPATH += $$PWD
13+
14+
RCC_DIR = $$PWD/.rcc
15+
UI_DIR = $$PWD/.ui
16+
MOC_DIR = $$PWD/.moc
17+
OBJECTS_DIR = $$PWD/.obj
18+
19+

0 commit comments

Comments
 (0)