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/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 browser()->profile(), InlineLoginHandlerImpl::CAN_OFFER_FOR_ALL, | 454 browser()->profile(), InlineLoginHandlerImpl::CAN_OFFER_FOR_ALL, |
455 "12345", "user@gmail.com", &error_message)); | 455 "12345", "user@gmail.com", &error_message)); |
456 EXPECT_EQ("", error_message); | 456 EXPECT_EQ("", error_message); |
457 } | 457 } |
458 | 458 |
459 class InlineLoginHelperBrowserTest : public InProcessBrowserTest { | 459 class InlineLoginHelperBrowserTest : public InProcessBrowserTest { |
460 public: | 460 public: |
461 InlineLoginHelperBrowserTest() {} | 461 InlineLoginHelperBrowserTest() {} |
462 | 462 |
463 void SetUpInProcessBrowserTestFixture() override { | 463 void SetUpInProcessBrowserTestFixture() override { |
464 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
465 | |
466 will_create_browser_context_services_subscription_ = | 464 will_create_browser_context_services_subscription_ = |
467 BrowserContextDependencyManager::GetInstance() | 465 BrowserContextDependencyManager::GetInstance() |
468 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( | 466 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( |
469 base::Bind(&InlineLoginHelperBrowserTest:: | 467 base::Bind(&InlineLoginHelperBrowserTest:: |
470 OnWillCreateBrowserContextServices, | 468 OnWillCreateBrowserContextServices, |
471 base::Unretained(this))); | 469 base::Unretained(this))); |
472 } | 470 } |
473 | 471 |
474 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { | 472 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { |
475 // Replace the signin manager and token service with fakes. Do this ahead of | 473 // Replace the signin manager and token service with fakes. Do this ahead of |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 content::WebContents* contents = | 932 content::WebContents* contents = |
935 browser()->tab_strip_model()->GetActiveWebContents(); | 933 browser()->tab_strip_model()->GetActiveWebContents(); |
936 ASSERT_TRUE(content::ExecuteScript( | 934 ASSERT_TRUE(content::ExecuteScript( |
937 contents, "window.location.href = 'chrome://foo'")); | 935 contents, "window.location.href = 'chrome://foo'")); |
938 | 936 |
939 content::TestNavigationObserver navigation_observer(contents, 1); | 937 content::TestNavigationObserver navigation_observer(contents, 1); |
940 navigation_observer.Wait(); | 938 navigation_observer.Wait(); |
941 | 939 |
942 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); | 940 EXPECT_EQ(GURL("about:blank"), contents->GetVisibleURL()); |
943 } | 941 } |
OLD | NEW |