| 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 "media/base/test_helpers.h" | 5 #include "media/base/test_helpers.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void WaitableMessageLoopEvent::RunAndWaitForStatus(PipelineStatus expected) { | 93 void WaitableMessageLoopEvent::RunAndWaitForStatus(PipelineStatus expected) { |
| 94 DCHECK(CalledOnValidThread()); | 94 DCHECK(CalledOnValidThread()); |
| 95 if (signaled_) { | 95 if (signaled_) { |
| 96 EXPECT_EQ(expected, status_); | 96 EXPECT_EQ(expected, status_); |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 | 99 |
| 100 run_loop_.reset(new base::RunLoop()); | 100 run_loop_.reset(new base::RunLoop()); |
| 101 base::Timer timer(false, false); | 101 base::OneShotTimer timer; |
| 102 timer.Start( | 102 timer.Start( |
| 103 FROM_HERE, timeout_, | 103 FROM_HERE, timeout_, |
| 104 base::Bind(&WaitableMessageLoopEvent::OnTimeout, base::Unretained(this))); | 104 base::Bind(&WaitableMessageLoopEvent::OnTimeout, base::Unretained(this))); |
| 105 | 105 |
| 106 run_loop_->Run(); | 106 run_loop_->Run(); |
| 107 EXPECT_TRUE(signaled_); | 107 EXPECT_TRUE(signaled_); |
| 108 EXPECT_EQ(expected, status_); | 108 EXPECT_EQ(expected, status_); |
| 109 run_loop_.reset(); | 109 run_loop_.reset(); |
| 110 } | 110 } |
| 111 | 111 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 int width = 0; | 277 int width = 0; |
| 278 int height = 0; | 278 int height = 0; |
| 279 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && | 279 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && |
| 280 pickle.ReadInt(&height); | 280 pickle.ReadInt(&height); |
| 281 return (success && header == kFakeVideoBufferHeader && | 281 return (success && header == kFakeVideoBufferHeader && |
| 282 width == config.coded_size().width() && | 282 width == config.coded_size().width() && |
| 283 height == config.coded_size().height()); | 283 height == config.coded_size().height()); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace media | 286 } // namespace media |
| OLD | NEW |