summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 00:06:39 +0000
committerkelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 00:06:39 +0000
commitf4e0bd2cbf194d9a59fd88a3a255d8676ad2406f (patch)
tree116d4e4fd3472dad3a9b56f861f5c104dd4f7ef9
parente2be10e34a5209ca4d1bad89b7465f2e614f6f90 (diff)
downloadchromium_src-f4e0bd2cbf194d9a59fd88a3a255d8676ad2406f.zip
chromium_src-f4e0bd2cbf194d9a59fd88a3a255d8676ad2406f.tar.gz
chromium_src-f4e0bd2cbf194d9a59fd88a3a255d8676ad2406f.tar.bz2
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
-rw-r--r--chrome/js_unittest_rules.gypi2
-rw-r--r--remoting/base/run_all_unittests.cc (renamed from chrome/test/base/run_all_remoting_unittests.cc)13
-rw-r--r--remoting/remoting_test.gypi50
-rw-r--r--remoting/webapp/all_js_load.gtestjs79
-rw-r--r--remoting/webapp/browser_globals.gtestjs19
-rw-r--r--remoting/webapp/format_iq.gtestjs29
6 files changed, 11 insertions, 181 deletions
diff --git a/chrome/js_unittest_rules.gypi b/chrome/js_unittest_rules.gypi
index d877f16..27901f1c 100644
--- a/chrome/js_unittest_rules.gypi
+++ b/chrome/js_unittest_rules.gypi
@@ -26,8 +26,6 @@
# Note that when you run your TestSuite, you'll need to call
# chrome::RegisterPathProvider(). These path providers are required by
# 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': [
diff --git a/chrome/test/base/run_all_remoting_unittests.cc b/remoting/base/run_all_unittests.cc
index e629b8f..5f52f7e 100644
--- a/chrome/test/base/run_all_remoting_unittests.cc
+++ b/remoting/base/run_all_unittests.cc
@@ -1,26 +1,15 @@
-// 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
// 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/test_suite.h"
-#include "chrome/common/chrome_paths.h"
#include "media/base/media.h"
#include "net/socket/ssl_server_socket.h"
int main(int argc, char** 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
// single-threaded.
net::EnableSSLServerSockets();
diff --git a/remoting/remoting_test.gypi b/remoting/remoting_test.gypi
index 251a69a..2bf2eea 100644
--- a/remoting/remoting_test.gypi
+++ b/remoting/remoting_test.gypi
@@ -40,7 +40,6 @@
'../testing/gmock/include',
],
'sources': [
- '../chrome/test/base/run_all_remoting_unittests.cc',
'base/auth_token_util_unittest.cc',
'base/auto_thread_task_runner_unittest.cc',
'base/auto_thread_unittest.cc',
@@ -50,12 +49,13 @@
'base/rate_counter_unittest.cc',
'base/resources_unittest.cc',
'base/rsa_key_pair_unittest.cc',
+ 'base/run_all_unittests.cc',
'base/running_average_unittest.cc',
'base/test_rsa_key_pair.h',
'base/typed_buffer_unittest.cc',
'base/util_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/plugin/normalizing_input_filter_cros_unittest.cc',
'client/plugin/normalizing_input_filter_mac_unittest.cc',
@@ -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"', {
'dependencies!': [
'remoting_client_plugin',
@@ -264,7 +230,7 @@
'../testing/gmock/include',
],
'sources': [
- '../chrome/test/base/run_all_remoting_unittests.cc',
+ 'base/run_all_unittests.cc',
'codec/codec_test.cc',
'codec/codec_test.h',
'codec/video_encoder_vpx_perftest.cc',
@@ -330,6 +296,10 @@
'type': 'none',
'variables': {
'output_dir': '<(PRODUCT_DIR)/remoting/unittests',
+ 'webapp_js_files': [
+ '<@(remoting_webapp_main_html_js_files)',
+ '<@(remoting_webapp_js_wcs_sandbox_files)',
+ ]
},
'copies': [
{
@@ -357,7 +327,7 @@
{
'destination': '<(output_dir)',
'files': [
- '<@(remoting_webapp_main_html_js_files)',
+ '<@(webapp_js_files)',
],
},
{
@@ -373,7 +343,7 @@
'inputs': [
'webapp/build-html.py',
'<(remoting_webapp_unittest_template_main)',
- '<@(remoting_webapp_main_html_js_files)',
+ '<@(webapp_js_files)',
'<@(remoting_webapp_unittest_cases)'
],
'outputs': [
@@ -389,7 +359,7 @@
# exclude list.
'--exclude-js', '<@(remoting_webapp_unittest_exclude_files)',
'--js', '<@(remoting_webapp_unittest_cases)',
- '--instrument-js', '<@(remoting_webapp_main_html_js_files)',
+ '--instrument-js', '<@(webapp_js_files)',
],
},
],
diff --git a/remoting/webapp/all_js_load.gtestjs b/remoting/webapp/all_js_load.gtestjs
deleted file mode 100644
index 5246894..0000000
--- a/remoting/webapp/all_js_load.gtestjs
+++ /dev/null
@@ -1,79 +0,0 @@
-// 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);
-});
diff --git a/remoting/webapp/browser_globals.gtestjs b/remoting/webapp/browser_globals.gtestjs
deleted file mode 100644
index 0d55b25..0000000
--- a/remoting/webapp/browser_globals.gtestjs
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 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: ''
- }
-};
diff --git a/remoting/webapp/format_iq.gtestjs b/remoting/webapp/format_iq.gtestjs
deleted file mode 100644
index a4ab8e9..0000000
--- a/remoting/webapp/format_iq.gtestjs
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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);
-});