| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 local_state->SetString(prefs::kGoogleServicesUsernamePattern, pattern); | 303 local_state->SetString(prefs::kGoogleServicesUsernamePattern, pattern); |
| 304 } | 304 } |
| 305 | 305 |
| 306 #if defined(OS_LINUX) || defined(OS_WIN) | 306 #if defined(OS_LINUX) || defined(OS_WIN) |
| 307 // crbug.com/422868 | 307 // crbug.com/422868 |
| 308 #define MAYBE_DifferentStorageId DISABLED_DifferentStorageId | 308 #define MAYBE_DifferentStorageId DISABLED_DifferentStorageId |
| 309 #else | 309 #else |
| 310 #define MAYBE_DifferentStorageId DifferentStorageId | 310 #define MAYBE_DifferentStorageId DifferentStorageId |
| 311 #endif | 311 #endif |
| 312 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, MAYBE_DifferentStorageId) { | 312 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, MAYBE_DifferentStorageId) { |
| 313 ContentInfo info = | 313 ContentInfo info = NavigateAndGetInfo(browser(), GetSigninPromoURL(), |
| 314 NavigateAndGetInfo(browser(), GetSigninPromoURL(), CURRENT_TAB); | 314 WindowOpenDisposition::CURRENT_TAB); |
| 315 WaitUntilUIReady(browser()); | 315 WaitUntilUIReady(browser()); |
| 316 | 316 |
| 317 // Make sure storage partition of embedded webview is different from | 317 // Make sure storage partition of embedded webview is different from |
| 318 // parent. | 318 // parent. |
| 319 std::set<content::WebContents*> set; | 319 std::set<content::WebContents*> set; |
| 320 GuestViewManager* manager = GuestViewManager::FromBrowserContext( | 320 GuestViewManager* manager = GuestViewManager::FromBrowserContext( |
| 321 info.contents->GetBrowserContext()); | 321 info.contents->GetBrowserContext()); |
| 322 manager->ForEachGuest(info.contents, base::Bind(&AddToSet, &set)); | 322 manager->ForEachGuest(info.contents, base::Bind(&AddToSet, &set)); |
| 323 ASSERT_EQ(1u, set.size()); | 323 ASSERT_EQ(1u, set.size()); |
| 324 content::WebContents* webview_contents = *set.begin(); | 324 content::WebContents* webview_contents = *set.begin(); |
| 325 content::RenderProcessHost* process = | 325 content::RenderProcessHost* process = |
| 326 webview_contents->GetRenderProcessHost(); | 326 webview_contents->GetRenderProcessHost(); |
| 327 ASSERT_NE(info.pid, process->GetID()); | 327 ASSERT_NE(info.pid, process->GetID()); |
| 328 ASSERT_NE(info.storage_partition, process->GetStoragePartition()); | 328 ASSERT_NE(info.storage_partition, process->GetStoragePartition()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, OneProcessLimit) { | 331 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, OneProcessLimit) { |
| 332 GURL test_url_1 = ui_test_utils::GetTestUrl( | 332 GURL test_url_1 = ui_test_utils::GetTestUrl( |
| 333 base::FilePath(base::FilePath::kCurrentDirectory), | 333 base::FilePath(base::FilePath::kCurrentDirectory), |
| 334 base::FilePath(FILE_PATH_LITERAL("title1.html"))); | 334 base::FilePath(FILE_PATH_LITERAL("title1.html"))); |
| 335 GURL test_url_2 = ui_test_utils::GetTestUrl( | 335 GURL test_url_2 = ui_test_utils::GetTestUrl( |
| 336 base::FilePath(base::FilePath::kCurrentDirectory), | 336 base::FilePath(base::FilePath::kCurrentDirectory), |
| 337 base::FilePath(FILE_PATH_LITERAL("data:text/html,Hello world!"))); | 337 base::FilePath(FILE_PATH_LITERAL("data:text/html,Hello world!"))); |
| 338 | 338 |
| 339 // Even when the process limit is set to one, the signin process should | 339 // Even when the process limit is set to one, the signin process should |
| 340 // still be given its own process and storage partition. | 340 // still be given its own process and storage partition. |
| 341 content::RenderProcessHost::SetMaxRendererProcessCount(1); | 341 content::RenderProcessHost::SetMaxRendererProcessCount(1); |
| 342 | 342 |
| 343 ContentInfo info1 = | 343 ContentInfo info1 = NavigateAndGetInfo(browser(), test_url_1, |
| 344 NavigateAndGetInfo(browser(), test_url_1, CURRENT_TAB); | 344 WindowOpenDisposition::CURRENT_TAB); |
| 345 ContentInfo info2 = | 345 ContentInfo info2 = NavigateAndGetInfo(browser(), test_url_2, |
| 346 NavigateAndGetInfo(browser(), test_url_2, CURRENT_TAB); | 346 WindowOpenDisposition::CURRENT_TAB); |
| 347 ContentInfo info3 = | 347 ContentInfo info3 = NavigateAndGetInfo(browser(), GetSigninPromoURL(), |
| 348 NavigateAndGetInfo(browser(), GetSigninPromoURL(), CURRENT_TAB); | 348 WindowOpenDisposition::CURRENT_TAB); |
| 349 | 349 |
| 350 ASSERT_EQ(info1.pid, info2.pid); | 350 ASSERT_EQ(info1.pid, info2.pid); |
| 351 ASSERT_NE(info1.pid, info3.pid); | 351 ASSERT_NE(info1.pid, info3.pid); |
| 352 } | 352 } |
| 353 | 353 |
| 354 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferNoProfile) { | 354 IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferNoProfile) { |
| 355 std::string error_message; | 355 std::string error_message; |
| 356 EXPECT_FALSE(InlineLoginHandlerImpl::CanOffer( | 356 EXPECT_FALSE(InlineLoginHandlerImpl::CanOffer( |
| 357 NULL, InlineLoginHandlerImpl::CAN_OFFER_FOR_ALL, | 357 NULL, InlineLoginHandlerImpl::CAN_OFFER_FOR_ALL, |
| 358 "12345", "user@gmail.com", &error_message)); | 358 "12345", "user@gmail.com", &error_message)); |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 content::WebContents* contents = | 848 content::WebContents* contents = |
| 849 browser()->tab_strip_model()->GetActiveWebContents(); | 849 browser()->tab_strip_model()->GetActiveWebContents(); |
| 850 ASSERT_TRUE(content::ExecuteScript( | 850 ASSERT_TRUE(content::ExecuteScript( |
| 851 contents, "window.location.href = 'chrome://foo'")); | 851 contents, "window.location.href = 'chrome://foo'")); |
| 852 | 852 |
| 853 content::TestNavigationObserver navigation_observer(contents, 1); | 853 content::TestNavigationObserver navigation_observer(contents, 1); |
| 854 navigation_observer.Wait(); | 854 navigation_observer.Wait(); |
| 855 | 855 |
| 856 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); | 856 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); |
| 857 } | 857 } |
| OLD | NEW |