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

Side by Side Diff: media/mojo/clients/mojo_cdm_unittest.cc

Issue 2589663003: mojo:: Rename mojo::GetProxy() to mojo::MakeRequest() (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder_unittest.cc ('k') | media/mojo/clients/mojo_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 : mojo_cdm_service_(base::MakeUnique<MojoCdmService>( 51 : mojo_cdm_service_(base::MakeUnique<MojoCdmService>(
52 mojo_cdm_service_context_.GetWeakPtr(), 52 mojo_cdm_service_context_.GetWeakPtr(),
53 &cdm_factory_)), 53 &cdm_factory_)),
54 cdm_binding_(mojo_cdm_service_.get()) {} 54 cdm_binding_(mojo_cdm_service_.get()) {}
55 55
56 virtual ~MojoCdmTest() {} 56 virtual ~MojoCdmTest() {}
57 57
58 void Initialize(const std::string& key_system, 58 void Initialize(const std::string& key_system,
59 ExpectedResult expected_result) { 59 ExpectedResult expected_result) {
60 mojom::ContentDecryptionModulePtr remote_cdm; 60 mojom::ContentDecryptionModulePtr remote_cdm;
61 auto cdm_request = mojo::GetProxy(&remote_cdm); 61 auto cdm_request = mojo::MakeRequest(&remote_cdm);
62 62
63 switch (expected_result) { 63 switch (expected_result) {
64 case SUCCESS: 64 case SUCCESS:
65 case FAILURE: 65 case FAILURE:
66 cdm_binding_.Bind(std::move(cdm_request)); 66 cdm_binding_.Bind(std::move(cdm_request));
67 break; 67 break;
68 case CONNECTION_ERROR: 68 case CONNECTION_ERROR:
69 cdm_request.ResetWithReason(0, "Request dropped for testing."); 69 cdm_request.ResetWithReason(0, "Request dropped for testing.");
70 break; 70 break;
71 } 71 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 TEST_F(MojoCdmTest, CloseSession_AfterConnectionError) { 209 TEST_F(MojoCdmTest, CloseSession_AfterConnectionError) {
210 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); 210 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId));
211 211
212 Initialize(kClearKeyKeySystem, SUCCESS); 212 Initialize(kClearKeyKeySystem, SUCCESS);
213 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); 213 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS);
214 ForceConnectionError(); 214 ForceConnectionError();
215 CloseSessionAndExpect(FAILURE); 215 CloseSessionAndExpect(FAILURE);
216 } 216 }
217 217
218 } // namespace media 218 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder_unittest.cc ('k') | media/mojo/clients/mojo_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698