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

Unified Diff: utils_unittest.cc

Issue 6114002: AU: Function to trigger crash reporter. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fixes for review Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils_unittest.cc
diff --git a/utils_unittest.cc b/utils_unittest.cc
index d8bc866a286f264ce8cf8b727cc70016f40f4fd3..185ab9a42824e4e14d42a801b22d31c8224ac819 100644
--- a/utils_unittest.cc
+++ b/utils_unittest.cc
@@ -255,4 +255,22 @@ TEST(UtilsTest, RunAsRootGetFilesystemSizeTest) {
EXPECT_EQ(10 * 1024 * 1024 / 4096, block_count);
}
+namespace {
+gboolean TerminateScheduleCrashReporterUploadTest(void* arg) {
+ GMainLoop* loop = reinterpret_cast<GMainLoop*>(arg);
+ g_main_loop_quit(loop);
+ return FALSE; // Don't call this callback again
+}
+} // namespace {}
+
+TEST(UtilsTest, ScheduleCrashReporterUploadTest) {
+ // Not much to test. At least this tests for memory leaks, crashes,
+ // log errors.
+ GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
+ utils::ScheduleCrashReporterUpload();
+ g_timeout_add_seconds(1, &TerminateScheduleCrashReporterUploadTest, loop);
+ g_main_loop_run(loop);
+ g_main_loop_unref(loop);
+}
+
} // namespace chromeos_update_engine
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698