Skip to content

Commit

Permalink
Refactored remoting targets to support app remoting and chromoting. B…
Browse files Browse the repository at this point in the history
…uilt a new driver to support chromoting.

BUG=

Review URL: https://codereview.chromium.org/1164143002

Cr-Commit-Position: refs/heads/master@{#333840}
  • Loading branch information
tonychun authored and Commit bot committed Jun 10, 2015
1 parent b90621c commit 61931fe
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 77 deletions.
4 changes: 2 additions & 2 deletions build/gn_migration.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@
'dependencies': [
# TODO(GYP): Figure out which of these run on android/mac/win/ios/etc.
'../net/net.gyp:net_docs',
'../remoting/app_remoting_test.gyp:ar_sample_test_driver',
'../remoting/remoting.gyp:ar_sample_test_driver',

# TODO(GYP): in progress - see tfarina.
'../third_party/webrtc/tools/tools.gyp:frame_analyzer',
Expand Down Expand Up @@ -640,7 +640,7 @@
'../gpu/gpu.gyp:angle_perftests',
'../net/net.gyp:net_docs',
'../ppapi/ppapi_internal.gyp:ppapi_perftests',
'../remoting/app_remoting_test.gyp:ar_sample_test_driver',
'../remoting/remoting.gyp:ar_sample_test_driver',
'../remoting/remoting.gyp:remoting_breakpad_tester',
'../remoting/remoting.gyp:remoting_console',
'../remoting/remoting.gyp:remoting_desktop',
Expand Down
72 changes: 0 additions & 72 deletions remoting/app_remoting_test.gyp

This file was deleted.

5 changes: 3 additions & 2 deletions remoting/remoting_all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
'target_name': 'remoting_all',
'type': 'none',
'dependencies': [
'../remoting/app_remoting_webapp.gyp:ar_sample_app',
'../remoting/remoting.gyp:ar_sample_test_driver',
'../remoting/remoting.gyp:chromoting_test_driver',
'../remoting/remoting.gyp:remoting_base',
'../remoting/remoting.gyp:remoting_breakpad',
'../remoting/remoting.gyp:remoting_browser_test_resources',
Expand All @@ -24,8 +27,6 @@
'../remoting/remoting.gyp:remoting_webapp',
'../remoting/remoting.gyp:remoting_webapp_html',
'../remoting/remoting.gyp:remoting_webapp_unittests',
'../remoting/app_remoting_test.gyp:ar_sample_test_driver',
'../remoting/app_remoting_webapp.gyp:ar_sample_app',
],

'conditions' : [
Expand Down
88 changes: 88 additions & 0 deletions remoting/remoting_test.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,94 @@
}],
],
},
{
'target_name': 'remoting_test_driver_common',
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:test_support_base',
'../google_apis/google_apis.gyp:google_apis',
'../net/net.gyp:net',
'../remoting/remoting.gyp:remoting_base',
'../remoting/remoting.gyp:remoting_client',
'../remoting/remoting.gyp:remoting_protocol',
'../testing/gtest.gyp:gtest',
],
'defines': [
'VERSION=<(version_full)',
],
'sources': [
'test/access_token_fetcher.cc',
'test/access_token_fetcher.h',
'test/refresh_token_store.cc',
'test/refresh_token_store.h',
'test/remote_connection_observer.h',
'test/test_chromoting_client.cc',
'test/test_chromoting_client.h',
'test/test_video_renderer.cc',
'test/test_video_renderer.h',
],
}, # end of target 'remoting_test_driver_common'
{
# A chromoting version of remoting_test_driver_common
'target_name': 'chromoting_test_driver',
'type': '<(gtest_target_type)',
'dependencies': [
'remoting_test_driver_common',
],
'defines': [
'VERSION=<(version_full)',
],
'sources': [
'test/chromoting_test_driver.cc',
],
'include_dirs': [
'../testing/gtest/include',
],
}, # end of target 'chromoting_test_driver'
{
'target_name': 'ar_test_driver_common',
'type': 'static_library',
'dependencies': [
'../remoting/proto/chromotocol.gyp:chromotocol_proto_lib',
'remoting_test_driver_common',
],
'defines': [
'VERSION=<(version_full)',
],
'sources': [
'test/app_remoting_connected_client_fixture.cc',
'test/app_remoting_connected_client_fixture.h',
'test/app_remoting_test_driver_environment.cc',
'test/app_remoting_test_driver_environment.h',
'test/remote_application_details.h',
'test/remote_host_info.cc',
'test/remote_host_info.h',
'test/remote_host_info_fetcher.cc',
'test/remote_host_info_fetcher.h',
],
'include_dirs': [
'../testing/gtest/include',
],
}, # end of target 'ar_test_driver_common'
{
# An external version of the test driver tool which includes minimal tests
'target_name': 'ar_sample_test_driver',
'type': '<(gtest_target_type)',
'dependencies': [
'ar_test_driver_common',
],
'defines': [
'VERSION=<(version_full)',
],
'sources': [
'test/app_remoting_test_driver.cc',
'test/app_remoting_test_driver_environment_app_details.cc',
],
'include_dirs': [
'../testing/gtest/include',
],
}, # end of target 'ar_sample_test_driver'

# Remoting unit tests
{
Expand Down
2 changes: 1 addition & 1 deletion remoting/test/app_remoting_connected_client_fixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void AppRemotingConnectedClientFixture::SetUp() {
StartConnection();

if (!connection_is_ready_for_tests_) {
FAIL() << "Remote host connection could not be established.";
ADD_FAILURE() << "Remote host connection could not be established.";
client_->EndConnection();
}
}
Expand Down
43 changes: 43 additions & 0 deletions remoting/test/chromoting_test_driver.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string>

#include "base/command_line.h"
#include "base/test/test_suite.h"
#include "base/test/test_switches.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace switches {
const char kSingleProcessTestsSwitchName[] = "single-process-tests";
const char kUserNameSwitchName[] = "username";
}

int main(int argc, char* argv[]) {
testing::InitGoogleTest(&argc, argv);
base::TestSuite test_suite(argc, argv);

base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
DCHECK(command_line);

// Do not retry if tests fails.
command_line->AppendSwitchASCII(switches::kTestLauncherRetryLimit, "0");

// Different tests may require access to the same host if run in parallel.
// To avoid shared resource contention, tests will be run one at a time.
command_line->AppendSwitch(switches::kSingleProcessTestsSwitchName);

std::string username =
command_line->GetSwitchValueASCII(switches::kUserNameSwitchName);

// Verify that the username is passed in as an argument.
if (username.empty()) {
LOG(ERROR) << "No username passed in, can't authenticate without that!";
return -1;
}
DVLOG(1) << "Running chromoting tests as: " << username;

return 0;
}

0 comments on commit 61931fe

Please sign in to comment.