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

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

Issue 1550593002: Switch to standard integer types in chrome/browser/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 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 <stddef.h>
6 #include <stdint.h>
7
5 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
6 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
7 #include "base/path_service.h" 10 #include "base/path_service.h"
8 #include "base/scoped_native_library.h" 11 #include "base/scoped_native_library.h"
9 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "build/build_config.h"
11 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/perf/perf_test.h" 16 #include "testing/perf/perf_test.h"
13 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 17 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
14 18
15 // Measures the size (bytes) and time to load (sec) of a native library. 19 // Measures the size (bytes) and time to load (sec) of a native library.
16 void MeasureSizeAndTimeToLoadNativeLibrary(const base::FilePath& library_name) { 20 void MeasureSizeAndTimeToLoadNativeLibrary(const base::FilePath& library_name) {
17 base::FilePath output_dir; 21 base::FilePath output_dir;
18 ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &output_dir)); 22 ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &output_dir));
19 base::FilePath library_path = output_dir.Append(library_name); 23 base::FilePath library_path = output_dir.Append(library_name);
20 ASSERT_TRUE(base::PathExists(library_path)) << library_path.value(); 24 ASSERT_TRUE(base::PathExists(library_path)) << library_path.value();
21 25
22 int64 size = 0; 26 int64_t size = 0;
23 ASSERT_TRUE(base::GetFileSize(library_path, &size)); 27 ASSERT_TRUE(base::GetFileSize(library_path, &size));
24 perf_test::PrintResult("library_size", 28 perf_test::PrintResult("library_size",
25 "", 29 "",
26 library_name.AsUTF8Unsafe(), 30 library_name.AsUTF8Unsafe(),
27 static_cast<size_t>(size), 31 static_cast<size_t>(size),
28 "bytes", 32 "bytes",
29 true); 33 true);
30 34
31 base::NativeLibraryLoadError error; 35 base::NativeLibraryLoadError error;
32 base::TimeTicks start = base::TimeTicks::Now(); 36 base::TimeTicks start = base::TimeTicks::Now();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 79
76 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) { 80 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) {
77 #if defined(OS_MACOSX) 81 #if defined(OS_MACOSX)
78 MeasureSizeAndTimeToLoadNativeLibrary( 82 MeasureSizeAndTimeToLoadNativeLibrary(
79 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin")); 83 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin"));
80 #else 84 #else
81 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter"); 85 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter");
82 #endif // defined(OS_MACOSX) 86 #endif // defined(OS_MACOSX)
83 } 87 }
84 #endif // defined(ENABLE_PEPPER_CDMS) 88 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698