| 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 "webkit/media/crypto/proxy_decryptor.h" | 5 #include "webkit/media/crypto/proxy_decryptor.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 EXPECT_CALL(client_, NeedKeyMock("", "", NotNull(), arraysize(kFakeKeyId))) | 207 EXPECT_CALL(client_, NeedKeyMock("", "", NotNull(), arraysize(kFakeKeyId))) |
| 208 .Times(AtLeast(1)); | 208 .Times(AtLeast(1)); |
| 209 EXPECT_CALL(*real_decryptor_, Decrypt(encrypted_buffer_, _)) | 209 EXPECT_CALL(*real_decryptor_, Decrypt(encrypted_buffer_, _)) |
| 210 .WillRepeatedly(RunDecryptCB(Decryptor::kNoKey, null_buffer_)); | 210 .WillRepeatedly(RunDecryptCB(Decryptor::kNoKey, null_buffer_)); |
| 211 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); | 211 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); |
| 212 GenerateKeyRequest(); | 212 GenerateKeyRequest(); |
| 213 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); | 213 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); |
| 214 AddKey(); // An irrelevant key is added. | 214 AddKey(); // An irrelevant key is added. |
| 215 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); | 215 proxy_decryptor_.Decrypt(encrypted_buffer_, decrypt_cb_); |
| 216 | 216 |
| 217 EXPECT_CALL(*real_decryptor_, Stop()); | 217 EXPECT_CALL(*real_decryptor_, CancelDecrypt()); |
| 218 EXPECT_CALL(*this, BufferDecrypted(Decryptor::kError, null_buffer_)) | 218 EXPECT_CALL(*this, BufferDecrypted(Decryptor::kError, null_buffer_)) |
| 219 .Times(3); | 219 .Times(3); |
| 220 proxy_decryptor_.Stop(); | 220 proxy_decryptor_.CancelDecrypt(); |
| 221 | 221 |
| 222 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 222 message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 223 message_loop_.Run(); | 223 message_loop_.Run(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace webkit_media | 226 } // namespace webkit_media |
| OLD | NEW |