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

Side by Side Diff: kernel_collector_test.cc

Issue 4088003: crash-reporter: write conversion failure diagnostics into fake dmp files (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git
Patch Set: Add signature for error logs Created 10 years, 1 month 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 | « kernel_collector.cc ('k') | user_collector.h » ('j') | 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) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 <unistd.h> 5 #include <unistd.h>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "crash-reporter/kernel_collector.h" 9 #include "crash-reporter/kernel_collector.h"
10 #include "crash-reporter/system_logging_mock.h" 10 #include "crash-reporter/system_logging_mock.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Make sure the preserved dump is now clear. 128 // Make sure the preserved dump is now clear.
129 std::string dump; 129 std::string dump;
130 ASSERT_TRUE(collector_.LoadPreservedDump(&dump)); 130 ASSERT_TRUE(collector_.LoadPreservedDump(&dump));
131 ASSERT_EQ(KernelCollector::kClearingSequence, dump); 131 ASSERT_EQ(KernelCollector::kClearingSequence, dump);
132 } 132 }
133 133
134 TEST_F(KernelCollectorTest, CollectOptedOut) { 134 TEST_F(KernelCollectorTest, CollectOptedOut) {
135 SetUpSuccessfulCollect(); 135 SetUpSuccessfulCollect();
136 s_metrics = false; 136 s_metrics = false;
137 ASSERT_TRUE(collector_.Collect()); 137 ASSERT_TRUE(collector_.Collect());
138 ASSERT_NE(std::string::npos, logging_.log().find("(ignoring)")); 138 ASSERT_NE(std::string::npos, logging_.log().find("(ignoring - no consent)"));
139 ASSERT_EQ(0, s_crashes); 139 ASSERT_EQ(0, s_crashes);
140 140
141 CheckPreservedDumpClear(); 141 CheckPreservedDumpClear();
142 } 142 }
143 143
144 TEST_F(KernelCollectorTest, CollectOK) { 144 TEST_F(KernelCollectorTest, CollectOK) {
145 SetUpSuccessfulCollect(); 145 SetUpSuccessfulCollect();
146 ASSERT_TRUE(collector_.Collect()); 146 ASSERT_TRUE(collector_.Collect());
147 ASSERT_EQ(1, s_crashes); 147 ASSERT_EQ(1, s_crashes);
148 ASSERT_NE(std::string::npos, logging_.log().find("(handling)")); 148 ASSERT_NE(std::string::npos, logging_.log().find("(handling)"));
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 false)); 268 false));
269 EXPECT_EQ("kernel-0123456789012345678901234567890123456789-00000000", 269 EXPECT_EQ("kernel-0123456789012345678901234567890123456789-00000000",
270 signature); 270 signature);
271 271
272 } 272 }
273 273
274 int main(int argc, char **argv) { 274 int main(int argc, char **argv) {
275 ::testing::InitGoogleTest(&argc, argv); 275 ::testing::InitGoogleTest(&argc, argv);
276 return RUN_ALL_TESTS(); 276 return RUN_ALL_TESTS();
277 } 277 }
OLDNEW
« no previous file with comments | « kernel_collector.cc ('k') | user_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698