Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1123)

Unified Diff: chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc

Issue 1217563005: Create unique HttpNetworkSession for storage partition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wired up remaining state for HttpNetworkSession. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
index c95a829b348ce9c04134db4be9a1dfc39ea1e6e4..8d0ed275ab2d3b6d406efe5b203e4e7634dd1068 100644
--- a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
@@ -42,9 +42,12 @@
#include "google_apis/gaia/fake_gaia.h"
#include "google_apis/gaia/gaia_switches.h"
#include "net/base/url_util.h"
+#include "net/http/http_transaction_factory.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
+#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_context_getter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
@@ -175,10 +178,22 @@ void InlineLoginUIBrowserTest::SetAllowedUsernamePattern(
#if defined(OS_LINUX) || defined(OS_WIN)
// crbug.com/422868
-#define MAYBE_DifferentStorageId DISABLED_DifferentStorageId
+#define MAYBE_DifferentStorageId DifferentStorageId
#else
#define MAYBE_DifferentStorageId DifferentStorageId
#endif
+void VerifyNetworkSessionsAreDifferent(content::StoragePartition* partition1,
+ content::StoragePartition* partition2) {
+ ASSERT_NE(partition1->GetURLRequestContext()
+ ->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetSession(),
+ partition2->GetURLRequestContext()
+ ->GetURLRequestContext()
+ ->http_transaction_factory()
+ ->GetSession());
+}
+
IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, MAYBE_DifferentStorageId) {
if (switches::IsEnableWebviewBasedSignin()) {
ContentInfo info = NavigateAndGetInfo(
@@ -199,6 +214,13 @@ IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, MAYBE_DifferentStorageId) {
webview_contents->GetRenderProcessHost();
ASSERT_NE(info.pid, process->GetID());
ASSERT_NE(info.storage_partition, process->GetStoragePartition());
+ base::RunLoop run_loop;
+ content::BrowserThread::PostTaskAndReply(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(VerifyNetworkSessionsAreDifferent, info.storage_partition,
+ process->GetStoragePartition()),
+ run_loop.QuitClosure());
+ run_loop.Run();
} else {
GURL test_url = ui_test_utils::GetTestUrl(
base::FilePath(base::FilePath::kCurrentDirectory),
« chrome/browser/profiles/profile_impl_io_data.cc ('K') | « chrome/browser/profiles/profile_io_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698