summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/drive/gdata_wapi_url_generator_unittest.cc3
-rw-r--r--google_apis/drive/test_util.cc3
-rw-r--r--google_apis/gaia/DEPS5
-rw-r--r--google_apis/gaia/oauth2_access_token_fetcher_unittest.cc10
-rw-r--r--google_apis/google_apis.gyp50
5 files changed, 61 insertions, 10 deletions
diff --git a/google_apis/drive/gdata_wapi_url_generator_unittest.cc b/google_apis/drive/gdata_wapi_url_generator_unittest.cc
index 63db63d..56e884a 100644
--- a/google_apis/drive/gdata_wapi_url_generator_unittest.cc
+++ b/google_apis/drive/gdata_wapi_url_generator_unittest.cc
@@ -6,6 +6,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#include "url/url_util.h"
namespace google_apis {
@@ -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",
diff --git a/google_apis/drive/test_util.cc b/google_apis/drive/test_util.cc
index 20d8ad6..5aaac8c 100644
--- a/google_apis/drive/test_util.cc
+++ b/google_apis/drive/test_util.cc
@@ -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);
}
diff --git a/google_apis/gaia/DEPS b/google_apis/gaia/DEPS
deleted file mode 100644
index f445dee..0000000
--- a/google_apis/gaia/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-specific_include_rules = {
- ".*_[a-z]*test\.cc": [
- "+content/public/test/test_browser_thread_bundle.h",
- ]
-}
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
index 135e292..3761090 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -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"
@@ -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 =
@@ -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_;
diff --git a/google_apis/google_apis.gyp b/google_apis/google_apis.gyp
index 2d281f2..0ba370b 100644
--- a/google_apis/google_apis.gyp
+++ b/google_apis/google_apis.gyp
@@ -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',
@@ -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',
+ ],
+ }],
],
},
{
@@ -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',
],
},
],