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

Side by Side Diff: chrome_elf/elf_imports_unittest.cc

Issue 154653002: Breakpad coverage for chrome_elf start up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« chrome_elf/chrome_elf_main.cc ('K') | « chrome_elf/chrome_elf_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 #include <windows.h> 6 #include <windows.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 dll = dll.Append(L"chrome_elf.dll"); 54 dll = dll.Append(L"chrome_elf.dll");
55 GetImports(dll, &elf_imports); 55 GetImports(dll, &elf_imports);
56 56
57 // Check that ELF has imports. 57 // Check that ELF has imports.
58 ASSERT_LT(0u, elf_imports.size()) << "Ensure the chrome_elf_unittests " 58 ASSERT_LT(0u, elf_imports.size()) << "Ensure the chrome_elf_unittests "
59 "target was built, instead of chrome_elf_unittests.exe"; 59 "target was built, instead of chrome_elf_unittests.exe";
60 60
61 std::vector<std::string>::iterator it(elf_imports.begin()); 61 std::vector<std::string>::iterator it(elf_imports.begin());
62 62
63 static const char* const kValidFilePatterns[] = { 63 static const char* const kValidFilePatterns[] = {
64 "base.dll", // For breakpad support.
64 "KERNEL32.dll", 65 "KERNEL32.dll",
65 "MSVC*", 66 "MSVC*",
66 #if defined(ADDRESS_SANITIZER) 67 #if defined(ADDRESS_SANITIZER)
67 "syzyasan_rtl.dll", 68 "syzyasan_rtl.dll",
68 #endif 69 #endif
69 "ADVAPI32.dll"}; 70 "ADVAPI32.dll"};
70 71
71 // Make sure all of ELF's imports are in the valid imports list. 72 // Make sure all of ELF's imports are in the valid imports list.
72 for (; it != elf_imports.end(); it++) { 73 for (; it != elf_imports.end(); it++) {
73 bool match = false; 74 bool match = false;
(...skipping 23 matching lines...) Expand all
97 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests " 98 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests "
98 "target was built, instead of chrome_elf_unittests.exe"; 99 "target was built, instead of chrome_elf_unittests.exe";
99 100
100 // Chrome.exe's first import must be ELF. 101 // Chrome.exe's first import must be ELF.
101 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) << 102 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) <<
102 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest " 103 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest "
103 "target was built, instead of just chrome_elf_unittests.exe)"; 104 "target was built, instead of just chrome_elf_unittests.exe)";
104 } 105 }
105 106
106 } // namespace 107 } // namespace
OLDNEW
« chrome_elf/chrome_elf_main.cc ('K') | « chrome_elf/chrome_elf_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698