Commit 09c68028 authored by Shengfa Lin's avatar Shengfa Lin Committed by Commit Bot

[chromedriver] Last tab close should trigger unload

When chromedriver closes the last tab, it should still trigger
unload event handler before calling quit. The expected behavior is
after closing the last tab via close webview, browser should be able
to process the unload events. After calling quit, the Cookies should
have been saved properly in user-data-dir/Default/Cookies.

Bug: chromedriver:3370,chromedriver:3635
Change-Id: Id00eaa516026106d2704b193957d418a56e8945f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518211Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Shengfa Lin <shengfa@google.com>
Cr-Commit-Position: refs/heads/master@{#823772}
parent ecb602d3
......@@ -712,16 +712,16 @@ Status ExecuteClose(Session* session,
return Status(kUnexpectedAlertOpen, "{Alert text : " + alert_text + "}");
}
if (!is_last_web_view) {
status = session->chrome->CloseWebView(web_view->GetId());
if (status.IsError())
return status;
status = session->chrome->CloseWebView(web_view->GetId());
if (status.IsError())
return status;
if (!is_last_web_view) {
status = ExecuteGetWindowHandles(session, base::DictionaryValue(), value);
if (status.IsError())
return status;
} else {
// If there is only one open window, close is the same as calling "quit".
// If there is only one window left, call quit as well.
session->quit = true;
status = session->chrome->Quit();
if (status.IsOk())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment