Commit f4e0bd2c authored by kelvinp@chromium.org's avatar kelvinp@chromium.org

Retire gtestjs unit tests

Now that the QUnit-based unit tests are running on the bots, we can retire gtestjs unit tests.

This CL
1. Modifies remoting_webapp_unittest to include all files that are formerly covered by all_js_load.gtestjs.
2. Removes all the gtestjs files under remoting.
3. Moves run_all_remoting_unittests.cc back into the remoting directory as we no longer depends on chrome_paths.h.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283941 0039d316-1c4b-4281-b951-d872f2087c98
parent e2be10e3
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
# Note that when you run your TestSuite, you'll need to call # Note that when you run your TestSuite, you'll need to call
# chrome::RegisterPathProvider(). These path providers are required by # chrome::RegisterPathProvider(). These path providers are required by
# src/chrome/test/base/v8_unit_test.cc to setup and run the tests. # src/chrome/test/base/v8_unit_test.cc to setup and run the tests.
#
# See src/chrome/test/base/run_all_remoting_unittests.cc for an example.
{ {
'dependencies': [ 'dependencies': [
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// A basic testrunner that supports JavaScript unittests.
// This lives in src/chrome/test/base so that it can include chrome_paths.h
// (required for JS unittests) without updating the DEPS file for each
// subproject.
#include "base/test/launcher/unit_test_launcher.h" #include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h" #include "base/test/test_suite.h"
#include "chrome/common/chrome_paths.h"
#include "media/base/media.h" #include "media/base/media.h"
#include "net/socket/ssl_server_socket.h" #include "net/socket/ssl_server_socket.h"
int main(int argc, char** argv) { int main(int argc, char** argv) {
base::TestSuite test_suite(argc, argv); base::TestSuite test_suite(argc, argv);
#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
// This is required for the JavaScript unittests.
chrome::RegisterPathProvider();
#endif // defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
// Enable support for SSL server sockets, which must be done while // Enable support for SSL server sockets, which must be done while
// single-threaded. // single-threaded.
net::EnableSSLServerSockets(); net::EnableSSLServerSockets();
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
'../testing/gmock/include', '../testing/gmock/include',
], ],
'sources': [ 'sources': [
'../chrome/test/base/run_all_remoting_unittests.cc',
'base/auth_token_util_unittest.cc', 'base/auth_token_util_unittest.cc',
'base/auto_thread_task_runner_unittest.cc', 'base/auto_thread_task_runner_unittest.cc',
'base/auto_thread_unittest.cc', 'base/auto_thread_unittest.cc',
...@@ -50,12 +49,13 @@ ...@@ -50,12 +49,13 @@
'base/rate_counter_unittest.cc', 'base/rate_counter_unittest.cc',
'base/resources_unittest.cc', 'base/resources_unittest.cc',
'base/rsa_key_pair_unittest.cc', 'base/rsa_key_pair_unittest.cc',
'base/run_all_unittests.cc',
'base/running_average_unittest.cc', 'base/running_average_unittest.cc',
'base/test_rsa_key_pair.h', 'base/test_rsa_key_pair.h',
'base/typed_buffer_unittest.cc', 'base/typed_buffer_unittest.cc',
'base/util_unittest.cc', 'base/util_unittest.cc',
'client/audio_player_unittest.cc', 'client/audio_player_unittest.cc',
'client/client_status_logger_unittest.cc', 'client/client_status_logger_unittest.cc',
'client/key_event_mapper_unittest.cc', 'client/key_event_mapper_unittest.cc',
'client/plugin/normalizing_input_filter_cros_unittest.cc', 'client/plugin/normalizing_input_filter_cros_unittest.cc',
'client/plugin/normalizing_input_filter_mac_unittest.cc', 'client/plugin/normalizing_input_filter_mac_unittest.cc',
...@@ -177,40 +177,6 @@ ...@@ -177,40 +177,6 @@
], ],
}, },
}], }],
[ 'OS=="mac" or (OS=="linux" and chromeos==0)', {
# Javascript unittests are disabled on CrOS because they cause
# valgrind and test errors.
#
# Javascript unittests are disabled on Windows because they add a
# dependency on 'common_constants' which (only on Windows) requires
# additional dependencies:
# '../content/content.gyp:content_common',
# 'installer_util',
# These targets are defined in .gypi files that would need to be
# included here:
# '../chrome/chrome_common.gypi',
# '../chrome/chrome_installer.gypi',
# '../chrome/chrome_installer_util.gypi',
# But we can't do that because ninja will complain about multiple
# target definitions.
# TODO(garykac): Move installer_util into a proper .gyp file so that
# it can be included in multiple .gyp files.
'includes': [
'../chrome/js_unittest_rules.gypi',
],
'dependencies': [
'../chrome/common_constants.gyp:common_constants',
'../v8/tools/gyp/v8.gyp:v8',
],
'sources': [
'../chrome/test/base/v8_unit_test.cc',
'../chrome/test/base/v8_unit_test.h',
'webapp/browser_globals.gtestjs',
'webapp/all_js_load.gtestjs',
'webapp/format_iq.gtestjs',
'<@(remoting_webapp_all_js_files)',
],
}],
[ 'OS=="android"', { [ 'OS=="android"', {
'dependencies!': [ 'dependencies!': [
'remoting_client_plugin', 'remoting_client_plugin',
...@@ -264,7 +230,7 @@ ...@@ -264,7 +230,7 @@
'../testing/gmock/include', '../testing/gmock/include',
], ],
'sources': [ 'sources': [
'../chrome/test/base/run_all_remoting_unittests.cc', 'base/run_all_unittests.cc',
'codec/codec_test.cc', 'codec/codec_test.cc',
'codec/codec_test.h', 'codec/codec_test.h',
'codec/video_encoder_vpx_perftest.cc', 'codec/video_encoder_vpx_perftest.cc',
...@@ -330,6 +296,10 @@ ...@@ -330,6 +296,10 @@
'type': 'none', 'type': 'none',
'variables': { 'variables': {
'output_dir': '<(PRODUCT_DIR)/remoting/unittests', 'output_dir': '<(PRODUCT_DIR)/remoting/unittests',
'webapp_js_files': [
'<@(remoting_webapp_main_html_js_files)',
'<@(remoting_webapp_js_wcs_sandbox_files)',
]
}, },
'copies': [ 'copies': [
{ {
...@@ -357,7 +327,7 @@ ...@@ -357,7 +327,7 @@
{ {
'destination': '<(output_dir)', 'destination': '<(output_dir)',
'files': [ 'files': [
'<@(remoting_webapp_main_html_js_files)', '<@(webapp_js_files)',
], ],
}, },
{ {
...@@ -373,7 +343,7 @@ ...@@ -373,7 +343,7 @@
'inputs': [ 'inputs': [
'webapp/build-html.py', 'webapp/build-html.py',
'<(remoting_webapp_unittest_template_main)', '<(remoting_webapp_unittest_template_main)',
'<@(remoting_webapp_main_html_js_files)', '<@(webapp_js_files)',
'<@(remoting_webapp_unittest_cases)' '<@(remoting_webapp_unittest_cases)'
], ],
'outputs': [ 'outputs': [
...@@ -389,7 +359,7 @@ ...@@ -389,7 +359,7 @@
# exclude list. # exclude list.
'--exclude-js', '<@(remoting_webapp_unittest_exclude_files)', '--exclude-js', '<@(remoting_webapp_unittest_exclude_files)',
'--js', '<@(remoting_webapp_unittest_cases)', '--js', '<@(remoting_webapp_unittest_cases)',
'--instrument-js', '<@(remoting_webapp_main_html_js_files)', '--instrument-js', '<@(webapp_js_files)',
], ],
}, },
], ],
......
// Copyright (c) 2012 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.
/**
* Test fixture for loading all our JS files.
* @constructor
* @extends {testing.Test}
*/
function AllJsLoadTest () {
}
AllJsLoadTest.prototype = {
__proto__: testing.Test.prototype,
/** @inheritDoc */
extraLibraries: [
'base.js',
'browser_globals.gtestjs',
// All of our Javascript files should be listed here unless they are
// only used by JSCompiler
'client_plugin.js',
'client_screen.js',
'client_session.js',
//'clipboard_event_proto.js', // Only used by jscompiler.
'clipboard.js',
'connection_stats.js',
//'cs_oauth2_trampoline.js', // Uses globals in the chrome namespace, which
// give a compilation error when declared in
// browser_globals for some reason. Since this
// file's days are numbered, skip it for now.
'error.js',
'event_handlers.js',
'butter_bar.js',
//'format_iq.js', // Already covered by format_iq.gtestjs
'host.js',
'host_controller.js',
'host_dispatcher.js',
'host_it2me_dispatcher.js',
'host_it2me_native_messaging.js',
'host_list.js',
'host_native_messaging.js',
//'host_plugin_proto.js', // Only used by jscompiler
'host_screen.js',
'host_session.js',
'host_setup_dialog.js',
'host_table_entry.js',
'identity.js',
//'jscompiler_hacks.js', // Only used by jscompiler.
'l10n.js',
'log_to_server.js',
'menu_button.js',
'oauth2_api.js',
'oauth2.js',
'paired_client_manager.js',
'plugin_settings.js',
'remoting.js',
'session_connector.js',
'server_log_entry.js',
'smart_reconnector.js',
'stats_accumulator.js',
'toolbar.js',
'ui_mode.js',
//'viewer_plugin_proto.js', // Only used by jscompiler.
//'wcs_iq_client_proto.js', // Only used by jscompiler.
'wcs.js',
'wcs_loader.js',
'wcs_sandbox_content.js',
'wcs_sandbox_container.js',
'xhr.js',
'xhr_proxy.js',
],
};
// Basic test to verify that all the JS files load without console errors.
// Currently disabled. crbug.com/390814
TEST_F('AllJsLoadTest', 'DISABLED_TestNoConsoleErrors', function() {
assertTrue(true);
});
/* Copyright (c) 2013 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.
*/
/**
* @fileoverview
* Definitions for some browser-supplied globals that are not defined in a
* gtest environment.
*/
var XMLHttpRequest = function() {};
var window = {
addEventListener: function() {},
location: {
pathname: ''
}
};
// Copyright (c) 2012 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.
/**
* Test fixture for IQ formatting routines.
* @constructor
* @extends {testing.Test}
*/
function FormatIqUnitTest () {
remoting.formatIq = new remoting.FormatIq();
remoting.formatIq.setJids("client@jid", "host@jid");
}
FormatIqUnitTest.prototype = {
__proto__: testing.Test.prototype,
/** @inheritDoc */
extraLibraries: [
'format_iq.js',
],
};
// Basic test to verify that the JS Unittest framework is working and that
// format_iq.js loads without console errors.
// TODO(garykac): Add real unittests here.
TEST_F('FormatIqUnitTest', 'TestJsLoad', function() {
assertTrue(true);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment