summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 23:39:35 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 23:39:35 +0000
commit37ac95b451ae3cdddf327b9bfc3ba350b149b5ff (patch)
treee4f65b78b410d48cb7ff06c0193fb34980e5334b /google_apis
parentb785a42692ee2b57600f8b2df66f785387d3f7c0 (diff)
downloadchromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.zip
chromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.tar.gz
chromium_src-37ac95b451ae3cdddf327b9bfc3ba350b149b5ff.tar.bz2
Correctly integrate StoragePartition into TestingProfile.
Until this CL, TestingProfile had 3 distinct URLRequestContexts it would return to the user: one via profile->GetDefaultStoragePartition()->GetRequestContext(), one via profile->GetRequestContext(), and one via profile->GetResourceContext->GetRequestContext(). All of these had different cookie stores. This CL unified them so they all return the one from profile->GetDefaultStoragePartition()->GetRequestContext(). This correctly mimics how production code works. Doing this had a bunch of implications: (1) Removes TestingProfile::CreateRequestContext()/ResetRequestContext() (2) Changes MockRequestContext to share the URLRequestContext with TestingProfile. (3) TestingProfile now requires all BrowserThreads. Point (3) effectively adds TestBrowserThreadBundle into a bunch more spots. Because of that, we also have the following changes: (a) AshTestBase now has a TestBrowserThreadBundle (b) Removed a bunch of real threads from tests. (c) TemplateUrlService has reworked synchronization semantics. (d) Removed MultiThreadTestHelper. (e) Added TestingIOThread class + testing API in IOThread to mock out various IO thread tasks which enervated with the new TestBrowserThreadBundle. TBR=bauerb,brettw,isherman,joth,jyasskin,mattm,mmenke,mnissler,pkasting,rkc,rlp,satorux,tim,xians,joth BUG=159193 Review URL: https://chromiumcodereview.appspot.com/17127002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/DEPS2
-rw-r--r--google_apis/gaia/gaia_auth_fetcher_unittest.cc3
-rw-r--r--google_apis/gaia/gaia_oauth_client_unittest.cc4
-rw-r--r--google_apis/gaia/oauth2_access_token_fetcher_unittest.cc12
-rw-r--r--google_apis/gaia/oauth2_api_call_flow_unittest.cc4
5 files changed, 7 insertions, 18 deletions
diff --git a/google_apis/gaia/DEPS b/google_apis/gaia/DEPS
index e88533d..f445dee 100644
--- a/google_apis/gaia/DEPS
+++ b/google_apis/gaia/DEPS
@@ -1,5 +1,5 @@
specific_include_rules = {
".*_[a-z]*test\.cc": [
- "+content/public/test/test_browser_thread.h",
+ "+content/public/test/test_browser_thread_bundle.h",
]
}
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 6311a9b..74fed98 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -8,7 +8,6 @@
#include <string>
#include "base/json/json_reader.h"
-#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "google_apis/gaia/gaia_auth_consumer.h"
@@ -102,7 +101,7 @@ void MockFetcher::Start() {
}
class GaiaAuthFetcherTest : public testing::Test {
- public:
+ protected:
GaiaAuthFetcherTest()
: client_login_source_(GaiaUrls::GetInstance()->client_login_url()),
issue_auth_token_source_(
diff --git a/google_apis/gaia/gaia_oauth_client_unittest.cc b/google_apis/gaia/gaia_oauth_client_unittest.cc
index e84a698c..cdeb483 100644
--- a/google_apis/gaia/gaia_oauth_client_unittest.cc
+++ b/google_apis/gaia/gaia_oauth_client_unittest.cc
@@ -7,7 +7,6 @@
#include <string>
#include <vector>
-#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "google_apis/gaia/gaia_oauth_client.h"
@@ -155,8 +154,7 @@ const std::string kDummyTokenInfoResult =
namespace gaia {
class GaiaOAuthClientTest : public testing::Test {
- public:
- GaiaOAuthClientTest() {}
+ protected:
virtual void SetUp() OVERRIDE {
client_info_.client_id = "test_client_id";
client_info_.client_secret = "test_client_secret";
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
index a6dd621..6b12da3 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -7,8 +7,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.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"
@@ -25,7 +24,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
-using content::BrowserThread;
using net::ResponseCookies;
using net::ScopedURLFetcherFactory;
using net::TestURLFetcher;
@@ -84,9 +82,8 @@ class MockOAuth2AccessTokenConsumer : public OAuth2AccessTokenConsumer {
class OAuth2AccessTokenFetcherTest : public testing::Test {
public:
OAuth2AccessTokenFetcherTest()
- : ui_thread_(BrowserThread::UI, &message_loop_),
- request_context_getter_(new net::TestURLRequestContextGetter(
- message_loop_.message_loop_proxy())),
+ : request_context_getter_(new net::TestURLRequestContextGetter(
+ base::MessageLoopProxy::current())),
fetcher_(&consumer_, request_context_getter_) {
}
@@ -112,8 +109,7 @@ class OAuth2AccessTokenFetcherTest : public testing::Test {
}
protected:
- base::MessageLoop message_loop_;
- content::TestBrowserThread ui_thread_;
+ content::TestBrowserThreadBundle thread_bundle_;
MockUrlFetcherFactory factory_;
MockOAuth2AccessTokenConsumer consumer_;
scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_;
diff --git a/google_apis/gaia/oauth2_api_call_flow_unittest.cc b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
index 7d8d138..d56a613 100644
--- a/google_apis/gaia/oauth2_api_call_flow_unittest.cc
+++ b/google_apis/gaia/oauth2_api_call_flow_unittest.cc
@@ -109,10 +109,6 @@ class MockApiCallFlow : public OAuth2ApiCallFlow {
} // namespace
class OAuth2ApiCallFlowTest : public testing::Test {
- public:
- OAuth2ApiCallFlowTest() {}
- virtual ~OAuth2ApiCallFlowTest() {}
-
protected:
void SetupAccessTokenFetcher(
const std::string& rt, const std::vector<std::string>& scopes) {