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

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

Issue 128353002: Fixing WebRTC AEC dump tests on Android, disabling DTMF test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No longer double initializing the aec dump test server." Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/media/webrtc_aecdump_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event_impl.h" 6 #include "base/debug/trace_event_impl.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); 221 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
222 } 222 }
223 223
224 // Convenience function since most peerconnection-call.html tests just load 224 // Convenience function since most peerconnection-call.html tests just load
225 // the page, kick off some javascript and wait for the title to change to OK. 225 // the page, kick off some javascript and wait for the title to change to OK.
226 void MakeTypicalPeerConnectionCall(const std::string& javascript) { 226 void MakeTypicalPeerConnectionCall(const std::string& javascript) {
227 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 227 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
228 228
229 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 229 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
230 NavigateToURL(shell(), url); 230 NavigateToURL(shell(), url);
231 ExecuteTestAndWaitForOk(javascript);
232 }
231 233
234 void ExecuteTestAndWaitForOk(const std::string& javascript) {
232 #if defined (OS_ANDROID) 235 #if defined (OS_ANDROID)
233 // Always force iSAC 16K on Android for now (Opus is broken). 236 // Always force iSAC 16K on Android for now (Opus is broken).
234 ASSERT_TRUE(ExecuteJavascript("forceIsac16KInSdp();")); 237 ASSERT_TRUE(ExecuteJavascript("forceIsac16KInSdp();"));
235 #endif 238 #endif
236 239
237 ASSERT_TRUE(ExecuteJavascript(javascript)); 240 ASSERT_TRUE(ExecuteJavascript(javascript));
238 ExpectTitle("OK"); 241 ExpectTitle("OK");
239 } 242 }
240 }; 243 };
241 244
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 727
725 base::FilePath dump_file; 728 base::FilePath dump_file;
726 ASSERT_TRUE(CreateTemporaryFile(&dump_file)); 729 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
727 730
728 // This fakes the behavior of another open tab with webrtc-internals, and 731 // This fakes the behavior of another open tab with webrtc-internals, and
729 // enabling AEC dump in that tab. 732 // enabling AEC dump in that tab.
730 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL); 733 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
731 734
732 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 735 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
733 NavigateToURL(shell(), url); 736 NavigateToURL(shell(), url);
734 737 ExecuteTestAndWaitForOk("call({video: true, audio: true});");
735 EXPECT_TRUE(ExecuteJavascript("call({video: true, audio: true});"));
736 ExpectTitle("OK");
737 738
738 EXPECT_TRUE(base::PathExists(dump_file)); 739 EXPECT_TRUE(base::PathExists(dump_file));
739 int64 file_size = 0; 740 int64 file_size = 0;
740 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 741 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
741 EXPECT_GT(file_size, 0); 742 EXPECT_GT(file_size, 0);
742 743
743 base::DeleteFile(dump_file, false); 744 base::DeleteFile(dump_file, false);
744 } 745 }
745 746
746 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 747 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
(...skipping 15 matching lines...) Expand all
762 base::FilePath dump_file; 763 base::FilePath dump_file;
763 ASSERT_TRUE(CreateTemporaryFile(&dump_file)); 764 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
764 765
765 // This fakes the behavior of another open tab with webrtc-internals, and 766 // This fakes the behavior of another open tab with webrtc-internals, and
766 // enabling AEC dump in that tab, then disabling it. 767 // enabling AEC dump in that tab, then disabling it.
767 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL); 768 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
768 WebRTCInternals::GetInstance()->DisableAecDump(); 769 WebRTCInternals::GetInstance()->DisableAecDump();
769 770
770 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 771 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
771 NavigateToURL(shell(), url); 772 NavigateToURL(shell(), url);
772 773 ExecuteTestAndWaitForOk("call({video: true, audio: true});");
773 EXPECT_TRUE(ExecuteJavascript("call({video: true, audio: true});"));
774 ExpectTitle("OK");
775 774
776 EXPECT_TRUE(base::PathExists(dump_file)); 775 EXPECT_TRUE(base::PathExists(dump_file));
777 int64 file_size = 0; 776 int64 file_size = 0;
778 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); 777 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
779 EXPECT_EQ(0, file_size); 778 EXPECT_EQ(0, file_size);
780 779
781 base::DeleteFile(dump_file, false); 780 base::DeleteFile(dump_file, false);
782 } 781 }
783 782
784 783
785 } // namespace content 784 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/webrtc_aecdump_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698