Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(657)

Unified Diff: ios/web/public/test/fakes/test_web_state_delegate.mm

Issue 2737353006: Replaced webPageOrderedClose with WebStateDelegate API. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/public/test/fakes/test_web_state_delegate.mm
diff --git a/ios/web/public/test/fakes/test_web_state_delegate.mm b/ios/web/public/test/fakes/test_web_state_delegate.mm
index 8263400e0778cacc73ef5c860e9d0ad4795dff76..1badaf5d42d6e05140fd40c18b441d15bf217929 100644
--- a/ios/web/public/test/fakes/test_web_state_delegate.mm
+++ b/ios/web/public/test/fakes/test_web_state_delegate.mm
@@ -64,6 +64,19 @@ WebState* TestWebStateDelegate::CreateNewWebState(WebState* source,
return child_windows_.back().get();
}
+void TestWebStateDelegate::CloseWebState(WebState* source) {
+ last_close_web_state_request_ = base::MakeUnique<TestCloseWebStateRequest>();
+ last_close_web_state_request_->web_state = source;
+
+ // Remove WebState from |child_windows_|.
+ for (size_t i = 0; i < child_windows_.size(); i++) {
+ if (child_windows_[i].get() == source) {
+ child_windows_.erase(child_windows_.begin() + i);
rohitrao (ping after 24h) 2017/03/13 12:30:02 If the WebState is owned by child_windows_, we des
Eugene But (OOO till 7-30) 2017/03/14 01:20:24 Good catch. Fixed by having |closed_child_windows_
+ break;
+ }
+ }
+}
+
WebState* TestWebStateDelegate::OpenURLFromWebState(
WebState* web_state,
const WebState::OpenURLParams& params) {

Powered by Google App Engine
This is Rietveld 408576698