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

Side by Side Diff: media/base/android/media_drm_bridge_unittest.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 7 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <memory>
6
5 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
6 #include "base/bind.h" 8 #include "base/bind.h"
7 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
9 #include "media/base/android/media_drm_bridge.h" 12 #include "media/base/android/media_drm_bridge.h"
10 #include "media/base/android/provision_fetcher.h" 13 #include "media/base/android/provision_fetcher.h"
11 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
12 15
13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 16 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
14 17
15 namespace media { 18 namespace media {
16 19
17 #define EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(a) \ 20 #define EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(a) \
(...skipping 22 matching lines...) Expand all
40 const std::string& key_system, 43 const std::string& key_system,
41 const std::string& container_mime_type) { 44 const std::string& container_mime_type) {
42 return MediaDrmBridge::IsKeySystemSupportedWithType(key_system, 45 return MediaDrmBridge::IsKeySystemSupportedWithType(key_system,
43 container_mime_type); 46 container_mime_type);
44 } 47 }
45 48
46 namespace { 49 namespace {
47 // Mock ProvisionFetcher. 50 // Mock ProvisionFetcher.
48 class MockProvisionFetcher : public ProvisionFetcher { 51 class MockProvisionFetcher : public ProvisionFetcher {
49 public: 52 public:
50 static scoped_ptr<ProvisionFetcher> Create() { 53 static std::unique_ptr<ProvisionFetcher> Create() {
51 return scoped_ptr<ProvisionFetcher>(new MockProvisionFetcher()); 54 return base::WrapUnique(new MockProvisionFetcher);
52 } 55 }
53 56
54 // ProvisionFetcher implementation. 57 // ProvisionFetcher implementation.
55 void Retrieve(const std::string& default_url, 58 void Retrieve(const std::string& default_url,
56 const std::string& request_data, 59 const std::string& request_data,
57 const ResponseCB& response_cb) override {} 60 const ResponseCB& response_cb) override {}
58 }; 61 };
59 62
60 } // namespace (anonymous) 63 } // namespace (anonymous)
61 64
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // We test "L3" fully. But for "L1" we don't check the result as it depends on 115 // We test "L3" fully. But for "L1" we don't check the result as it depends on
113 // whether the test device supports "L1". 116 // whether the test device supports "L1".
114 EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(MediaDrmBridge::CreateWithoutSessionSupport( 117 EXPECT_TRUE_IF_WIDEVINE_AVAILABLE(MediaDrmBridge::CreateWithoutSessionSupport(
115 kWidevineKeySystem, kL3, base::Bind(&MockProvisionFetcher::Create))); 118 kWidevineKeySystem, kL3, base::Bind(&MockProvisionFetcher::Create)));
116 119
117 MediaDrmBridge::CreateWithoutSessionSupport( 120 MediaDrmBridge::CreateWithoutSessionSupport(
118 kWidevineKeySystem, kL1, base::Bind(&MockProvisionFetcher::Create)); 121 kWidevineKeySystem, kL1, base::Bind(&MockProvisionFetcher::Create));
119 } 122 }
120 123
121 } // namespace media 124 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_drm_bridge_cdm_context.h ('k') | media/base/android/media_player_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698