Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitsubprojects
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: cmake -*-
git_subproject(ZeroEQ https://github.com/HBPVIS/ZeroEQ.git 3babd4f)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git 9fb82c4)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git a0ed204)
git_subproject(TUIO https://github.com/BlueBrain/TUIO.git fdf5cf7)
git_subproject(VirtualKeyboard https://github.com/rdumusc/QtFreeVirtualKeyboard.git 007bbfa)
git_subproject(VirtualKeyboard https://github.com/rdumusc/QtFreeVirtualKeyboard.git 5955d5e)
18 changes: 14 additions & 4 deletions apps/LocalStreamer/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ bool Application::initialize( const CommandLineOptions& options )
_pixelStreamer = PixelStreamerFactory::create( options );
if( !_pixelStreamer)
return false;
connect( _pixelStreamer, SIGNAL( imageUpdated( QImage )),
this, SLOT( sendImage( QImage )));
connect( _pixelStreamer, &PixelStreamer::imageUpdated,
this, &Application::sendImage );
connect( _pixelStreamer, &PixelStreamer::stateChanged,
this, &Application::sendData );

// Connect to Tide
_deflectStream = new deflect::Stream( options.getStreamname().toStdString(),
Expand Down Expand Up @@ -107,13 +109,15 @@ bool Application::initialize( const CommandLineOptions& options )
void Application::sendImage(QImage image)
{
#ifdef COMPRESS_IMAGES
// QImage Format_RGB32 (0xffRRGGBB) corresponds in fact to GL_BGRA == deflect::BGRA
// QImage Format_RGB32 (0xffRRGGBB) corresponds in fact to
// GL_BGRA == deflect::BGRA
deflect::ImageWrapper deflectImage( (const void*)image.bits(),
image.width(), image.height(),
deflect::BGRA );
deflectImage.compressionPolicy = deflect::COMPRESSION_ON;
#else
// This conversion is suboptimal, but the only solution until we send the PixelFormat with the PixelStreamSegment
// This conversion is suboptimal, but the only solution until we send the
// PixelFormat with the PixelStreamSegment
image = image.rgbSwapped();
deflect::ImageWrapper deflectImage( (const void*)image.bits(),
image.width(), image.height(),
Expand All @@ -129,6 +133,12 @@ void Application::sendImage(QImage image)
}
}

void Application::sendData( const QByteArray data )
{
if( !_deflectStream->sendData( data.constData(), data.size( )))
QApplication::quit();
}

void Application::processPendingEvents()
{
while( _deflectStream->hasEvent( ))
Expand Down
1 change: 1 addition & 0 deletions apps/LocalStreamer/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Application : public QApplication

private slots:
void sendImage( QImage image );
void sendData( QByteArray data );
void processPendingEvents();

private:
Expand Down
5 changes: 5 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Changelog {#Changelog}

# Release 1.2 (git master)

* [75](https://github.com/BlueBrain/Tide/pull/75):
Webbrowser improvements:
- New address bar to see the current url and enter an address [DISCL-380].
- The previous/next buttons are only visible if the browsing history has
corresponding entries.
* [74](https://github.com/BlueBrain/Tide/pull/74):
Added support for multi-finger pan gestures [DISCL-357].
Two-finger pan and pinch gestures can also be used simultaneously for zooming
Expand Down
8 changes: 6 additions & 2 deletions tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ set(TEST_LIBRARIES
Qt5::OpenGL
)

if(NOT TIDE_ENABLE_REST_INTERFACE)
if(TIDE_ENABLE_REST_INTERFACE AND TARGET ZeroEQ)
list(APPEND TEST_LIBRARIES ZeroEQ)
else()
set(EXCLUDE_FROM_TESTS
core/JsonOptionsTests.cpp
core/LoggingUtilityTest.cpp
core/RESTCommandTests.cpp
core/RestCommandTests.cpp
core/RestServerTests.cpp
)
endif()

Expand All @@ -29,6 +32,7 @@ if(X11_FOUND AND TARGET Qt5::WebKitWidgets)
else()
list(APPEND EXCLUDE_FROM_TESTS
core/WebbrowserTests.cpp
core/WebbrowserContentTests.cpp
core/WebkitHtmlSelectReplacementTests.cpp)
endif()

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/CommandLineOptionsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#define BOOST_TEST_MODULE CommandLineOptions
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "localstreamer/CommandLineOptions.h"

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/ConfigurationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#define BOOST_TEST_MODULE Configuration
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "MinimalGlobalQtApp.h"

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/ContentInteractionDelegateTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#define BOOST_TEST_MODULE ContentInteractionDelegateTests
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "ContentWindow.h"
#include "ContentInteractionDelegate.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/ContentWindowControllerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#define BOOST_TEST_MODULE ContentWindowControllerTests
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include <boost/make_shared.hpp>

Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/ContentWindowTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#define BOOST_TEST_MODULE ContentWindowTests
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "ContentWindow.h"
#include "ZoomInteractionDelegate.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/DisplayGroupTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#define BOOST_TEST_MODULE DisplayGroupTests

#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "ContentWindow.h"
#include "DisplayGroup.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/JsonOptionsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#define BOOST_TEST_MODULE JsonOptionsTests

#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "Options.h"
#include "rest/JsonOptions.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/LocalPixelStreamerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#define BOOST_TEST_MODULE PixelStreamer
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "localstreamer/CommandLineOptions.h"
#include "localstreamer/PixelStreamerType.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/LoggingUtilityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

#include <boost/make_shared.hpp>
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "DisplayGroup.h"
#include "DummyContent.h"
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/core/PixelStreamWindowManagerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#define BOOST_TEST_MODULE PixelStreamWindowManagerTests
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include <deflect/Frame.h>
#include <deflect/EventReceiver.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#define BOOST_TEST_MODULE RESTCommand
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "rest/RestCommand.h"
#include "rest/StaticContent.h"
Expand Down
96 changes: 96 additions & 0 deletions tests/cpp/core/RestServerTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*********************************************************************/
/* Copyright (c) 2016, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of Ecole polytechnique federale de Lausanne. */
/*********************************************************************/

#define BOOST_TEST_MODULE RestServerTests
#include <boost/test/unit_test.hpp>

#include "rest/RestServer.h"
#include "rest/StaticContent.h"

#include <zeroeq/uri.h>

#include <QNetworkAccessManager>
#include <QNetworkReply>

#include "MinimalGlobalQtApp.h"
BOOST_GLOBAL_FIXTURE( MinimalGlobalQtApp );


BOOST_AUTO_TEST_CASE( testDefaultPort )
{
RestServer server;
BOOST_CHECK_GT( server.getPort(), 0 );
}

BOOST_AUTO_TEST_CASE( testUnavailablePort )
{
// system port (<1024)
BOOST_CHECK_THROW( RestServer server{ 80 }, std::runtime_error );
}

QString sendHttpRequest( const QUrl& url )
{
// create custom temporary event loop on stack
QEventLoop eventLoop;
// quit the event-loop when the network request finished
QNetworkAccessManager manager;
QObject::connect( &manager, &QNetworkAccessManager::finished,
&eventLoop, &QEventLoop::quit );

std::unique_ptr<QNetworkReply> reply( manager.get( QNetworkRequest{ url }));
eventLoop.exec(); // blocks stack until "finished()" has been called

return (reply->error() == QNetworkReply::NoError) ? reply->readAll() :
reply->errorString();
}

BOOST_AUTO_TEST_CASE( testServerReturnsSimpleContent )
{
RestServer server;
BOOST_REQUIRE_GT( server.getPort(), 0 );

StaticContent testPage{ "test", "Hello World!" };
server.get().register_( testPage );

const auto url = QString( "http://localhost:%1/test" ).arg(
server.getPort( ));
const auto response = sendHttpRequest( url );

BOOST_CHECK_EQUAL( response.toStdString(), "Hello World!" );
}
1 change: 0 additions & 1 deletion tests/cpp/core/SerializeBufferTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#define BOOST_TEST_MODULE SerializeBufferTests
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "SerializeBuffer.h"

Expand Down
Loading