| OLD | NEW |
| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/scoped_native_library.h" | 8 #include "base/scoped_native_library.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Use the base name of the library to dynamically get the platform specific | 46 // Use the base name of the library to dynamically get the platform specific |
| 47 // name. See base::GetNativeLibraryName() for details. | 47 // name. See base::GetNativeLibraryName() for details. |
| 48 void MeasureSizeAndTimeToLoadNativeLibraryByBaseName( | 48 void MeasureSizeAndTimeToLoadNativeLibraryByBaseName( |
| 49 const std::string& base_library_name) { | 49 const std::string& base_library_name) { |
| 50 MeasureSizeAndTimeToLoadNativeLibrary(base::FilePath::FromUTF16Unsafe( | 50 MeasureSizeAndTimeToLoadNativeLibrary(base::FilePath::FromUTF16Unsafe( |
| 51 base::GetNativeLibraryName(base::ASCIIToUTF16(base_library_name)))); | 51 base::GetNativeLibraryName(base::ASCIIToUTF16(base_library_name)))); |
| 52 } | 52 } |
| 53 | 53 |
| 54 #if defined(ENABLE_PEPPER_CDMS) | 54 #if defined(ENABLE_PEPPER_CDMS) |
| 55 #if defined(WIDEVINE_CDM_AVAILABLE) | 55 #if defined(ENABLE_WIDEVINE_CDM) |
| 56 TEST(LoadCDMPerfTest, Widevine) { | 56 TEST(LoadCDMPerfTest, Widevine) { |
| 57 MeasureSizeAndTimeToLoadNativeLibrary( | 57 MeasureSizeAndTimeToLoadNativeLibrary( |
| 58 base::FilePath::FromUTF8Unsafe(kWidevineCdmFileName)); | 58 base::FilePath::FromUTF8Unsafe(kWidevineCdmFileName)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 TEST(LoadCDMPerfTest, WidevineAdapter) { | 61 TEST(LoadCDMPerfTest, WidevineAdapter) { |
| 62 MeasureSizeAndTimeToLoadNativeLibrary( | 62 MeasureSizeAndTimeToLoadNativeLibrary( |
| 63 base::FilePath::FromUTF8Unsafe(kWidevineCdmAdapterFileName)); | 63 base::FilePath::FromUTF8Unsafe(kWidevineCdmAdapterFileName)); |
| 64 } | 64 } |
| 65 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 65 #endif // defined(ENABLE_WIDEVINE_CDM) |
| 66 | 66 |
| 67 TEST(LoadCDMPerfTest, ExternalClearKey) { | 67 TEST(LoadCDMPerfTest, ExternalClearKey) { |
| 68 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
| 69 MeasureSizeAndTimeToLoadNativeLibrary( | 69 MeasureSizeAndTimeToLoadNativeLibrary( |
| 70 base::FilePath::FromUTF8Unsafe("libclearkeycdm.dylib")); | 70 base::FilePath::FromUTF8Unsafe("libclearkeycdm.dylib")); |
| 71 #else | 71 #else |
| 72 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdm"); | 72 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdm"); |
| 73 #endif // defined(OS_MACOSX) | 73 #endif // defined(OS_MACOSX) |
| 74 } | 74 } |
| 75 | 75 |
| 76 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) { | 76 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) { |
| 77 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
| 78 MeasureSizeAndTimeToLoadNativeLibrary( | 78 MeasureSizeAndTimeToLoadNativeLibrary( |
| 79 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin")); | 79 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin")); |
| 80 #else | 80 #else |
| 81 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter"); | 81 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter"); |
| 82 #endif // defined(OS_MACOSX) | 82 #endif // defined(OS_MACOSX) |
| 83 } | 83 } |
| 84 #endif // defined(ENABLE_PEPPER_CDMS) | 84 #endif // defined(ENABLE_PEPPER_CDMS) |
| OLD | NEW |