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

Unified Diff: terminator.h

Issue 5104007: AU: Add unit tests for the Terminator class. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: unnecessary header file 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « SConstruct ('k') | terminator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: terminator.h
diff --git a/terminator.h b/terminator.h
index 1c014ea79acece92bc52ce0f5383ceb36a0dd896..b3fdba68d2f3a959656914d54878feb351dbe1cc 100644
--- a/terminator.h
+++ b/terminator.h
@@ -7,6 +7,8 @@
#include <signal.h>
+#include <gtest/gtest_prod.h> // for FRIEND_TEST
+
namespace chromeos_update_engine {
// A class allowing graceful delayed exit.
@@ -21,6 +23,7 @@ class Terminator {
// Set to true if the terminator should block termination requests in an
// attempt to block exiting.
static void set_exit_blocked(bool block) { exit_blocked_ = block ? 1 : 0; }
+ static bool exit_blocked() { return exit_blocked_ != 0; }
// Returns true if the system is trying to terminate the process, false
// otherwise. Returns true only if exit was blocked when the termination
@@ -28,6 +31,9 @@ class Terminator {
static bool exit_requested() { return exit_requested_ != 0; }
private:
+ FRIEND_TEST(TerminatorTest, HandleSignalTest);
+ FRIEND_TEST(TerminatorDeathTest, ScopedTerminatorExitUnblockerExitTest);
+
// The signal handler.
static void HandleSignal(int signum);
« no previous file with comments | « SConstruct ('k') | terminator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698