Commit d29735c6 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Switch mojo_audio_output_ipc_test.cc away from IOTaskRunnerTestingPlatformSupport

The original CL that moved this test file from content to Blink
needlessly replaced the previous uses of base::test::TaskEnvironment
by
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport>.
The replacement was needless because the
IOTaskRunnerTestingPlatformSupport instances are actually not used.

By removing them, code goes back to the original logic, since
content::SetUpBlinkTestEnvironment(), part of the 'blink_unittests'
bootstrap sequence does the same.

BUG=787254
R=guidou@chromium.org

Change-Id: I6c540874dabf771478f2d6efc4967b6ec020efc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363829
Commit-Queue: Antonio Gomes (GMT-4) <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802181}
parent 8391a62b
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/platform/testing/io_task_runner_testing_platform_support.h"
#include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/blink/renderer/platform/wtf/functional.h"
using testing::_; using testing::_;
...@@ -224,8 +223,6 @@ class MockDelegate : public media::AudioOutputIPCDelegate { ...@@ -224,8 +223,6 @@ class MockDelegate : public media::AudioOutputIPCDelegate {
} // namespace } // namespace
TEST(MojoAudioOutputIPC, AuthorizeWithoutFactory_CallsAuthorizedWithError) { TEST(MojoAudioOutputIPC, AuthorizeWithoutFactory_CallsAuthorizedWithError) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -247,8 +244,6 @@ TEST(MojoAudioOutputIPC, AuthorizeWithoutFactory_CallsAuthorizedWithError) { ...@@ -247,8 +244,6 @@ TEST(MojoAudioOutputIPC, AuthorizeWithoutFactory_CallsAuthorizedWithError) {
TEST(MojoAudioOutputIPC, TEST(MojoAudioOutputIPC,
CreateWithoutAuthorizationWithoutFactory_CallsAuthorizedWithError) { CreateWithoutAuthorizationWithoutFactory_CallsAuthorizedWithError) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
std::unique_ptr<media::AudioOutputIPC> ipc = std::unique_ptr<media::AudioOutputIPC> ipc =
...@@ -265,8 +260,6 @@ TEST(MojoAudioOutputIPC, ...@@ -265,8 +260,6 @@ TEST(MojoAudioOutputIPC,
} }
TEST(MojoAudioOutputIPC, DeviceAuthorized_Propagates) { TEST(MojoAudioOutputIPC, DeviceAuthorized_Propagates) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -290,8 +283,6 @@ TEST(MojoAudioOutputIPC, DeviceAuthorized_Propagates) { ...@@ -290,8 +283,6 @@ TEST(MojoAudioOutputIPC, DeviceAuthorized_Propagates) {
} }
TEST(MojoAudioOutputIPC, OnDeviceCreated_Propagates) { TEST(MojoAudioOutputIPC, OnDeviceCreated_Propagates) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -319,8 +310,6 @@ TEST(MojoAudioOutputIPC, OnDeviceCreated_Propagates) { ...@@ -319,8 +310,6 @@ TEST(MojoAudioOutputIPC, OnDeviceCreated_Propagates) {
TEST(MojoAudioOutputIPC, TEST(MojoAudioOutputIPC,
CreateWithoutAuthorization_RequestsAuthorizationFirst) { CreateWithoutAuthorization_RequestsAuthorizationFirst) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -348,8 +337,6 @@ TEST(MojoAudioOutputIPC, ...@@ -348,8 +337,6 @@ TEST(MojoAudioOutputIPC,
} }
TEST(MojoAudioOutputIPC, IsReusable) { TEST(MojoAudioOutputIPC, IsReusable) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -381,8 +368,6 @@ TEST(MojoAudioOutputIPC, IsReusable) { ...@@ -381,8 +368,6 @@ TEST(MojoAudioOutputIPC, IsReusable) {
} }
TEST(MojoAudioOutputIPC, IsReusableAfterError) { TEST(MojoAudioOutputIPC, IsReusableAfterError) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -436,8 +421,6 @@ TEST(MojoAudioOutputIPC, IsReusableAfterError) { ...@@ -436,8 +421,6 @@ TEST(MojoAudioOutputIPC, IsReusableAfterError) {
} }
TEST(MojoAudioOutputIPC, DeviceNotAuthorized_Propagates) { TEST(MojoAudioOutputIPC, DeviceNotAuthorized_Propagates) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -469,8 +452,6 @@ TEST(MojoAudioOutputIPC, ...@@ -469,8 +452,6 @@ TEST(MojoAudioOutputIPC,
// The authorization IPC message might be aborted by the remote end // The authorization IPC message might be aborted by the remote end
// disconnecting. In this case, the MojoAudioOutputIPC object must still // disconnecting. In this case, the MojoAudioOutputIPC object must still
// send a notification to unblock the AudioOutputIPCDelegate. // send a notification to unblock the AudioOutputIPCDelegate.
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -501,8 +482,6 @@ TEST(MojoAudioOutputIPC, ...@@ -501,8 +482,6 @@ TEST(MojoAudioOutputIPC,
// This test makes sure that the MojoAudioOutputIPC doesn't callback for // This test makes sure that the MojoAudioOutputIPC doesn't callback for
// authorization when the factory disconnects if it already got a callback // authorization when the factory disconnects if it already got a callback
// for authorization. // for authorization.
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
stream_factory.PrepareProviderForAuthorization( stream_factory.PrepareProviderForAuthorization(
...@@ -529,8 +508,6 @@ TEST(MojoAudioOutputIPC, ...@@ -529,8 +508,6 @@ TEST(MojoAudioOutputIPC,
} }
TEST(MojoAudioOutputIPC, AuthorizeNoClose_DCHECKs) { TEST(MojoAudioOutputIPC, AuthorizeNoClose_DCHECKs) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
...@@ -551,8 +528,6 @@ TEST(MojoAudioOutputIPC, AuthorizeNoClose_DCHECKs) { ...@@ -551,8 +528,6 @@ TEST(MojoAudioOutputIPC, AuthorizeNoClose_DCHECKs) {
} }
TEST(MojoAudioOutputIPC, CreateNoClose_DCHECKs) { TEST(MojoAudioOutputIPC, CreateNoClose_DCHECKs) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
StrictMock<MockDelegate> delegate; StrictMock<MockDelegate> delegate;
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -575,8 +550,6 @@ TEST(MojoAudioOutputIPC, CreateNoClose_DCHECKs) { ...@@ -575,8 +550,6 @@ TEST(MojoAudioOutputIPC, CreateNoClose_DCHECKs) {
} }
TEST(MojoAudioOutputIPC, Play_Plays) { TEST(MojoAudioOutputIPC, Play_Plays) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -605,8 +578,6 @@ TEST(MojoAudioOutputIPC, Play_Plays) { ...@@ -605,8 +578,6 @@ TEST(MojoAudioOutputIPC, Play_Plays) {
} }
TEST(MojoAudioOutputIPC, Pause_Pauses) { TEST(MojoAudioOutputIPC, Pause_Pauses) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
...@@ -635,8 +606,6 @@ TEST(MojoAudioOutputIPC, Pause_Pauses) { ...@@ -635,8 +606,6 @@ TEST(MojoAudioOutputIPC, Pause_Pauses) {
} }
TEST(MojoAudioOutputIPC, SetVolume_SetsVolume) { TEST(MojoAudioOutputIPC, SetVolume_SetsVolume) {
ScopedTestingPlatformSupport<IOTaskRunnerTestingPlatformSupport> platform;
TestRemoteFactory stream_factory; TestRemoteFactory stream_factory;
const base::UnguessableToken session_id = base::UnguessableToken::Create(); const base::UnguessableToken session_id = base::UnguessableToken::Create();
StrictMock<MockStream> stream; StrictMock<MockStream> stream;
......
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