OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/library_loader/library_prefetcher.h" | 5 #include "base/android/library_loader/library_prefetcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include "base/debug/proc_maps_linux.h" | 9 #include "base/debug/proc_maps_linux.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/googletest/include/gtest/gtest.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 namespace android { | 13 namespace android { |
14 | 14 |
15 namespace { | 15 namespace { |
16 const uint8 kRead = base::debug::MappedMemoryRegion::READ; | 16 const uint8 kRead = base::debug::MappedMemoryRegion::READ; |
17 const uint8 kReadPrivate = base::debug::MappedMemoryRegion::READ | | 17 const uint8 kReadPrivate = base::debug::MappedMemoryRegion::READ | |
18 base::debug::MappedMemoryRegion::PRIVATE; | 18 base::debug::MappedMemoryRegion::PRIVATE; |
19 const uint8 kExecutePrivate = base::debug::MappedMemoryRegion::EXECUTE | | 19 const uint8 kExecutePrivate = base::debug::MappedMemoryRegion::EXECUTE | |
20 base::debug::MappedMemoryRegion::PRIVATE; | 20 base::debug::MappedMemoryRegion::PRIVATE; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::vector<NativeLibraryPrefetcher::AddressRange> ranges; | 86 std::vector<NativeLibraryPrefetcher::AddressRange> ranges; |
87 NativeLibraryPrefetcher::FilterLibchromeRangesOnlyIfPossible(regions, | 87 NativeLibraryPrefetcher::FilterLibchromeRangesOnlyIfPossible(regions, |
88 &ranges); | 88 &ranges); |
89 EXPECT_EQ(ranges.size(), 1U); | 89 EXPECT_EQ(ranges.size(), 1U); |
90 EXPECT_EQ(ranges[0].first, 0x6U); | 90 EXPECT_EQ(ranges[0].first, 0x6U); |
91 EXPECT_EQ(ranges[0].second, 0x7U); | 91 EXPECT_EQ(ranges[0].second, 0x7U); |
92 } | 92 } |
93 | 93 |
94 } // namespace android | 94 } // namespace android |
95 } // namespace base | 95 } // namespace base |
OLD | NEW |