vie_auto_test will now obey the Mac .mm rules for files including objective-c code.

Fixed the Windows build.

Fixed whitespace.

Split the platform-specific code for creating a window manager into separate source files since the mac one must be suffixed .mm and not .cc when we happen to use objective-c code. Tested on Linux.

BUG=
TEST=

Review URL: http://webrtc-codereview.appspot.com/214009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@771 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2011-10-19 10:59:39 +00:00
parent 4c636764b7
commit b5475d0076
8 changed files with 97 additions and 20 deletions

View File

@ -25,7 +25,6 @@
namespace {
class ViEStandardIntegrationTest: public ViEIntegrationTest {
public:
};
TEST_F(ViEStandardIntegrationTest, RunsBaseTestWithoutErrors) {

View File

@ -13,25 +13,16 @@
#include "vie_autotest_main.h"
#include "vie_codec.h"
#include "voe_codec.h"
#include "engine_configurations.h"
#include "vie_window_manager_factory.h"
#include "vie_autotest_window_manager_interface.h"
#if defined(WIN32)
#include "vie_autotest_windows.h"
#include <tchar.h>
#include <ShellAPI.h> //ShellExecute
#elif defined(WEBRTC_MAC_INTEL)
#if defined(COCOA_RENDERING)
#include "vie_autotest_mac_cocoa.h"
#elif defined(CARBON_RENDERING)
#include "vie_autotest_mac_carbon.h"
#endif
#elif defined(WEBRTC_LINUX)
#include "vie_autotest_linux.h"
#endif
ViEWindowCreator::ViEWindowCreator() {
// Create platform dependent render windows.
window_manager_ = new ViEAutoTestWindowManager();
window_manager_ =
ViEWindowManagerFactory::CreateWindowManagerForCurrentPlatform();
}
ViEWindowCreator::~ViEWindowCreator() {
@ -40,7 +31,7 @@ ViEWindowCreator::~ViEWindowCreator() {
ViEAutoTestWindowManagerInterface*
ViEWindowCreator::CreateTwoWindows() {
#if (defined(_WIN32))
#if defined(WIN32)
TCHAR window1Title[1024] = _T("ViE Autotest Window 1");
TCHAR window2Title[1024] = _T("ViE Autotest Window 2");
#else

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_WINDOW_MANAGER_FACTORY_H_
#define SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_WINDOW_MANAGER_FACTORY_H_
class ViEAutoTestWindowManagerInterface;
class ViEWindowManagerFactory {
public:
// This method is implemented in different files depending on platform.
// The caller is responsible for freeing the resulting object using
// the delete operator.
static ViEAutoTestWindowManagerInterface*
CreateWindowManagerForCurrentPlatform();
};
#endif // SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_WINDOW_MANAGER_FACTORY_H_

View File

@ -8,11 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* vie_autotest_main.cc
*
*/
#include "vie_autotest_main.h"
#include "vie_autotest_window_manager_interface.h"

View File

@ -0,0 +1,18 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vie_window_manager_factory.h"
#include "vie_autotest_linux.h"
ViEAutoTestWindowManagerInterface*
ViEWindowManagerFactory::CreateWindowManagerForCurrentPlatform() {
return new ViEAutoTestWindowManager();
}

View File

@ -0,0 +1,23 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vie_window_manager_factory.h"
#include "engine_configurations.h"
#if defined(COCOA_RENDERING)
#include "vie_autotest_mac_cocoa.h"
#elif defined(CARBON_RENDERING)
#include "vie_autotest_mac_carbon.h"
#endif
ViEAutoTestWindowManagerInterface*
ViEWindowManagerFactory::CreateWindowManagerForCurrentPlatform() {
return new ViEAutoTestWindowManager();
}

View File

@ -0,0 +1,17 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vie_window_manager_factory.h"
#include "vie_autotest_windows.h"
ViEAutoTestWindowManagerInterface*
ViEWindowManagerFactory::CreateWindowManagerForCurrentPlatform() {
return new ViEAutoTestWindowManager();
}

View File

@ -75,11 +75,14 @@
# Platform dependent
# Linux
'source/vie_autotest_linux.cc',
'source/vie_window_manager_factory_linux.cc',
# Mac
'source/vie_autotest_mac_cocoa.mm',
'source/vie_autotest_mac_carbon.cc',
'source/vie_window_manager_factory_mac.mm',
# Windows
'source/vie_autotest_windows.cc',
'source/vie_window_manager_factory_win.cc',
],
'copies': [{
'destination': '/tmp',
@ -99,6 +102,7 @@
'sources!': [
'source/vie_autotest_mac_cocoa.cc',
'source/vie_autotest_mac_carbon.cc',
'source/vie_window_manager_factory_mac.mm',
],
}],
['OS!="win"', {
@ -106,6 +110,11 @@
'source/vie_autotest_windows.cc',
],
}],
['OS!="linux"', {
'sources!': [
'source/vie_window_manager_factory_linux.cc',
],
}],
# TODO(andrew): this likely isn't an actual dependency. It should be
# included in webrtc.gyp or video_engine.gyp instead.