| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 16 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 17 #include "chrome/browser/chromeos/login/test/https_forwarder.h" | 17 #include "chrome/browser/chromeos/login/test/https_forwarder.h" |
| 18 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 18 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| 19 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | |
| 20 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 19 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 21 #include "chrome/browser/chromeos/login/users/user_manager.h" | 20 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 22 #include "chrome/browser/chromeos/login/wizard_controller.h" | 21 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 23 #include "chrome/browser/lifetime/application_lifetime.h" | 22 #include "chrome/browser/lifetime/application_lifetime.h" |
| 23 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/test/base/in_process_browser_test.h" | 26 #include "chrome/test/base/in_process_browser_test.h" |
| 27 #include "chromeos/chromeos_switches.h" | 27 #include "chromeos/chromeos_switches.h" |
| 28 #include "components/policy/core/browser/browser_policy_connector.h" | 28 #include "components/policy/core/browser/browser_policy_connector.h" |
| 29 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 29 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 30 #include "components/policy/core/common/policy_map.h" | 30 #include "components/policy/core/common/policy_map.h" |
| 31 #include "components/policy/core/common/policy_types.h" | 31 #include "components/policy/core/common/policy_types.h" |
| 32 #include "components/user_manager/user.h" | 32 #include "components/user_manager/user.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return error_message; | 378 return error_message; |
| 379 } | 379 } |
| 380 | 380 |
| 381 content::WebUI* GetLoginUI() { | 381 content::WebUI* GetLoginUI() { |
| 382 return static_cast<LoginDisplayHostImpl*>( | 382 return static_cast<LoginDisplayHostImpl*>( |
| 383 LoginDisplayHostImpl::default_host())->GetOobeUI()->web_ui(); | 383 LoginDisplayHostImpl::default_host())->GetOobeUI()->web_ui(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 // Executes JavaScript code in the auth iframe hosted by gaia_auth extension. | 386 // Executes JavaScript code in the auth iframe hosted by gaia_auth extension. |
| 387 void ExecuteJsInSigninFrame(const std::string& js) { | 387 void ExecuteJsInSigninFrame(const std::string& js) { |
| 388 content::RenderFrameHost* frame = | 388 content::RenderFrameHost* frame = InlineLoginUI::GetAuthIframe( |
| 389 LoginDisplayHostImpl::GetGaiaAuthIframe(GetLoginUI()->GetWebContents()); | 389 GetLoginUI()->GetWebContents(), GURL(), "signin-frame"); |
| 390 ASSERT_TRUE(content::ExecuteScript(frame, js)); | 390 ASSERT_TRUE(content::ExecuteScript(frame, js)); |
| 391 } | 391 } |
| 392 | 392 |
| 393 FakeSamlIdp* fake_saml_idp() { return &fake_saml_idp_; } | 393 FakeSamlIdp* fake_saml_idp() { return &fake_saml_idp_; } |
| 394 | 394 |
| 395 protected: | 395 protected: |
| 396 scoped_ptr<content::WindowedNotificationObserver> login_screen_load_observer_; | 396 scoped_ptr<content::WindowedNotificationObserver> login_screen_load_observer_; |
| 397 | 397 |
| 398 private: | 398 private: |
| 399 FakeGaia fake_gaia_; | 399 FakeGaia fake_gaia_; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 // Verifies that when the offline login time limit is exceeded for a user who | 736 // Verifies that when the offline login time limit is exceeded for a user who |
| 737 // authenticated via SAML, that user is forced to log in online the next time. | 737 // authenticated via SAML, that user is forced to log in online the next time. |
| 738 IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLZeroLimit) { | 738 IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, SAMLZeroLimit) { |
| 739 login_screen_load_observer_->Wait(); | 739 login_screen_load_observer_->Wait(); |
| 740 // Verify that offline login is not allowed. | 740 // Verify that offline login is not allowed. |
| 741 JsExpect("window.getComputedStyle(document.querySelector(" | 741 JsExpect("window.getComputedStyle(document.querySelector(" |
| 742 " '#pod-row .signin-button-container')).display != 'none'"); | 742 " '#pod-row .signin-button-container')).display != 'none'"); |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace chromeos | 745 } // namespace chromeos |
| OLD | NEW |