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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 class InlineLoginHelperBrowserTest : public InProcessBrowserTest { | 438 class InlineLoginHelperBrowserTest : public InProcessBrowserTest { |
439 public: | 439 public: |
440 InlineLoginHelperBrowserTest() {} | 440 InlineLoginHelperBrowserTest() {} |
441 | 441 |
442 void SetUpInProcessBrowserTestFixture() override { | 442 void SetUpInProcessBrowserTestFixture() override { |
443 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 443 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
444 | 444 |
445 will_create_browser_context_services_subscription_ = | 445 will_create_browser_context_services_subscription_ = |
446 BrowserContextDependencyManager::GetInstance() | 446 BrowserContextDependencyManager::GetInstance() |
447 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( | 447 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( |
448 base::Bind(&InlineLoginHelperBrowserTest:: | 448 base::Bind(&InlineLoginHelperBrowserTest:: |
449 OnWillCreateBrowserContextServices, | 449 OnWillCreateBrowserContextServices, |
450 base::Unretained(this))) | 450 base::Unretained(this))); |
451 .Pass(); | |
452 } | 451 } |
453 | 452 |
454 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { | 453 void OnWillCreateBrowserContextServices(content::BrowserContext* context) { |
455 // Replace the signin manager and token service with fakes. Do this ahead of | 454 // Replace the signin manager and token service with fakes. Do this ahead of |
456 // creating the browser so that a bunch of classes don't register as | 455 // creating the browser so that a bunch of classes don't register as |
457 // observers and end up needing to unregister when the fake is substituted. | 456 // observers and end up needing to unregister when the fake is substituted. |
458 SigninManagerFactory::GetInstance()->SetTestingFactory( | 457 SigninManagerFactory::GetInstance()->SetTestingFactory( |
459 context, &BuildFakeSigninManagerBase); | 458 context, &BuildFakeSigninManagerBase); |
460 ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory( | 459 ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory( |
461 context, &BuildFakeProfileOAuth2TokenService); | 460 context, &BuildFakeProfileOAuth2TokenService); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 ->AddObserver(&observer); | 890 ->AddObserver(&observer); |
892 base::RunLoop run_loop; | 891 base::RunLoop run_loop; |
893 EXPECT_CALL(observer, OnUntrustedLoginUIShown()) | 892 EXPECT_CALL(observer, OnUntrustedLoginUIShown()) |
894 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 893 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
895 | 894 |
896 ExecuteJsToSigninInSigninFrame(browser(), "email@gmail.com", "password"); | 895 ExecuteJsToSigninInSigninFrame(browser(), "email@gmail.com", "password"); |
897 run_loop.Run(); | 896 run_loop.Run(); |
898 base::MessageLoop::current()->RunUntilIdle(); | 897 base::MessageLoop::current()->RunUntilIdle(); |
899 } | 898 } |
900 #endif // OS_CHROMEOS | 899 #endif // OS_CHROMEOS |
OLD | NEW |