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

Unified Diff: child_job_unittest.cc

Issue 661224: Stop infinite restarting (Closed)
Patch Set: Created 10 years, 10 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
« child_job.cc ('K') | « child_job.cc ('k') | mock_child_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: child_job_unittest.cc
diff --git a/child_job_unittest.cc b/child_job_unittest.cc
index 4526dfe2386eafb5287c88119bfb8636a83ec1e1..b706a4e1f7b252bb5a02679e1d4dfa1541dd2bfa 100644
--- a/child_job_unittest.cc
+++ b/child_job_unittest.cc
@@ -74,4 +74,29 @@ TEST(SetUidExecJobTest, NoFlagAppendTest) {
EXPECT_TRUE(data.end() == it) << *it;
}
+TEST(SetUidExecJobTest, ShouldStopTest) {
+ const char *my_argv[] = { "zero",
+ "one",
+ "two" };
+ const int my_argc = 3;
+ CommandLine cl(my_argc, my_argv);
+
+ SetUidExecJob job(&cl, NULL, false);
+ job.RecordTime();
+ EXPECT_TRUE(job.ShouldStop());
+}
+
+TEST(SetUidExecJobTest, ShouldNotStopTest) {
+ const char *my_argv[] = { "zero",
+ "one",
+ "two" };
+ const int my_argc = 3;
+ CommandLine cl(my_argc, my_argv);
+
+ SetUidExecJob job(&cl, NULL, false);
+ job.RecordTime();
+ sleep(1);
+ EXPECT_FALSE(job.ShouldStop());
+}
+
} // namespace login_manager
« child_job.cc ('K') | « child_job.cc ('k') | mock_child_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698