Keep main loop running until FilesystemCopierAction under test has stopped.
This CL fixes FilesystemCopierActionTest.RunAsRootTerminateEarlyTest
such that it does not prematurely terminate the glib main loop before
FilesystemCopierAction::AsyncReadReadyCallback is invoked upon the
cancellation of the action.
BUG=chromium-os:34448
TEST=Run unit tests repeatedly with glib 2.30 and 2.32.
Change-Id: I26c15811ee41d16df731c4acbe24ed48c8739dde
Reviewed-on: https://gerrit.chromium.org/gerrit/34976
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
diff --git a/filesystem_copier_action.cc b/filesystem_copier_action.cc
index c9be962..1561f93 100644
--- a/filesystem_copier_action.cc
+++ b/filesystem_copier_action.cc
@@ -128,6 +128,10 @@
}
}
+bool FilesystemCopierAction::IsCleanupPending() const {
+ return (src_stream_ != NULL);
+}
+
void FilesystemCopierAction::Cleanup(ActionExitCode code) {
for (int i = 0; i < 2; i++) {
g_object_unref(canceller_[i]);