Skip to content

Commit 71cf3c2

Browse files
Andrii MorozAndrii Moroz
authored andcommitted
2 parents 6a4e3fe + 44d0f9f commit 71cf3c2

File tree

116 files changed

+11735
-14265
lines changed

Some content is hidden

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

116 files changed

+11735
-14265
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ report/*
1515
/bin/
1616
/lib/
1717
/out/
18-
/wd.gypi
1918
/wd.Makefile
2019
/Makefile
2120
/WebDriver.target.mk
2221
/WebDriverTest.target.mk
23-
*.log
22+
*.log
23+
WD.*
24+
desktop/
25+
flip/
26+
src/wdversion.cc

build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gyp --depth . -G output_dir=. -D platform=desktop -D mode=release --generator-output=out/ wd.gyp

build.sh

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
#!/usr/bin/env bash
2-
platform=$1
3-
mode=$2
2+
output_gen=$1
3+
platform=$2
4+
mode=$3
5+
qt_dir=$4
6+
7+
current_dir=`pwd`
8+
if [ -z $output_gen ];
9+
then
10+
output_gen=`pwd`
11+
platform="desktop"
12+
fi
13+
14+
output_gen=`readlink -f ${output_gen}`
15+
base_output_gen=`dirname ${output_gen}`
416

517
if [ -z $platform ];
618
then
@@ -10,27 +22,41 @@ else
1022
fi
1123
if [ -z $mode ];
1224
then
13-
modes="debug release"
25+
modes="release_dbg release"
1426
else
1527
modes=$mode
1628
fi
1729

30+
#generate wdversion.cc
31+
last_changes=`git describe --abbrev=10 --dirty --always`
32+
version_file=src/wdversion.cc
33+
34+
printf 'namespace webdriver {
35+
extern const char kProductName[] = "WebDriver-cisco-cmt";
36+
extern const char kVersionNumber[] = "0.2.0";
37+
extern const char kBuildTime[] = __TIME__;
38+
extern const char kBuildDate[] = __DATE__;
39+
extern const char kLastChanges[] = "%s";
40+
}' $last_changes > $version_file
41+
1842
for platform in $platforms
1943
do
2044
for mode in $modes
2145
do
22-
gyp --depth . -G output_dir=. -D platform=$platform -D mode=$mode --generator-output=out/$platform/$mode wd.gyp
46+
cd $current_dir
47+
gyp --depth . -G output_dir=. -D platform=$platform -D mode=$mode -D ROOT_PATH=${base_output_gen} -D QT_DIR=${qt_dir} --generator-output=${output_gen}/$platform/$mode wd.gyp
2348
[ $? -ne 0 ] && exit 1
24-
cd out/$platform/$mode
49+
cd ${output_gen}/$platform/$mode
50+
[ $? -ne 0 ] && echo "**** ERROR: Can't access to ${output_gen}/$platform/$mode" && exit 1
2551
make
2652
[ $? -ne 0 ] && exit 1
27-
cd ../../..
28-
mkdir -p bin/$platform/$mode/
29-
cp -f out/$platform/$mode/Default/libWebDriver.a bin/$platform/$mode/
30-
cp -f out/$platform/$mode/Default/lib.target/libWebDriver.so bin/$platform/$mode/ 2>/dev/null
31-
if [ -f out/$platform/$mode/Default/WebDriver ]
53+
mkdir -p ${output_gen}/bin/$platform/$mode/
54+
[ $? -ne 0 ] && echo "**** ERROR: Can't create ${output_gen}/bin/$platform/$mode" && exit 1
55+
cp -f ${output_gen}/$platform/$mode/Default/libWebDriver.a ${output_gen}/bin/$platform/$mode/ 2>/dev/null
56+
cp -f ${output_gen}/$platform/$mode/Default/lib.target/libWebDriver.so ${output_gen}/bin/$platform/$mode/ 2>/dev/null
57+
if [ -f ${output_gen}/$platform/$mode/Default/WebDriver ]
3258
then
33-
cp -f out/$platform/$mode/Default/WebDriver bin/$platform/$mode/
59+
cp -f ${output_gen}/$platform/$mode/Default/WebDriver ${output_gen}/bin/$platform/$mode/ 2>/dev/null
3460
fi
3561
done
3662
done
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define WEBDRIVER_H
33
/**
44
* @mainpage This is autogenerated documentation for QtWebKitWebDriver. <br>
5-
* Public API for WD is in file inc/QtWebkitWebDriver.h
5+
* Public API for WD is in file inc/WebDriver.h
66
*/
77
/** @file
8-
* public API of QtWebkitWD
8+
* public API of WebDriver
99
*/
1010

1111
#include <viewfactory.h>

inc/viewfactory.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
#include <QtCore/QGlobalStatic>
77
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
8-
#include <QtWidgets/QWidget>
8+
#include <QtWebKitWidgets/QWebView>
99
#else
10-
#include <QtGui/QWidget>
10+
#include <QtWebKit/QWebView>
1111
#endif
1212

1313
class AbstractViewCreator
1414
{
1515
public:
16-
virtual QWidget * create() const = 0;
16+
virtual QWebView * create() const = 0;
1717
};
1818

1919
template <class C>
2020
class ViewCreator: public AbstractViewCreator
2121
{
2222
public:
23-
virtual QWidget* create() const { return new C(); }
23+
virtual QWebView * create() const { return new C(); }
2424
};
2525

2626
class ViewFactory
@@ -37,7 +37,7 @@ class ViewFactory
3737
factory[id] = new ViewCreator<C>();
3838
}
3939

40-
QWidget* create(const std::string &id);
40+
QWebView * create(const std::string &id);
4141

4242

4343
protected:

src/ServerThread.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "ServerThread.h"
2+
#include "WebDriver.h"
3+
4+
void ServerThread::run()
5+
{
6+
main_server(argc, argv);
7+
}

src/ServerThread.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#ifndef SERVERTHREAD_H
2+
#define SERVERTHREAD_H
3+
4+
#include <QtCore/QThread>
5+
6+
class ServerThread : public QThread
7+
{
8+
Q_OBJECT
9+
10+
public:
11+
int argc;
12+
char** argv;
13+
14+
protected:
15+
void run();
16+
};
17+
18+
#endif // SERVERTHREAD_H

src/Test/ClickTest.cc

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/Test/ClickTest.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/Test/WindowTest.cc

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)