| 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/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/chromeos/login/login_manager_test.h" | 8 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 9 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h" | 9 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h" |
| 10 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" | 10 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" |
| 11 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 12 #include "chrome/browser/chromeos/login/ui/simple_web_view_dialog.h" | 12 #include "chrome/browser/chromeos/login/ui/simple_web_view_dialog.h" |
| 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 14 #include "content/public/browser/interstitial_page.h" | 14 #include "content/public/browser/interstitial_page.h" |
| 15 #include "content/public/browser/interstitial_page_delegate.h" | 15 #include "content/public/browser/interstitial_page_delegate.h" |
| 16 #include "ui/views/controls/webview/webview.h" | 16 #include "ui/views/controls/webview/webview.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 SimpleWebViewDialog* dialog = proxy->captive_portal_view_for_testing(); | 57 SimpleWebViewDialog* dialog = proxy->captive_portal_view_for_testing(); |
| 58 CHECK(dialog) << "CaptivePortalView is not initialized"; | 58 CHECK(dialog) << "CaptivePortalView is not initialized"; |
| 59 return new InterstitialPageDelegate(dialog->web_view_->web_contents()); | 59 return new InterstitialPageDelegate(dialog->web_view_->web_contents()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(SimpleWebViewDialogTest); | 63 DISALLOW_COPY_AND_ASSIGN(SimpleWebViewDialogTest); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 IN_PROC_BROWSER_TEST_F(SimpleWebViewDialogTest, Interstitial) { | 66 IN_PROC_BROWSER_TEST_F(SimpleWebViewDialogTest, Interstitial) { |
| 67 content::WebContents* web_contents = LoginDisplayHostImpl::default_host() | 67 content::WebContents* web_contents = |
| 68 ->GetWebUILoginView() | 68 LoginDisplayHost::default_host()->GetWebUILoginView()->GetWebContents(); |
| 69 ->GetWebContents(); | |
| 70 StubDelegate delegate; | 69 StubDelegate delegate; |
| 71 CaptivePortalWindowProxy proxy(&delegate, web_contents); | 70 CaptivePortalWindowProxy proxy(&delegate, web_contents); |
| 72 proxy.Show(); | 71 proxy.Show(); |
| 73 | 72 |
| 74 // Delegate creates a page and passes himself to it. Page owns the | 73 // Delegate creates a page and passes himself to it. Page owns the |
| 75 // delegate and will be destroyed by the end of the test. | 74 // delegate and will be destroyed by the end of the test. |
| 76 CreateDelegate(&proxy); | 75 CreateDelegate(&proxy); |
| 77 } | 76 } |
| 78 | 77 |
| 79 } // namespace chromeos | 78 } // namespace chromeos |
| OLD | NEW |