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 deleted file mode 100644 index b9d2fb09a..000000000 --- a/src/video_engine/main/test/AutoTest/automated/vie_standard_integration_test.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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. - */ - -/* - * This file contains the "standard" suite of integration tests, implemented - * as a GUnit test. This file is a part of the effort to try to automate all - * tests in this section of the code. Currently, this code makes no attempt - * to verify any video output - it only checks for direct errors. - */ - -#include "gtest/gtest.h" -#include "vie_autotest.h" -#include "vie_autotest_window_manager_interface.h" -#include "vie_window_creator.h" - -namespace { - -class ViEStandardIntegrationTest: public testing::Test { - public: - static void SetUpTestCase() { - window_creator_ = new ViEWindowCreator(); - - ViEAutoTestWindowManagerInterface* window_manager = - window_creator_->CreateTwoWindows(); - - // Create the test cases - tests_ = new ViEAutoTest(window_manager->GetWindow1(), - window_manager->GetWindow2()); - } - - static void TearDownTestCase() { - window_creator_->TerminateWindows(); - - delete tests_; - delete window_creator_; - } - - protected: - static ViEWindowCreator* window_creator_; - static ViEAutoTest* tests_; -}; - -TEST_F(ViEStandardIntegrationTest, RunsBaseStandardTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViEBaseStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsCaptureTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViECaptureStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsCodecTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViECodecStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsEncryptionTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViEEncryptionStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsFileTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViEFileStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsImageProcessTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViEImageProcessStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsNetworkTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViENetworkStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsRenderTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViERenderStandardTest()); -} - -TEST_F(ViEStandardIntegrationTest, RunsRtpRctpTestWithoutErrors) { - ASSERT_EQ(0, tests_->ViERtpRtcpStandardTest()); -} - -ViEAutoTest* ViEStandardIntegrationTest::tests_ = NULL; -ViEWindowCreator* ViEStandardIntegrationTest::window_creator_ = NULL; - -} 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 deleted file mode 100644 index 75e61069c..000000000 --- a/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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_creator.h" - -#include "engine_configurations.h" -#include "vie_autotest_main.h" -#include "vie_codec.h" -#include "voe_codec.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(); -} - -ViEWindowCreator::~ViEWindowCreator() { - delete window_manager_; -} - -ViEAutoTestWindowManagerInterface* - ViEWindowCreator::CreateTwoWindows() { -#if (defined(_WIN32)) - TCHAR window1Title[1024] = _T("ViE Autotest Window 1"); - TCHAR window2Title[1024] = _T("ViE Autotest Window 2"); -#else - char window1Title[1024] = "ViE Autotest Window 1"; - char window2Title[1024] = "ViE Autotest Window 2"; -#endif - - AutoTestRect window1Size(352, 288, 600, 100); - AutoTestRect window2Size(352, 288, 1000, 100); - window_manager_->CreateWindows(window1Size, window2Size, window1Title, - window2Title); - window_manager_->SetTopmostWindow(); - - return window_manager_; -} - -void ViEWindowCreator::TerminateWindows() { - window_manager_->TerminateWindows(); -} - diff --git a/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.h b/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.h deleted file mode 100644 index 25c23a3f3..000000000 --- a/src/video_engine/main/test/AutoTest/helpers/vie_window_creator.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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_HELPERS_VIE_WINDOW_CREATOR_H_ -#define SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_HELPERS_VIE_WINDOW_CREATOR_H_ - -class ViEAutoTestWindowManagerInterface; - -class ViEWindowCreator { - public: - ViEWindowCreator(); - virtual ~ViEWindowCreator(); - - // The pointer returned here will still be owned by this object. - // Only use it to retrieve the created windows. - ViEAutoTestWindowManagerInterface* CreateTwoWindows(); - - // Terminates windows opened by CreateTwoWindows, which must - // have been called before this method. - void TerminateWindows(); - private: - ViEAutoTestWindowManagerInterface* window_manager_; -}; - -#endif // SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_HELPERS_VIE_WINDOW_CREATOR_H_ diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_linux.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_linux.cc index ec6f9c642..a17d39971 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_linux.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_linux.cc @@ -12,9 +12,6 @@ // vie_autotest_linux.cc // -#include "gtest/gtest.h" -#include - #include "vie_autotest_linux.h" #include "vie_autotest_defines.h" @@ -147,18 +144,10 @@ bool ViEAutoTestWindowManager::SetTopmostWindow() return 0; } -int main(int argc, char** argv) +int main() { - // This command-line flag is a transitory solution until we - // managed to rewrite all tests to GUnit tests. This flag is - // currently only supported in Linux. - if (argc == 2 && std::string(argv[1]) == "--automated") { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); - } - - // Default: run in classic interactive mode. ViEAutoTestMain autoTest; autoTest.UseAnswerFile("answers.txt"); return autoTest.BeginOSIndependentTesting(); + } 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 fdaef8f3b..47360d545 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 @@ -13,11 +13,25 @@ * */ -#include "vie_window_creator.h" -#include "vie_autotest_window_manager_interface.h" - #include "vie_autotest.h" +#include "vie_autotest_defines.h" #include "vie_autotest_main.h" +#include "vie_codec.h" +#include "voe_codec.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 ViEAutoTestMain::ViEAutoTestMain() : _answers(), @@ -28,10 +42,23 @@ ViEAutoTestMain::ViEAutoTestMain() : bool ViEAutoTestMain::BeginOSIndependentTesting() { - // Create the windows - ViEWindowCreator windowCreator; + // Create platform dependent render windows ViEAutoTestWindowManagerInterface* windowManager = - windowCreator.CreateTwoWindows(); + new ViEAutoTestWindowManager(); + +#if (defined(_WIN32)) + TCHAR window1Title[1024] = _T("ViE Autotest Window 1"); + TCHAR window2Title[1024] = _T("ViE Autotest Window 2"); +#else + char window1Title[1024] = "ViE Autotest Window 1"; + char window2Title[1024] = "ViE Autotest Window 2"; +#endif + + AutoTestRect window1Size(352, 288, 600, 100); + AutoTestRect window2Size(352, 288, 1000, 100); + windowManager->CreateWindows(window1Size, window2Size, window1Title, + window2Title); + windowManager->SetTopmostWindow(); // Create the test cases ViEAutoTest vieAutoTest(windowManager->GetWindow1(), @@ -262,7 +289,7 @@ bool ViEAutoTestMain::BeginOSIndependentTesting() } } while (testType != 0); - windowCreator.TerminateWindows(); + windowManager->TerminateWindows(); if (testErrors) { @@ -279,6 +306,8 @@ bool ViEAutoTestMain::BeginOSIndependentTesting() while ((c = getchar()) != '\n' && c != EOF) /* discard */; + delete windowManager; + return true; } diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_windows.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_windows.cc index 4bf14cdb3..1d264d11f 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_windows.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_windows.cc @@ -230,12 +230,15 @@ int ViEAutoTestWindowManager::ViEDestroyWindow(HWND& hwnd) bool ViEAutoTestWindowManager::SetTopmostWindow() { - // Meant to put terminal window on top + + // meant to put terminal window on top + return true; } int main(int argc, char* argv[]) { + ViEAutoTestMain autoTest; if (argc > 1) { 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 e30157d32..8fef32640 100644 --- a/src/video_engine/main/test/AutoTest/vie_auto_test.gypi +++ b/src/video_engine/main/test/AutoTest/vie_auto_test.gypi @@ -41,12 +41,10 @@ '<(webrtc_root)/modules/modules.gyp:video_render_module', '<(webrtc_root)/modules/modules.gyp:video_capture_module', '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine_core', - '<(webrtc_root)/../testing/gtest.gyp:gtest', 'video_engine_core', ], 'include_dirs': [ 'interface/', - 'helpers/', '../../interface', '../../source', '../../../../modules/video_capture/main/source/', @@ -68,12 +66,6 @@ 'interface/vie_autotest_window_manager_interface.h', 'interface/vie_autotest_windows.h', - # Helper classes - 'helpers/vie_window_creator.cc', - - # New, fully automated tests - 'automated/vie_standard_integration_test.cc', - # Platform independent 'source/tb_capture_device.cc', 'source/tb_external_transport.cc',