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

Side by Side Diff: chrome/browser/media/encrypted_media_browsertest.cc

Issue 2857323002: Enable IO when starting the license server (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/threading/thread_restrictions.h"
12 #include "build/build_config.h" 13 #include "build/build_config.h"
13 #include "chrome/browser/media/media_browsertest.h" 14 #include "chrome/browser/media/media_browsertest.h"
14 #include "chrome/browser/media/test_license_server.h" 15 #include "chrome/browser/media/test_license_server.h"
15 #include "chrome/browser/media/wv_test_license_server_config.h" 16 #include "chrome/browser/media/wv_test_license_server_config.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 19 #include "chrome/browser/ui/tabs/tab_strip_model.h"
19 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
21 #include "chrome/test/base/test_launcher_utils.h" 22 #include "chrome/test/base/test_launcher_utils.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 215
215 // Starts a license server if available for the |key_system| and adds a 216 // Starts a license server if available for the |key_system| and adds a
216 // 'licenseServerURL' query parameter to |query_params|. 217 // 'licenseServerURL' query parameter to |query_params|.
217 void StartLicenseServerIfNeeded(const std::string& key_system, 218 void StartLicenseServerIfNeeded(const std::string& key_system,
218 base::StringPairs* query_params) { 219 base::StringPairs* query_params) {
219 std::unique_ptr<TestLicenseServerConfig> config = 220 std::unique_ptr<TestLicenseServerConfig> config =
220 GetServerConfig(key_system); 221 GetServerConfig(key_system);
221 if (!config) 222 if (!config)
222 return; 223 return;
223 license_server_.reset(new TestLicenseServer(std::move(config))); 224 license_server_.reset(new TestLicenseServer(std::move(config)));
224 EXPECT_TRUE(license_server_->Start()); 225 {
226 base::ThreadRestrictions::ScopedAllowIO allow_io;
227 EXPECT_TRUE(license_server_->Start());
228 }
225 query_params->push_back( 229 query_params->push_back(
226 std::make_pair("licenseServerURL", license_server_->GetServerURL())); 230 std::make_pair("licenseServerURL", license_server_->GetServerURL()));
227 } 231 }
228 232
229 bool IsPlayBackPossible(const std::string& key_system) { 233 bool IsPlayBackPossible(const std::string& key_system) {
230 #if defined(WIDEVINE_CDM_AVAILABLE) 234 #if defined(WIDEVINE_CDM_AVAILABLE)
231 if (IsWidevine(key_system) && !GetServerConfig(key_system)) 235 if (IsWidevine(key_system) && !GetServerConfig(key_system))
232 return false; 236 return false;
233 #endif // defined(WIDEVINE_CDM_AVAILABLE) 237 #endif // defined(WIDEVINE_CDM_AVAILABLE)
234 return true; 238 return true;
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) 743 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
740 744
741 #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) 745 #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
742 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, VerifyCdmHostTest) { 746 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, VerifyCdmHostTest) {
743 TestNonPlaybackCases(kExternalClearKeyVerifyCdmHostTestKeySystem, 747 TestNonPlaybackCases(kExternalClearKeyVerifyCdmHostTestKeySystem,
744 kUnitTestSuccess); 748 kUnitTestSuccess);
745 } 749 }
746 #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) 750 #endif // BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
747 751
748 } // namespace chrome 752 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698