| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/test/web_int_test.h" | 5 #import "ios/web/test/web_int_test.h" |
| 6 | 6 |
| 7 #import "base/ios/block_types.h" | 7 #import "base/ios/block_types.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #import "base/test/ios/wait_util.h" | 9 #import "base/test/ios/wait_util.h" |
| 10 #import "ios/web/public/test/http_server.h" | 10 #import "ios/web/public/test/http_server.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 observer_->ExpectPageLoad(url); | 97 observer_->ExpectPageLoad(url); |
| 98 block(); | 98 block(); |
| 99 base::test::ios::WaitUntilCondition(^bool { | 99 base::test::ios::WaitUntilCondition(^bool { |
| 100 return observer_->IsExpectedPageLoaded(); | 100 return observer_->IsExpectedPageLoaded(); |
| 101 }); | 101 }); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void WebIntTest::LoadUrl(const GURL& url) { | 104 void WebIntTest::LoadUrl(const GURL& url) { |
| 105 ExecuteBlockAndWaitForLoad(url, ^{ | 105 ExecuteBlockAndWaitForLoad(url, ^{ |
| 106 web::NavigationManager::WebLoadParams params(url); | 106 web::NavigationManager::WebLoadParams params(url); |
| 107 params.transition_type = ui::PageTransition::PAGE_TRANSITION_TYPED; |
| 107 navigation_manager()->LoadURLWithParams(params); | 108 navigation_manager()->LoadURLWithParams(params); |
| 108 }); | 109 }); |
| 109 } | 110 } |
| 110 | 111 |
| 111 void WebIntTest::RemoveWKWebViewCreatedData(WKWebsiteDataStore* data_store, | 112 void WebIntTest::RemoveWKWebViewCreatedData(WKWebsiteDataStore* data_store, |
| 112 NSSet* websiteDataTypes) { | 113 NSSet* websiteDataTypes) { |
| 113 __block bool data_removed = false; | 114 __block bool data_removed = false; |
| 114 | 115 |
| 115 ProceduralBlock remove_data = ^{ | 116 ProceduralBlock remove_data = ^{ |
| 116 [data_store removeDataOfTypes:websiteDataTypes | 117 [data_store removeDataOfTypes:websiteDataTypes |
| (...skipping 28 matching lines...) Expand all Loading... |
| 145 NSInteger WebIntTest::GetIndexOfNavigationItem( | 146 NSInteger WebIntTest::GetIndexOfNavigationItem( |
| 146 const web::NavigationItem* item) { | 147 const web::NavigationItem* item) { |
| 147 for (NSInteger i = 0; i < navigation_manager()->GetItemCount(); ++i) { | 148 for (NSInteger i = 0; i < navigation_manager()->GetItemCount(); ++i) { |
| 148 if (navigation_manager()->GetItemAtIndex(i) == item) | 149 if (navigation_manager()->GetItemAtIndex(i) == item) |
| 149 return i; | 150 return i; |
| 150 } | 151 } |
| 151 return NSNotFound; | 152 return NSNotFound; |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace web | 155 } // namespace web |
| OLD | NEW |