Plug resource leaks in GCMDriverBaseTest.

Unregistering ends up posting tasks to perform cleanup in the Encryption
db. Let these tasks run during TearDown so that all files have been
closed by the time the test fixture's ScopedTempDir is torn down.

BUG=546640

Change-Id: Iddbe8857e96c3042ea9d15223b299acb521a1b6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943230
Auto-Submit: Greg Thompson <[email protected]>
Commit-Queue: Peter Beverloo <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#720179}
diff --git a/components/gcm_driver/gcm_driver_unittest.cc b/components/gcm_driver/gcm_driver_unittest.cc
index 561b6670..1bbde7d 100644
--- a/components/gcm_driver/gcm_driver_unittest.cc
+++ b/components/gcm_driver/gcm_driver_unittest.cc
@@ -151,6 +151,8 @@
   PumpIOLoop();
 
   io_thread_.Stop();
+  task_environment_.RunUntilIdle();
+  ASSERT_TRUE(temp_dir_.Delete());
 }
 
 void GCMDriverBaseTest::PumpIOLoop() {