Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual void TearDownOnMainThread() OVERRIDE { | 49 virtual void TearDownOnMainThread() OVERRIDE { |
| 50 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
| 51 // TODO(phoglund): this is a ugly workaround to let the IO thread | 51 // TODO(phoglund): this is a ugly workaround to let the IO thread |
| 52 // finish its work. The reason we need this on Android is that | 52 // finish its work. The reason we need this on Android is that |
| 53 // content_browsertests tearDown logic is broken with respect | 53 // content_browsertests tearDown logic is broken with respect |
| 54 // to threading, which causes the IO thread to compete with the | 54 // to threading, which causes the IO thread to compete with the |
| 55 // teardown. See http://crbug.com/362852. I also tried with 2 | 55 // teardown. See http://crbug.com/362852. I also tried with 2 |
| 56 // seconds, but that isn't enough. | 56 // seconds, but that isn't enough. |
| 57 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(5)); | 57 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(5)); |
|
mcasas
2014/05/09 07:46:24
nit: justify paragraph (to 80col).
perkj_chrome
2014/05/13 11:05:56
this does not belong to my cl. Its Phoglunds.. Not
| |
| 58 #endif | 58 #endif |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Convenience function since most peerconnection-call.html tests just load | 61 // Convenience function since most peerconnection-call.html tests just load |
| 62 // the page, kick off some javascript and wait for the title to change to OK. | 62 // the page, kick off some javascript and wait for the title to change to OK. |
| 63 void MakeTypicalPeerConnectionCall(const std::string& javascript) { | 63 void MakeTypicalPeerConnectionCall(const std::string& javascript) { |
| 64 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 64 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 65 | 65 |
| 66 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 66 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
| 67 NavigateToURL(shell(), url); | 67 NavigateToURL(shell(), url); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 98 "callAndExpectResolution({video: true}, 640, 480);"); | 98 "callAndExpectResolution({video: true}, 640, 480);"); |
| 99 } | 99 } |
| 100 | 100 |
| 101 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, CanSetupVideoCallWith1To1AspecRatio) { | 101 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, CanSetupVideoCallWith1To1AspecRatio) { |
| 102 const std::string javascript = | 102 const std::string javascript = |
| 103 "callAndExpectResolution({video: {mandatory: {minWidth: 320," | 103 "callAndExpectResolution({video: {mandatory: {minWidth: 320," |
| 104 " maxWidth: 320, minHeight: 320, maxHeight: 320}}}, 320, 320);"; | 104 " maxWidth: 320, minHeight: 320, maxHeight: 320}}}, 320, 320);"; |
| 105 MakeTypicalPeerConnectionCall(javascript); | 105 MakeTypicalPeerConnectionCall(javascript); |
| 106 } | 106 } |
| 107 | 107 |
| 108 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, | |
| 109 CanSetupVideoCallWith16To9AspecRatio) { | |
| 110 const std::string javascript = | |
| 111 "callAndExpectResolution({video: {mandatory: {minWidth: 640," | |
| 112 " maxWidth: 640, minAspectRatio: 1.7777}}}, 640, 360);"; | |
| 113 MakeTypicalPeerConnectionCall(javascript); | |
| 114 } | |
| 115 | |
| 116 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, | |
| 117 CanSetupVideoCallWith4To3AspecRatio) { | |
| 118 const std::string javascript = | |
| 119 "callAndExpectResolution({video: {mandatory: {minWidth: 960," | |
| 120 "maxAspectRatio: 1.333}}}, 960, 720);"; | |
| 121 MakeTypicalPeerConnectionCall(javascript); | |
|
mcasas
2014/05/09 07:46:24
ultra-nit: Three decimals here and four for 16:9,
perkj_chrome
2014/05/13 11:05:56
done
| |
| 122 } | |
| 123 | |
| 108 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) | 124 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) |
| 109 // Timing out on ARM linux, see http://crbug.com/240376 | 125 // Timing out on ARM linux, see http://crbug.com/240376 |
| 110 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall | 126 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall |
| 111 #else | 127 #else |
| 112 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall | 128 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall |
| 113 #endif | 129 #endif |
| 114 | 130 |
| 115 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) { | 131 IN_PROC_BROWSER_TEST_P(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) { |
| 116 MakeTypicalPeerConnectionCall("call({video: true, audio: true});"); | 132 MakeTypicalPeerConnectionCall("call({video: true, audio: true});"); |
| 117 } | 133 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 | 439 |
| 424 EXPECT_TRUE(base::PathExists(dump_file)); | 440 EXPECT_TRUE(base::PathExists(dump_file)); |
| 425 int64 file_size = 0; | 441 int64 file_size = 0; |
| 426 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); | 442 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); |
| 427 EXPECT_EQ(0, file_size); | 443 EXPECT_EQ(0, file_size); |
| 428 | 444 |
| 429 base::DeleteFile(dump_file, false); | 445 base::DeleteFile(dump_file, false); |
| 430 } | 446 } |
| 431 | 447 |
| 432 } // namespace content | 448 } // namespace content |
| OLD | NEW |