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

Side by Side Diff: content/browser/media/webrtc_browsertest.cc

Issue 311943002: Same shutdown process for content_browsertests on android/non android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another merge attempt. Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/browser/media/webrtc_internals.h" 10 #include "content/browser/media/webrtc_internals.h"
(...skipping 29 matching lines...) Expand all
40 virtual ~WebRtcBrowserTest() {} 40 virtual ~WebRtcBrowserTest() {}
41 41
42 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 42 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
43 WebRtcContentBrowserTest::SetUpCommandLine(command_line); 43 WebRtcContentBrowserTest::SetUpCommandLine(command_line);
44 44
45 bool enable_audio_track_processing = GetParam(); 45 bool enable_audio_track_processing = GetParam();
46 if (!enable_audio_track_processing) 46 if (!enable_audio_track_processing)
47 command_line->AppendSwitch(switches::kDisableAudioTrackProcessing); 47 command_line->AppendSwitch(switches::kDisableAudioTrackProcessing);
48 } 48 }
49 49
50 virtual void TearDownOnMainThread() OVERRIDE {
51 #if defined(OS_ANDROID)
52 // TODO(phoglund): this is a ugly workaround to let the IO thread
53 // finish its work. The reason we need this on Android is that
54 // content_browsertests tearDown logic is broken with respect
55 // to threading, which causes the IO thread to compete with the
56 // teardown. See http://crbug.com/362852. I also tried with 2
57 // seconds, but that isn't enough.
58 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(5));
59 #endif
60 }
61
62 // Convenience function since most peerconnection-call.html tests just load 50 // Convenience function since most peerconnection-call.html tests just load
63 // the page, kick off some javascript and wait for the title to change to OK. 51 // the page, kick off some javascript and wait for the title to change to OK.
64 void MakeTypicalPeerConnectionCall(const std::string& javascript) { 52 void MakeTypicalPeerConnectionCall(const std::string& javascript) {
65 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 53 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
66 54
67 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 55 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
68 NavigateToURL(shell(), url); 56 NavigateToURL(shell(), url);
69 57
70 DisableOpusIfOnAndroid(); 58 DisableOpusIfOnAndroid();
71 ExecuteJavascriptAndWaitForOk(javascript); 59 ExecuteJavascriptAndWaitForOk(javascript);
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 450
463 EXPECT_TRUE(base::PathExists(dump_file)); 451 EXPECT_TRUE(base::PathExists(dump_file));
464 int64 file_size = 0; 452 int64 file_size = 0;
465 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 453 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
466 EXPECT_EQ(0, file_size); 454 EXPECT_EQ(0, file_size);
467 455
468 base::DeleteFile(dump_file, false); 456 base::DeleteFile(dump_file, false);
469 } 457 }
470 458
471 } // namespace content 459 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | content/common/gpu/media/gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698