AU: Add unit tests for the Terminator class.

Also, improve the implementation so that the Terminator can be initialized
multiple times.

BUG=6243
TEST=unit tests

Change-Id: I8d7f1a2007ac28f8c79506f46d628654413b6607

Review URL: http://codereview.chromium.org/5104007
diff --git a/terminator.h b/terminator.h
index 1c014ea..b3fdba6 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 @@
   // 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 @@
   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);