Skip to content

Commit

Permalink
Move the rest of the //google_apis tests into google_apis_unittests.
Browse files Browse the repository at this point in the history
This removes these tests from unit_tests target and move them into the
not so new google_apis_unittests target.

BUG=257421
TEST=google_apis_unittests
R=joi@chromium.org,thestig@chromium.org
TBR=thestig

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242857 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Jan 3, 2014
1 parent f8b17d8 commit 2ac9693
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 51 deletions.
42 changes: 1 addition & 41 deletions chrome/chrome_tests_unit.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
'../extensions/common/extension_builder.h',
'../extensions/common/value_builder.cc',
'../extensions/common/value_builder.h',
'../google_apis/drive/dummy_auth_service.cc',
'../google_apis/drive/dummy_auth_service.h',
'../google_apis/drive/test_util.cc',
'../google_apis/drive/test_util.h',
'app/chrome_main_delegate.cc',
'app/chrome_main_delegate.h',
'browser/android/bookmarks/partner_bookmarks_shim_unittest.cc',
Expand Down Expand Up @@ -303,6 +299,7 @@
'../content/content.gyp:content_worker',
'../components/components.gyp:autofill_core_test_support',
'../components/components.gyp:sessions_test_support',
'../google_apis/google_apis.gyp:google_apis_test_support',
'../ipc/ipc.gyp:test_support_ipc',
'../media/media.gyp:media_test_support',
'../ppapi/ppapi_internal.gyp:ppapi_shared',
Expand Down Expand Up @@ -498,11 +495,6 @@
'chrome_resources.gyp:chrome_resources',
'chrome_resources.gyp:chrome_strings',
],
# TODO(joi): Remove this section once the google_apis tests are
# a separate unit test binary.
'includes': [
'../google_apis/determine_use_official_keys.gypi',
],
'include_dirs': [
'..',
],
Expand Down Expand Up @@ -1992,33 +1984,6 @@
'../components/webdata/common/web_data_service_test_util.cc',
'../components/webdata/common/web_data_service_test_util.h',

# TODO(joi): Move the google_apis tests to a separate
# google_apis_unittests executable.
'../google_apis/google_api_keys_unittest.cc',
'../google_apis/cup/client_update_protocol_unittest.cc',
'../google_apis/drive/base_requests_unittest.cc',
'../google_apis/drive/base_requests_server_unittest.cc',
'../google_apis/drive/drive_api_requests_unittest.cc',
'../google_apis/drive/drive_api_parser_unittest.cc',
'../google_apis/drive/drive_api_url_generator_unittest.cc',
'../google_apis/drive/gdata_wapi_parser_unittest.cc',
'../google_apis/drive/gdata_wapi_requests_unittest.cc',
'../google_apis/drive/gdata_wapi_url_generator_unittest.cc',
'../google_apis/drive/request_sender_unittest.cc',
'../google_apis/drive/request_util_unittest.cc',
'../google_apis/drive/time_util_unittest.cc',
'../google_apis/gaia/mock_url_fetcher_factory.h',
'../google_apis/gaia/gaia_auth_fetcher_unittest.cc',
'../google_apis/gaia/gaia_auth_util_unittest.cc',
'../google_apis/gaia/gaia_oauth_client_unittest.cc',
'../google_apis/gaia/google_service_auth_error_unittest.cc',
'../google_apis/gaia/oauth_request_signer_unittest.cc',
'../google_apis/gaia/oauth2_access_token_fetcher_unittest.cc',
'../google_apis/gaia/oauth2_api_call_flow_unittest.cc',
'../google_apis/gaia/oauth2_mint_token_flow_unittest.cc',
'../google_apis/gaia/oauth2_token_service_test_util.cc',
'../google_apis/gaia/oauth2_token_service_test_util.h',
'../google_apis/gaia/oauth2_token_service_unittest.cc',
'../skia/ext/analysis_canvas_unittest.cc',
'../skia/ext/bitmap_platform_device_mac_unittest.cc',
'../skia/ext/convolver_unittest.cc',
Expand Down Expand Up @@ -2623,11 +2588,6 @@
'browser/drive/fake_drive_service_unittest.cc',
'browser/sync_file_system/drive_backend/api_util_unittest.cc',
'browser/sync_file_system/drive_backend/drive_file_sync_service_sync_unittest.cc',
'../google_apis/drive/base_requests_server_unittest.cc',
'../google_apis/drive/drive_api_parser_unittest.cc',
'../google_apis/drive/drive_api_requests_unittest.cc',
'../google_apis/drive/gdata_wapi_parser_unittest.cc',
'../google_apis/drive/gdata_wapi_requests_unittest.cc',

# The autofill popup is implemented in mostly native code on
# Android.
Expand Down
3 changes: 3 additions & 0 deletions google_apis/drive/gdata_wapi_url_generator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/url_util.h"

namespace google_apis {

Expand Down Expand Up @@ -148,6 +149,8 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrlWithoutParams) {
}

TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrlWithEmbedOrigin) {
url_util::AddStandardScheme("chrome-extension");

EXPECT_EQ(
"https://docs.google.com/feeds/default/private/full/XXX?v=3&alt=json"
"&showroot=true&embedOrigin=chrome-extension%3A%2F%2Ftest",
Expand Down
3 changes: 2 additions & 1 deletion google_apis/drive/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ void RunAndQuit(base::RunLoop* run_loop, const base::Closure& closure) {

bool WriteStringToFile(const base::FilePath& file_path,
const std::string& content) {
int result = file_util::WriteFile(file_path, content.data(), content.size());
int result = file_util::WriteFile(
file_path, content.data(), static_cast<int>(content.size()));
return content.size() == static_cast<size_t>(result);
}

Expand Down
5 changes: 0 additions & 5 deletions google_apis/gaia/DEPS

This file was deleted.

10 changes: 6 additions & 4 deletions google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>

#include "base/memory/scoped_ptr.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "base/run_loop.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/gaia/oauth2_access_token_consumer.h"
Expand Down Expand Up @@ -90,12 +90,14 @@ class OAuth2AccessTokenFetcherTest : public testing::Test {
: request_context_getter_(new net::TestURLRequestContextGetter(
base::MessageLoopProxy::current())),
fetcher_(&consumer_, request_context_getter_) {
base::RunLoop().RunUntilIdle();
}

virtual ~OAuth2AccessTokenFetcherTest() {}

virtual TestURLFetcher* SetupGetAccessToken(
bool fetch_succeeds, int response_code, const std::string& body) {
virtual TestURLFetcher* SetupGetAccessToken(bool fetch_succeeds,
int response_code,
const std::string& body) {
GURL url(GaiaUrls::GetInstance()->oauth2_token_url());
TestURLFetcher* url_fetcher = new TestURLFetcher(0, url, &fetcher_);
URLRequestStatus::Status status =
Expand All @@ -114,7 +116,7 @@ class OAuth2AccessTokenFetcherTest : public testing::Test {
}

protected:
content::TestBrowserThreadBundle thread_bundle_;
base::MessageLoop message_loop_;
MockUrlFetcherFactory factory_;
MockOAuth2AccessTokenConsumer consumer_;
scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_;
Expand Down
50 changes: 50 additions & 0 deletions google_apis/google_apis.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
'GOOGLE_DEFAULT_CLIENT_SECRET="<(google_default_client_secret)"',
]
}],
[ 'OS == "mac" or OS == "ios" or OS == "win"', {
'dependencies': [
'../third_party/nss/nss.gyp:nspr',
'../third_party/nss/nss.gyp:nss',
],
}],
[ 'OS == "android"', {
'dependencies': [
'../third_party/openssl/openssl.gyp:openssl',
Expand Down Expand Up @@ -129,14 +135,51 @@
'type': 'executable',
'dependencies': [
'../base/base.gyp:run_all_unittests',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'google_apis',
'google_apis_test_support',
],
'includes': [
'determine_use_official_keys.gypi',
],
'include_dirs': [
'..',
],
'sources': [
'google_api_keys_unittest.cc',
'cup/client_update_protocol_unittest.cc',
'drive/base_requests_unittest.cc',
'drive/base_requests_server_unittest.cc',
'drive/drive_api_requests_unittest.cc',
'drive/drive_api_parser_unittest.cc',
'drive/drive_api_url_generator_unittest.cc',
'drive/gdata_wapi_parser_unittest.cc',
'drive/gdata_wapi_requests_unittest.cc',
'drive/gdata_wapi_url_generator_unittest.cc',
'drive/request_sender_unittest.cc',
'drive/request_util_unittest.cc',
'drive/time_util_unittest.cc',
'gaia/gaia_auth_fetcher_unittest.cc',
'gaia/gaia_auth_util_unittest.cc',
'gaia/gaia_oauth_client_unittest.cc',
'gaia/google_service_auth_error_unittest.cc',
'gaia/oauth_request_signer_unittest.cc',
'gaia/oauth2_access_token_fetcher_unittest.cc',
'gaia/oauth2_api_call_flow_unittest.cc',
'gaia/oauth2_mint_token_flow_unittest.cc',
'gaia/oauth2_token_service_unittest.cc',
],
'conditions': [
['OS=="android"', {
'sources!': [
'drive/base_requests_server_unittest.cc',
'drive/drive_api_parser_unittest.cc',
'drive/drive_api_requests_unittest.cc',
'drive/gdata_wapi_parser_unittest.cc',
'drive/gdata_wapi_requests_unittest.cc',
],
}],
],
},
{
Expand All @@ -155,8 +198,15 @@
'../net/net.gyp:net_test_support',
],
'sources': [
'drive/dummy_auth_service.cc',
'drive/dummy_auth_service.h',
'drive/test_util.cc',
'drive/test_util.h',
'gaia/fake_gaia.cc',
'gaia/fake_gaia.h',
'gaia/mock_url_fetcher_factory.h',
'gaia/oauth2_token_service_test_util.cc',
'gaia/oauth2_token_service_test_util.h',
],
},
],
Expand Down

0 comments on commit 2ac9693

Please sign in to comment.