diff --git a/src/video_engine/main/test/AutoTest/automated/vie_standard_integration_test.cc b/src/video_engine/main/test/AutoTest/automated/vie_standard_integration_test.cc index dae66f20f7..0611e1ebf2 100644 --- a/src/video_engine/main/test/AutoTest/automated/vie_standard_integration_test.cc +++ b/src/video_engine/main/test/AutoTest/automated/vie_standard_integration_test.cc @@ -25,7 +25,6 @@ namespace { class ViEStandardIntegrationTest: public ViEIntegrationTest { - public: }; TEST_F(ViEStandardIntegrationTest, RunsBaseTestWithoutErrors) { diff --git a/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.cc b/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.cc index e121067d8b..40ec0bb0ed 100644 --- a/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.cc +++ b/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.cc @@ -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 -#include //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 diff --git a/src/video_engine/main/test/AutoTest/interface/vie_window_manager_factory.h b/src/video_engine/main/test/AutoTest/interface/vie_window_manager_factory.h new file mode 100644 index 0000000000..a85280dfe3 --- /dev/null +++ b/src/video_engine/main/test/AutoTest/interface/vie_window_manager_factory.h @@ -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_ diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_main.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_main.cc index ebe972690c..631f8297b1 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_main.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_main.cc @@ -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" diff --git a/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_linux.cc b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_linux.cc new file mode 100644 index 0000000000..1b1687830a --- /dev/null +++ b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_linux.cc @@ -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(); +} diff --git a/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_mac.mm b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_mac.mm new file mode 100644 index 0000000000..806d10f07b --- /dev/null +++ b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_mac.mm @@ -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(); +} diff --git a/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_win.cc b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_win.cc new file mode 100644 index 0000000000..11114fd108 --- /dev/null +++ b/src/video_engine/main/test/AutoTest/source/vie_window_manager_factory_win.cc @@ -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(); +} diff --git a/src/video_engine/main/test/AutoTest/vie_auto_test.gypi b/src/video_engine/main/test/AutoTest/vie_auto_test.gypi index 9723f74ad6..a7e5af754f 100644 --- a/src/video_engine/main/test/AutoTest/vie_auto_test.gypi +++ b/src/video_engine/main/test/AutoTest/vie_auto_test.gypi @@ -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.