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

Unified Diff: content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc

Issue 2193803002: Enable IO in WebRtcAudioDebugRecordingsBrowserTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc
diff --git a/content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc b/content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc
index 92054988cba7d81017c64d54a94631a0e54d11ba..e1f07ae3bbac0bb032745d4be88a573f14ae0941 100644
--- a/content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc
+++ b/content/browser/media/webrtc/webrtc_audio_debug_recordings_browsertest.cc
@@ -7,7 +7,6 @@
#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
-#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "content/browser/media/webrtc/webrtc_internals.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -97,6 +96,7 @@ class WebRtcAudioDebugRecordingsBrowserTest : public WebRtcContentBrowserTest {
// never a webrtc-internals page opened at all since that's not needed.
IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
MAYBE_CallWithAudioDebugRecordings) {
+ bool prev = base::ThreadRestrictions::SetIOAllowed(true);
tommi (sloooow) - chröme 2016/07/29 17:17:33 Use ScopedAllowIO?
if (!media::AudioManager::Get()->HasAudioOutputDevices()) {
LOG(INFO) << "Missing output devices: skipping test...";
return;
@@ -144,6 +144,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
EXPECT_GT(file_size, 0);
base::DeleteFile(input_audio_file, false);
+ base::ThreadRestrictions::SetIOAllowed(prev);
}
// TODO(grunell): Add test for multiple dumps when re-use of
@@ -163,6 +164,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
// be created, but should be empty.
IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
MAYBE_CallWithAudioDebugRecordingsEnabledThenDisabled) {
+ bool prev = base::ThreadRestrictions::SetIOAllowed(true);
if (!media::AudioManager::Get()->HasAudioOutputDevices()) {
LOG(INFO) << "Missing output devices: skipping test...";
return;
@@ -174,11 +176,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
NavigateToURL(shell(), GURL(""));
base::FilePath base_file;
- {
- base::ThreadRestrictions::ScopedAllowIO allow_io_for_creating_test_path;
- ASSERT_TRUE(CreateTemporaryFile(&base_file));
- base::DeleteFile(base_file, false);
- }
+ ASSERT_TRUE(CreateTemporaryFile(&base_file));
+ base::DeleteFile(base_file, false);
// This fakes the behavior of another open tab with webrtc-internals, and
// enabling AEC dump in that tab, then disabling it.
@@ -194,26 +193,22 @@ IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
base::FilePath aec_dump_file = GetExpectedAecDumpFileName(base_file,
render_process_id);
- {
- base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_verification;
- EXPECT_FALSE(base::PathExists(aec_dump_file));
- base::DeleteFile(aec_dump_file, false);
- }
+ EXPECT_FALSE(base::PathExists(aec_dump_file));
+ base::DeleteFile(aec_dump_file, false);
// Verify that the expected input audio file doesn't exist.
base::FilePath input_audio_file =
GetExpectedInputAudioFileName(base_file, render_process_id);
- {
- base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_verification;
- EXPECT_FALSE(base::PathExists(input_audio_file));
- base::DeleteFile(input_audio_file, false);
- }
+ EXPECT_FALSE(base::PathExists(input_audio_file));
+ base::DeleteFile(input_audio_file, false);
+ base::ThreadRestrictions::SetIOAllowed(prev);
}
// Timing out on ARM linux bot: http://crbug.com/238490
// Renderer crashes under Android ASAN: https://crbug.com/408496.
IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
DISABLED_TwoCallsWithAudioDebugRecordings) {
+ bool prev = base::ThreadRestrictions::SetIOAllowed(true);
if (!media::AudioManager::Get()->HasAudioOutputDevices()) {
LOG(INFO) << "Missing output devices: skipping test...";
return;
@@ -278,6 +273,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcAudioDebugRecordingsBrowserTest,
base::DeleteFile(input_audio_file, false);
}
+ base::ThreadRestrictions::SetIOAllowed(prev);
}
} // namespace content
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698