OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "ios/web/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
6 | 6 |
7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/ios/ios_util.h" | 11 #include "base/ios/ios_util.h" |
12 #include "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
13 #import "base/test/ios/wait_util.h" | 13 #import "base/test/ios/wait_util.h" |
14 #import "ios/testing/ocmock_complex_type_helper.h" | 14 #import "ios/testing/ocmock_complex_type_helper.h" |
15 #include "ios/web/navigation/crw_session_controller.h" | 15 #import "ios/web/navigation/crw_session_controller.h" |
16 #include "ios/web/navigation/crw_session_entry.h" | 16 #import "ios/web/navigation/crw_session_entry.h" |
17 #include "ios/web/navigation/navigation_item_impl.h" | 17 #import "ios/web/navigation/navigation_item_impl.h" |
18 #import "ios/web/navigation/navigation_manager_impl.h" | 18 #import "ios/web/navigation/navigation_manager_impl.h" |
19 #include "ios/web/public/referrer.h" | 19 #include "ios/web/public/referrer.h" |
20 #import "ios/web/public/test/test_native_content.h" | 20 #import "ios/web/public/test/test_native_content.h" |
21 #import "ios/web/public/test/test_native_content_provider.h" | 21 #import "ios/web/public/test/test_native_content_provider.h" |
22 #import "ios/web/public/test/test_web_client.h" | 22 #import "ios/web/public/test/test_web_client.h" |
23 #include "ios/web/public/test/test_web_view_content_view.h" | 23 #import "ios/web/public/test/test_web_view_content_view.h" |
24 #import "ios/web/public/web_state/crw_web_controller_observer.h" | 24 #import "ios/web/public/web_state/crw_web_controller_observer.h" |
25 #import "ios/web/public/web_state/ui/crw_content_view.h" | 25 #import "ios/web/public/web_state/ui/crw_content_view.h" |
26 #import "ios/web/public/web_state/ui/crw_native_content.h" | 26 #import "ios/web/public/web_state/ui/crw_native_content.h" |
27 #import "ios/web/public/web_state/ui/crw_native_content_provider.h" | 27 #import "ios/web/public/web_state/ui/crw_native_content_provider.h" |
28 #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" | 28 #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" |
29 #include "ios/web/public/web_state/url_verification_constants.h" | 29 #include "ios/web/public/web_state/url_verification_constants.h" |
30 #include "ios/web/public/web_state/web_state_observer.h" | 30 #include "ios/web/public/web_state/web_state_observer.h" |
31 #import "ios/web/test/web_test_with_web_controller.h" | 31 #import "ios/web/test/web_test_with_web_controller.h" |
32 #import "ios/web/test/wk_web_view_crash_utils.h" | 32 #import "ios/web/test/wk_web_view_crash_utils.h" |
33 #include "ios/web/web_state/blocked_popup_info.h" | 33 #import "ios/web/web_state/blocked_popup_info.h" |
34 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" | 34 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
35 #import "ios/web/web_state/web_state_impl.h" | 35 #import "ios/web/web_state/web_state_impl.h" |
36 #import "ios/web/web_state/wk_web_view_security_util.h" | 36 #import "ios/web/web_state/wk_web_view_security_util.h" |
37 #import "net/base/mac/url_conversions.h" | 37 #import "net/base/mac/url_conversions.h" |
38 #include "net/ssl/ssl_info.h" | 38 #include "net/ssl/ssl_info.h" |
39 #include "net/test/cert_test_util.h" | 39 #include "net/test/cert_test_util.h" |
40 #include "net/test/test_data_directory.h" | 40 #include "net/test/test_data_directory.h" |
41 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
42 #include "testing/gtest_mac.h" | 42 #import "testing/gtest_mac.h" |
43 #include "third_party/ocmock/OCMock/OCMock.h" | 43 #include "third_party/ocmock/OCMock/OCMock.h" |
44 #include "third_party/ocmock/gtest_support.h" | 44 #include "third_party/ocmock/gtest_support.h" |
45 #include "third_party/ocmock/ocmock_extensions.h" | 45 #include "third_party/ocmock/ocmock_extensions.h" |
46 #include "ui/base/test/ios/ui_view_test_utils.h" | 46 #import "ui/base/test/ios/ui_view_test_utils.h" |
47 | 47 |
48 using web::NavigationManagerImpl; | 48 using web::NavigationManagerImpl; |
49 | 49 |
50 @interface CRWWebController (PrivateAPI) | 50 @interface CRWWebController (PrivateAPI) |
51 @property(nonatomic, readwrite) web::PageDisplayState pageDisplayState; | 51 @property(nonatomic, readwrite) web::PageDisplayState pageDisplayState; |
52 - (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem | 52 - (GURL)URLForHistoryNavigationFromItem:(web::NavigationItem*)fromItem |
53 toItem:(web::NavigationItem*)toItem; | 53 toItem:(web::NavigationItem*)toItem; |
54 @end | 54 @end |
55 | 55 |
56 // Used to mock CRWWebDelegate methods with C++ params. | 56 // Used to mock CRWWebDelegate methods with C++ params. |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 | 1095 |
1096 [web_controller() setDelegate:delegate]; | 1096 [web_controller() setDelegate:delegate]; |
1097 web::SimulateWKWebViewCrash(webView_); | 1097 web::SimulateWKWebViewCrash(webView_); |
1098 | 1098 |
1099 EXPECT_OCMOCK_VERIFY(delegate); | 1099 EXPECT_OCMOCK_VERIFY(delegate); |
1100 EXPECT_FALSE([web_controller() isViewAlive]); | 1100 EXPECT_FALSE([web_controller() isViewAlive]); |
1101 [web_controller() setDelegate:nil]; | 1101 [web_controller() setDelegate:nil]; |
1102 }; | 1102 }; |
1103 | 1103 |
1104 } // namespace | 1104 } // namespace |
OLD | NEW |