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

Side by Side Diff: base/debug/proc_maps_linux_unittest.cc

Issue 18071005: Disable ProcMapsTest.ReadProcMaps under ThreadSanitizer until issue 258451 is fixed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/debug/proc_maps_linux.h" 5 #include "base/debug/proc_maps_linux.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 std::vector<MappedMemoryRegion> regions; 174 std::vector<MappedMemoryRegion> regions;
175 EXPECT_TRUE(ParseProcMaps(kTestCases[i].input, &regions)); 175 EXPECT_TRUE(ParseProcMaps(kTestCases[i].input, &regions));
176 EXPECT_EQ(1u, regions.size()); 176 EXPECT_EQ(1u, regions.size());
177 if (regions.empty()) 177 if (regions.empty())
178 continue; 178 continue;
179 EXPECT_EQ(kTestCases[i].permissions, regions[0].permissions); 179 EXPECT_EQ(kTestCases[i].permissions, regions[0].permissions);
180 } 180 }
181 } 181 }
182 182
183 TEST(ProcMapsTest, ReadProcMaps) { 183 // ProcMapsTest.ReadProcMaps fails under TSan on Linux,
184 // see http://crbug.com/258451.
185 #if defined(THREAD_SANITIZER)
186 #define MAYBE_ReadProcMaps DISABLED_ReadProcMaps
187 #else
188 #define MAYBE_ReadProcMaps ReadProcMaps
189 #endif
190 TEST(ProcMapsTest, MAYBE_ReadProcMaps) {
184 std::string proc_maps; 191 std::string proc_maps;
185 ASSERT_TRUE(ReadProcMaps(&proc_maps)); 192 ASSERT_TRUE(ReadProcMaps(&proc_maps));
186 193
187 std::vector<MappedMemoryRegion> regions; 194 std::vector<MappedMemoryRegion> regions;
188 ASSERT_TRUE(ParseProcMaps(proc_maps, &regions)); 195 ASSERT_TRUE(ParseProcMaps(proc_maps, &regions));
189 ASSERT_FALSE(regions.empty()); 196 ASSERT_FALSE(regions.empty());
190 197
191 // We should be able to find both the current executable as well as the stack 198 // We should be able to find both the current executable as well as the stack
192 // mapped into memory. Use the address of |proc_maps| as a way of finding the 199 // mapped into memory. Use the address of |proc_maps| as a way of finding the
193 // stack. 200 // stack.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 272
266 for (size_t i = 0; i < arraysize(kTestCases); ++i) { 273 for (size_t i = 0; i < arraysize(kTestCases); ++i) {
267 SCOPED_TRACE(base::StringPrintf("kTestCases[%zu] = %s", i, kTestCases[i])); 274 SCOPED_TRACE(base::StringPrintf("kTestCases[%zu] = %s", i, kTestCases[i]));
268 std::vector<MappedMemoryRegion> regions; 275 std::vector<MappedMemoryRegion> regions;
269 EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions)); 276 EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions));
270 } 277 }
271 } 278 }
272 279
273 } // namespace debug 280 } // namespace debug
274 } // namespace base 281 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698