Commit 5307e885 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Fix first party URL in GaiaAuthFetcher

Bug: 882107
Change-Id: Ie36e139d17b03bfd75f3b1cec9d557ec5513b084
Reviewed-on: https://chromium-review.googlesource.com/1236214Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592896}
parent da20b6a2
...@@ -239,6 +239,12 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( ...@@ -239,6 +239,12 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher(
resource_request->url = gaia_gurl; resource_request->url = gaia_gurl;
original_url_ = gaia_gurl; original_url_ = gaia_gurl;
if (!(load_flags & net::LOAD_DO_NOT_SEND_COOKIES)) {
DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url(), gaia_gurl.GetOrigin())
<< gaia_gurl;
resource_request->site_for_cookies = GaiaUrls::GetInstance()->gaia_url();
}
if (!body.empty()) if (!body.empty())
resource_request->method = "POST"; resource_request->method = "POST";
......
...@@ -130,12 +130,6 @@ class GaiaAuthFetcherTest : public testing::Test { ...@@ -130,12 +130,6 @@ class GaiaAuthFetcherTest : public testing::Test {
return test_shared_loader_factory_; return test_shared_loader_factory_;
} }
bool WasLastURLServed(const GURL& url) {
if (received_requests_.empty())
return false;
return received_requests_.back().url == url;
}
base::test::ScopedTaskEnvironment scoped_task_environment_; base::test::ScopedTaskEnvironment scoped_task_environment_;
network::TestURLLoaderFactory test_url_loader_factory_; network::TestURLLoaderFactory test_url_loader_factory_;
scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_;
...@@ -435,6 +429,10 @@ TEST_F(GaiaAuthFetcherTest, ListAccounts) { ...@@ -435,6 +429,10 @@ TEST_F(GaiaAuthFetcherTest, ListAccounts) {
/*body=*/"", /*headers=*/"", /*body=*/"", /*headers=*/"",
GaiaUrls::GetInstance()->ListAccountsURLWithSource(std::string()), GaiaUrls::GetInstance()->ListAccountsURLWithSource(std::string()),
/*load_flags=*/0, NO_TRAFFIC_ANNOTATION_YET); /*load_flags=*/0, NO_TRAFFIC_ANNOTATION_YET);
ASSERT_EQ(received_requests_.size(), 1U);
EXPECT_EQ(net::LOAD_NORMAL, received_requests_.at(0).load_flags);
EXPECT_EQ(GaiaUrls::GetInstance()->gaia_url(),
received_requests_.at(0).site_for_cookies);
auth.TestOnURLLoadCompleteInternal(net::OK, net::HTTP_OK, {}, data); auth.TestOnURLLoadCompleteInternal(net::OK, net::HTTP_OK, {}, data);
} }
......
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