summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-11 14:57:00 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-11 14:57:00 +0000
commit7a3093d85ebf48a90848be175d6a12fca9ccc78d (patch)
treeab238394d9bdded6011a953f5aa8ffdc07c5a971 /content/common
parent96daf0584a4a2a93ddef7cd1236981a196d19043 (diff)
downloadchromium_src-7a3093d85ebf48a90848be175d6a12fca9ccc78d.zip
chromium_src-7a3093d85ebf48a90848be175d6a12fca9ccc78d.tar.gz
chromium_src-7a3093d85ebf48a90848be175d6a12fca9ccc78d.tar.bz2
Revert 263216 "Remove the assertion decode time > 0 from the test."
Broke ChromiumOS (amd64) Build: http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28amd64%29/builds/15406 chromeos-chrome-36.0.1936.0_alpha-r1: FAILED: x86_64-cros-linux-gnu-g++ -B/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.22-gold -MMD -MF obj/content/common/gpu/media/video_decode_accelerator_unittest.video_decode_accelerator_unittest.o.d [...] chromeos-chrome-36.0.1936.0_alpha-r1: ../../../../../../../home/chrome-bot/chrome_root/src/content/common/gpu/media/video_decode_accelerator_unittest.cc: In member function 'virtual void content::{anonymous}::VideoDecodeAcceleratorTest_TestDecodeTimeMedian_Test::TestBody()': chromeos-chrome-36.0.1936.0_alpha-r1: ../../../../../../../home/chrome-bot/chrome_root/src/content/common/gpu/media/video_decode_accelerator_unittest.cc:1514:73: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int64 {aka long int}' [-Werror=format=] chromeos-chrome-36.0.1936.0_alpha-r1: "Decode time median: %lld us", decode_time_median.InMicroseconds()); > Remove the assertion decode time > 0 from the test. > > The decode time per frame can be less than 1 millisecond and > TimeDelta::InMilliseconds will round it to 0. Remove the > assertion to fix it. Also change the unit to microseconds. > > BUG=358983 > TEST=Run the test on CrOS. > > Review URL: https://codereview.chromium.org/230553002 TBR=wuchengli@chromium.org Review URL: https://codereview.chromium.org/234603005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/media/video_decode_accelerator_unittest.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index a8e4ee8..01fcd26 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -407,8 +407,8 @@ class GLRenderingVDAClient
int num_queued_fragments() { return num_queued_fragments_; }
int num_decoded_frames();
double frames_per_second();
- // Return the median of the decode time of all decoded frames.
- base::TimeDelta decode_time_median();
+ // Return the median of the decode time in milliseconds.
+ int decode_time_median();
bool decoder_deleted() { return !decoder_.get(); }
private:
@@ -950,15 +950,15 @@ double GLRenderingVDAClient::frames_per_second() {
return num_decoded_frames() / delta.InSecondsF();
}
-base::TimeDelta GLRenderingVDAClient::decode_time_median() {
+int GLRenderingVDAClient::decode_time_median() {
if (decode_time_.size() == 0)
- return base::TimeDelta();
+ return 0;
std::sort(decode_time_.begin(), decode_time_.end());
int index = decode_time_.size() / 2;
if (decode_time_.size() % 2 != 0)
- return decode_time_[index];
+ return decode_time_[index].InMilliseconds();
- return (decode_time_[index] + decode_time_[index - 1]) / 2;
+ return (decode_time_[index] + decode_time_[index - 1]).InMilliseconds() / 2;
}
class VideoDecodeAcceleratorTest : public ::testing::Test {
@@ -1509,10 +1509,11 @@ TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) {
CreateAndStartDecoder(client, note);
WaitUntilDecodeFinish(note);
- base::TimeDelta decode_time_median = client->decode_time_median();
- std::string output_string = base::StringPrintf(
- "Decode time median: %lld us", decode_time_median.InMicroseconds());
+ int decode_time_median = client->decode_time_median();
+ std::string output_string =
+ base::StringPrintf("Decode time median: %d ms", decode_time_median);
VLOG(0) << output_string;
+ ASSERT_GT(decode_time_median, 0);
if (g_output_log != NULL)
OutputLogFile(g_output_log, output_string);
@@ -1550,8 +1551,9 @@ int main(int argc, char **argv) {
content::g_test_video_data = it->second.c_str();
continue;
}
- // The output log for VDA performance test.
- if (it->first == "output_log") {
+ // TODO(wuchengli): remove frame_deliver_log after CrOS test get updated.
+ // See http://crosreview.com/175426.
+ if (it->first == "frame_delivery_log" || it->first == "output_log") {
content::g_output_log = it->second.c_str();
continue;
}