Commit f7632b4d authored by Makoto Shimazu's avatar Makoto Shimazu Committed by Commit Bot

Revert "Reland "[Cast MRP] Stop mirroring immediately when a the tab is closed.""

This reverts commit 8258fb07.

Reason for revert: The test seems to be still flaky. https://crbug.com/1123786

Original change's description:
> Reland "[Cast MRP] Stop mirroring immediately when a the tab is closed."
> 
> This is a reland of f51b93d7
> 
> Original change's description:
> > [Cast MRP] Stop mirroring immediately when a the tab is closed.
> > 
> > Bug: 1095764, b/159154368
> > Change-Id: I36829467e3a6477499c76ae0b15e110acba00c89
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346911
> > Reviewed-by: Yuri Wiitala <miu@chromium.org>
> > Commit-Queue: John Williams <jrw@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#803343}
> 
> Bug: 1095764
> Bug: b/159154368
> Change-Id: Ib3fbf021e10e48b3cb7289427ed130b01109a71d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388153
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Commit-Queue: Yuri Wiitala <miu@chromium.org>
> Auto-Submit: John Williams <jrw@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#804019}

TBR=miu@chromium.org,jrw@chromium.org

Change-Id: I39378cce3c1e9951fc4d10d64f535d44ca87832b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1095764, 1123786
Bug: b/159154368
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392224Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Commit-Queue: Makoto Shimazu <shimazu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804100}
parent e0f757a2
......@@ -20,7 +20,6 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "media/capture/mojom/video_capture.mojom.h"
#include "media/capture/mojom/video_capture_types.mojom.h"
#include "media/capture/video_capture_types.h"
......@@ -183,22 +182,6 @@ class CastMirroringServiceHostBrowserTest
host_.reset();
}
void CloseWebContents() {
TabStripModel* const tab_strip = browser()->tab_strip_model();
content::WebContents* const web_contents =
tab_strip->GetActiveWebContents();
content::WebContentsDestroyedWatcher watcher(web_contents);
// Add a new tab so the browser doesn't close.
AddBlankTabAndShow(browser());
EXPECT_CALL(*this, DidStop()).Times(1);
tab_strip->CloseWebContentsAt(
tab_strip->GetIndexOfWebContents(web_contents),
TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
watcher.Wait();
}
void RequestRefreshFrame() {
base::RunLoop run_loop;
EXPECT_CALL(*video_frame_receiver_, OnBufferReadyCall(_))
......@@ -272,11 +255,6 @@ IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, CaptureTabAudio) {
StopMirroring();
}
IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, TabClosed) {
StartTabMirroring();
CloseWebContents();
}
IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, TabIndicator) {
content::WebContents* const contents =
browser()->tab_strip_model()->GetActiveWebContents();
......
......@@ -15,10 +15,7 @@ MirroringService::MirroringService(
mojo::PendingReceiver<mojom::MirroringService> receiver,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: receiver_(this, std::move(receiver)),
io_task_runner_(std::move(io_task_runner)) {
receiver_.set_disconnect_handler(
base::BindOnce(&MirroringService::OnDisconnect, base::Unretained(this)));
}
io_task_runner_(std::move(io_task_runner)) {}
MirroringService::~MirroringService() = default;
......@@ -36,8 +33,4 @@ void MirroringService::Start(
std::move(inbound_channel), io_task_runner_);
}
void MirroringService::OnDisconnect() {
session_.reset();
}
} // namespace mirroring
......@@ -33,8 +33,6 @@ class COMPONENT_EXPORT(MIRRORING_SERVICE) MirroringService final
mojo::PendingReceiver<mojom::CastMessageChannel> inbound_channel)
override;
void OnDisconnect();
mojo::Receiver<mojom::MirroringService> receiver_;
const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
std::unique_ptr<Session> session_; // Current mirroring session.
......
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