crash-reporter: Re-enable CollectBadDirectory unittest

The KernelCollectorTest.CollectBadDirectory unittest was first re-enabled by
sergiu@ in https://gerrit.chromium.org/gerrit/5433, but it broke the
buildbots and had to be re-disabled.  So I'm trying again, but this time I
have the power of trybots!  I also added code to output the log if it fails
again.

BUG=chromium-os:18622
TEST=Ran unittests.  Ran trybots on: alex-paladin, amd64-generic-paladin,
arm-tegra2-paladin, lumpy-paladin, stumpy-paladin.

Change-Id: Ib7fa1c1a32e9c198db9bdae8f933c9dd9fc3381a
Reviewed-on: https://gerrit.chromium.org/gerrit/20667
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
diff --git a/crash_reporter/kernel_collector_test.cc b/crash_reporter/kernel_collector_test.cc
index ea18c62..ee96f05 100644
--- a/crash_reporter/kernel_collector_test.cc
+++ b/crash_reporter/kernel_collector_test.cc
@@ -20,6 +20,7 @@
 static const char kTestCrashDirectory[] = "test/crash_directory";
 
 using chromeos::FindLog;
+using chromeos::GetLog;
 
 void CountCrash() {
   ++s_crashes;
@@ -230,14 +231,14 @@
   ASSERT_EQ(0, s_crashes);
 }
 
-// Disabled for crosbug.com/18622
-//TEST_F(KernelCollectorTest, CollectBadDirectory) {
-//  WriteStringToFile(test_kcrash_, "====1.1\nsomething");
-//  ASSERT_TRUE(collector_.Collect());
-//  ASSERT_TRUE(FindLog(
-//      "Unable to create appropriate crash directory"));
-//  ASSERT_EQ(1, s_crashes);
-//}
+TEST_F(KernelCollectorTest, CollectBadDirectory) {
+  WriteStringToFile(test_kcrash_, "====1.1\nsomething");
+  ASSERT_TRUE(collector_.Collect());
+  ASSERT_TRUE(FindLog("Unable to create appropriate crash directory"))
+      << "Did not find expected error string in log: {\n"
+      << GetLog() << "}";
+  ASSERT_EQ(1, s_crashes);
+}
 
 void KernelCollectorTest::SetUpSuccessfulCollect() {
   collector_.ForceCrashDirectory(kTestCrashDirectory);