| OLD | NEW |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Sessions to load. | 61 // Sessions to load. |
| 62 const char kNoSessionToLoad[] = ""; | 62 const char kNoSessionToLoad[] = ""; |
| 63 const char kLoadableSession[] = "LoadableSession"; | 63 const char kLoadableSession[] = "LoadableSession"; |
| 64 const char kUnknownSession[] = "UnknownSession"; | 64 const char kUnknownSession[] = "UnknownSession"; |
| 65 | 65 |
| 66 // EME-specific test results and errors. | 66 // EME-specific test results and errors. |
| 67 const char kFileIOTestSuccess[] = "FILE_IO_TEST_SUCCESS"; | 67 const char kFileIOTestSuccess[] = "FILE_IO_TEST_SUCCESS"; |
| 68 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 68 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
| 69 const char kEmeGenerateRequestFailed[] = "EME_GENERATEREQUEST_FAILED"; | 69 const char kEmeGenerateRequestFailed[] = "EME_GENERATEREQUEST_FAILED"; |
| 70 const char kEmeSessionNotFound[] = "EME_SESSION_NOT_FOUND"; |
| 70 const char kEmeLoadFailed[] = "EME_LOAD_FAILED"; | 71 const char kEmeLoadFailed[] = "EME_LOAD_FAILED"; |
| 71 const char kEmeUpdateFailed[] = "EME_UPDATE_FAILED"; | 72 const char kEmeUpdateFailed[] = "EME_UPDATE_FAILED"; |
| 72 const char kEmeErrorEvent[] = "EME_ERROR_EVENT"; | 73 const char kEmeErrorEvent[] = "EME_ERROR_EVENT"; |
| 73 const char kEmeMessageUnexpectedType[] = "EME_MESSAGE_UNEXPECTED_TYPE"; | 74 const char kEmeMessageUnexpectedType[] = "EME_MESSAGE_UNEXPECTED_TYPE"; |
| 74 const char kPrefixedEmeRenewalMissingHeader[] = | 75 const char kPrefixedEmeRenewalMissingHeader[] = |
| 75 "PREFIXED_EME_RENEWAL_MISSING_HEADER"; | 76 "PREFIXED_EME_RENEWAL_MISSING_HEADER"; |
| 76 const char kPrefixedEmeErrorEvent[] = "PREFIXED_EME_ERROR_EVENT"; | 77 const char kPrefixedEmeErrorEvent[] = "PREFIXED_EME_ERROR_EVENT"; |
| 77 | 78 |
| 78 const char kDefaultEmePlayer[] = "eme_player.html"; | 79 const char kDefaultEmePlayer[] = "eme_player.html"; |
| 79 | 80 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 237 |
| 237 protected: | 238 protected: |
| 238 scoped_ptr<TestLicenseServer> license_server_; | 239 scoped_ptr<TestLicenseServer> license_server_; |
| 239 | 240 |
| 240 // We want to fail quickly when a test fails because an error is encountered. | 241 // We want to fail quickly when a test fails because an error is encountered. |
| 241 void AddWaitForTitles(content::TitleWatcher* title_watcher) override { | 242 void AddWaitForTitles(content::TitleWatcher* title_watcher) override { |
| 242 MediaBrowserTest::AddWaitForTitles(title_watcher); | 243 MediaBrowserTest::AddWaitForTitles(title_watcher); |
| 243 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); | 244 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); |
| 244 title_watcher->AlsoWaitForTitle( | 245 title_watcher->AlsoWaitForTitle( |
| 245 base::ASCIIToUTF16(kEmeGenerateRequestFailed)); | 246 base::ASCIIToUTF16(kEmeGenerateRequestFailed)); |
| 247 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeSessionNotFound)); |
| 246 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeLoadFailed)); | 248 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeLoadFailed)); |
| 247 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeUpdateFailed)); | 249 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeUpdateFailed)); |
| 248 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeErrorEvent)); | 250 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeErrorEvent)); |
| 249 title_watcher->AlsoWaitForTitle( | 251 title_watcher->AlsoWaitForTitle( |
| 250 base::ASCIIToUTF16(kEmeMessageUnexpectedType)); | 252 base::ASCIIToUTF16(kEmeMessageUnexpectedType)); |
| 251 title_watcher->AlsoWaitForTitle( | 253 title_watcher->AlsoWaitForTitle( |
| 252 base::ASCIIToUTF16(kPrefixedEmeRenewalMissingHeader)); | 254 base::ASCIIToUTF16(kPrefixedEmeRenewalMissingHeader)); |
| 253 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kPrefixedEmeErrorEvent)); | 255 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kPrefixedEmeErrorEvent)); |
| 254 } | 256 } |
| 255 | 257 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { | 701 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { |
| 700 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, | 702 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem, |
| 701 kFileIOTestSuccess); | 703 kFileIOTestSuccess); |
| 702 } | 704 } |
| 703 | 705 |
| 704 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { | 706 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
| 705 TestPlaybackCase(kLoadableSession, kEnded); | 707 TestPlaybackCase(kLoadableSession, kEnded); |
| 706 } | 708 } |
| 707 | 709 |
| 708 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { | 710 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { |
| 709 // TODO(jrummell): Load should not fail -- it should return false instead. | 711 TestPlaybackCase(kUnknownSession, kEmeSessionNotFound); |
| 710 // http://crbug.com/507736 | |
| 711 TestPlaybackCase(kUnknownSession, kEmeLoadFailed); | |
| 712 } | 712 } |
| 713 | 713 |
| 714 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, InitializeCDMFail) { | 714 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, InitializeCDMFail) { |
| 715 TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem, | 715 TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem, |
| 716 kPrefixedEmeErrorEvent); | 716 kPrefixedEmeErrorEvent); |
| 717 } | 717 } |
| 718 | 718 |
| 719 // When CDM crashes, we should still get a decode error. | 719 // When CDM crashes, we should still get a decode error. |
| 720 // crbug.com/386657 | 720 // crbug.com/386657 |
| 721 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, | 721 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 740 } | 740 } |
| 741 | 741 |
| 742 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) { | 742 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) { |
| 743 TestPlaybackCase(kLoadableSession, kEnded); | 743 TestPlaybackCase(kLoadableSession, kEnded); |
| 744 } | 744 } |
| 745 | 745 |
| 746 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) { | 746 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) { |
| 747 TestPlaybackCase(kUnknownSession, kPrefixedEmeErrorEvent); | 747 TestPlaybackCase(kUnknownSession, kPrefixedEmeErrorEvent); |
| 748 } | 748 } |
| 749 #endif // defined(ENABLE_PEPPER_CDMS) | 749 #endif // defined(ENABLE_PEPPER_CDMS) |
| OLD | NEW |