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

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

Issue 1043673002: Allow widevinecdmadapter to be built in Chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "chrome/browser/media/media_browsertest.h" 10 #include "chrome/browser/media/media_browsertest.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 const std::string& key_system, 176 const std::string& key_system,
177 SrcType src_type, 177 SrcType src_type,
178 EmeVersion eme_version) { 178 EmeVersion eme_version) {
179 std::string expected_title = kEnded; 179 std::string expected_title = kEnded;
180 if (!IsPlayBackPossible(key_system)) 180 if (!IsPlayBackPossible(key_system))
181 expected_title = kEmeKeyError; 181 expected_title = kEmeKeyError;
182 182
183 RunEncryptedMediaTest(kDefaultEmePlayer, media_file, media_type, key_system, 183 RunEncryptedMediaTest(kDefaultEmePlayer, media_file, media_type, key_system,
184 src_type, eme_version, kNoSessionToLoad, false, 184 src_type, eme_version, kNoSessionToLoad, false,
185 PlayTwice::NO, expected_title); 185 PlayTwice::NO, expected_title);
186 // Check KeyMessage received for all key systems. 186 if (expected_title == kEnded) {
ddorwin 2015/03/28 04:00:11 You shouldn't need this. Just make your stub retur
jrummell 2015/04/01 23:37:36 Done. With the stub changes a message event is gen
187 bool receivedKeyMessage = false; 187 // Check KeyMessage received for all key systems.
188 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( 188 bool receivedKeyMessage = false;
189 browser()->tab_strip_model()->GetActiveWebContents(), 189 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
190 "window.domAutomationController.send(" 190 browser()->tab_strip_model()->GetActiveWebContents(),
191 "document.querySelector('video').receivedKeyMessage);", 191 "window.domAutomationController.send("
192 &receivedKeyMessage)); 192 "document.querySelector('video').receivedKeyMessage);",
193 EXPECT_TRUE(receivedKeyMessage); 193 &receivedKeyMessage));
194 EXPECT_TRUE(receivedKeyMessage);
195 }
194 } 196 }
195 197
196 // Starts a license server if available for the |key_system| and adds a 198 // Starts a license server if available for the |key_system| and adds a
197 // 'licenseServerURL' query parameter to |query_params|. 199 // 'licenseServerURL' query parameter to |query_params|.
198 void StartLicenseServerIfNeeded(const std::string& key_system, 200 void StartLicenseServerIfNeeded(const std::string& key_system,
199 base::StringPairs* query_params) { 201 base::StringPairs* query_params) {
200 scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system); 202 scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system);
201 if (!config) 203 if (!config)
202 return; 204 return;
203 license_server_.reset(new TestLicenseServer(config.Pass())); 205 license_server_.reset(new TestLicenseServer(config.Pass()));
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 716
715 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) { 717 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) {
716 TestPlaybackCase(kLoadableSession, kEnded); 718 TestPlaybackCase(kLoadableSession, kEnded);
717 } 719 }
718 720
719 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) { 721 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) {
720 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. 722 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound.
721 TestPlaybackCase(kUnknownSession, kEmeKeyError); 723 TestPlaybackCase(kUnknownSession, kEmeKeyError);
722 } 724 }
723 #endif // defined(ENABLE_PEPPER_CDMS) 725 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698