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

Side by Side Diff: chrome/browser/load_library_perf_test.cc

Issue 151283003: Perf test to measure loading CDM library. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: make perf test generic to libraries Created 6 years, 10 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 | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/files/file_path.h"
6 #include "base/path_service.h"
7 #include "base/scoped_native_library.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "testing/perf/perf_test.h"
12 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
13
14
15 void MeasureTimeToLoad(const std::string& library_name) {
16 base::NativeLibrary native_library;
17 base::FilePath library_full_name;
18 library_full_name = base::FilePath::FromUTF16Unsafe(
19 base::GetNativeLibraryName(base::ASCIIToUTF16(library_name)));
20 base::FilePath output_dir;
21 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &output_dir));
22 base::FilePath library_path = output_dir.Append(library_full_name);
23 std::string error;
24 base::TimeTicks start = base::TimeTicks::HighResNow();
25 native_library = base::LoadNativeLibrary(library_path, &error);
26 double delta = (base::TimeTicks::HighResNow() - start).InMillisecondsF();
27 EXPECT_TRUE(native_library) << "Error loading library:\n" << error;
28 perf_test::PrintResult("time_to_load_library",
29 "",
30 library_full_name.value(),
31 delta,
32 "ms",
33 true);
34 }
35
36 #if defined(ENABLE_PEPPER_CDMS)
37 #if defined(WIDEVINE_CDM_AVAILABLE)
38 TEST(LoadCDMPerfTest, Widevine) {
39 MeasureTimeToLoad("widevinecdm");
ddorwin 2014/02/08 01:26:59 Should we load the ...adapter? It's the whole pack
40 }
41 #endif // defined(WIDEVINE_CDM_AVAILABLE)
42
43 TEST(LoadCDMPerfTest, ExternalClearKey) {
44 MeasureTimeToLoad("clearkeycdm");
45 }
46 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698