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

Unified Diff: media/remoting/remoting_controller_unittest.cc

Issue 2457563002: Media Remoting: Add remoting control logic for encrypted contents. (Closed)
Patch Set: Addressed comments from PS#12. Fixed ASAN. Created 4 years, 1 month 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
« no previous file with comments | « media/remoting/remoting_controller.cc ('k') | media/remoting/remoting_renderer_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/remoting_controller_unittest.cc
diff --git a/media/remoting/remoting_controller_unittest.cc b/media/remoting/remoting_controller_unittest.cc
deleted file mode 100644
index 214f1dc9a031323c963b9d945fa11b92731a89aa..0000000000000000000000000000000000000000
--- a/media/remoting/remoting_controller_unittest.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "media/remoting/remoting_controller.h"
-
-#include "base/callback.h"
-#include "base/message_loop/message_loop.h"
-#include "base/run_loop.h"
-#include "media/base/audio_decoder_config.h"
-#include "media/base/limits.h"
-#include "media/base/media_util.h"
-#include "media/base/video_decoder_config.h"
-#include "media/remoting/fake_remoting_controller.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace media {
-namespace {
-
-constexpr gfx::Size kCodedSize(320, 240);
-constexpr gfx::Rect kVisibleRect(320, 240);
-constexpr gfx::Size kNaturalSize(320, 240);
-
-PipelineMetadata defaultMetadata() {
- PipelineMetadata data;
- data.has_audio = true;
- data.has_video = true;
- data.video_decoder_config = VideoDecoderConfig(
- kCodecVP8, VP8PROFILE_ANY, VideoPixelFormat::PIXEL_FORMAT_I420,
- ColorSpace::COLOR_SPACE_SD_REC601, kCodedSize, kVisibleRect, kNaturalSize,
- EmptyExtraData(), Unencrypted());
- data.audio_decoder_config = AudioDecoderConfig(
- kCodecOpus, SampleFormat::kSampleFormatU8,
- ChannelLayout::CHANNEL_LAYOUT_MONO, limits::kMinSampleRate,
- EmptyExtraData(), Unencrypted());
- return data;
-}
-
-} // namespace
-
-class RemotingControllerTest : public ::testing::Test {
- public:
- RemotingControllerTest()
- : remoting_controller_(CreateRemotingController(false)),
- is_remoting_(false) {
- remoting_controller_->SetSwitchRendererCallback(base::Bind(
- &RemotingControllerTest::ToggleRenderer, base::Unretained(this)));
- }
- ~RemotingControllerTest() override {}
-
- void TearDown() final { RunUntilIdle(); }
-
- static void RunUntilIdle() { base::RunLoop().RunUntilIdle(); }
-
- void ToggleRenderer() { is_remoting_ = remoting_controller_->is_remoting(); }
-
- base::MessageLoop message_loop_;
-
- protected:
- std::unique_ptr<RemotingController> remoting_controller_;
- bool is_remoting_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(RemotingControllerTest);
-};
-
-TEST_F(RemotingControllerTest, ToggleRenderer) {
- EXPECT_FALSE(is_remoting_);
- remoting_controller_->OnSinkAvailable();
- remoting_controller_->OnEnteredFullscreen();
- EXPECT_FALSE(is_remoting_);
- remoting_controller_->OnMetadataChanged(defaultMetadata());
- RunUntilIdle();
- EXPECT_TRUE(is_remoting_);
- remoting_controller_->OnExitedFullscreen();
- RunUntilIdle();
- EXPECT_FALSE(is_remoting_);
-}
-
-TEST_F(RemotingControllerTest, StartFailed) {
- EXPECT_FALSE(is_remoting_);
- remoting_controller_ = CreateRemotingController(true);
- remoting_controller_->SetSwitchRendererCallback(base::Bind(
- &RemotingControllerTest::ToggleRenderer, base::Unretained(this)));
- remoting_controller_->OnSinkAvailable();
- remoting_controller_->OnEnteredFullscreen();
- remoting_controller_->OnMetadataChanged(defaultMetadata());
- RunUntilIdle();
- EXPECT_FALSE(is_remoting_);
-}
-
-} // namespace media
« no previous file with comments | « media/remoting/remoting_controller.cc ('k') | media/remoting/remoting_renderer_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698