crash-reporter: write conversion failure diagnostics into fake dmp files

Change-Id: I9f1ca92def3e1d0fa43b3bef0f2a72d367953926

BUG=6299,7782
TEST=bvts

Review URL: http://codereview.chromium.org/4088003
diff --git a/crash_reporter/crash_collector_test.cc b/crash_reporter/crash_collector_test.cc
index ffab06a..859653b 100644
--- a/crash_reporter/crash_collector_test.cc
+++ b/crash_reporter/crash_collector_test.cc
@@ -120,6 +120,18 @@
   ASSERT_EQ("foo.20100523.135015.100", basename);
 }
 
+TEST_F(CrashCollectorTest, GetCrashPath) {
+  EXPECT_EQ("/var/spool/crash/myprog.20100101.1200.1234.core",
+            collector_.GetCrashPath(FilePath("/var/spool/crash"),
+                                    "myprog.20100101.1200.1234",
+                                    "core").value());
+  EXPECT_EQ("/home/chronos/user/crash/chrome.20100101.1200.1234.dmp",
+            collector_.GetCrashPath(FilePath("/home/chronos/user/crash"),
+                                    "chrome.20100101.1200.1234",
+                                    "dmp").value());
+}
+
+
 bool CrashCollectorTest::CheckHasCapacity() {
   static const char kFullMessage[] = "Crash directory test already full";
   bool has_capacity = collector_.CheckHasCapacity(test_dir_);
@@ -238,6 +250,7 @@
   EXPECT_EQ("foo=bar\n"
             "exec_name=kernel\n"
             "ver=version\n"
+            "payload=test/payload-file\n"
             "payload_size=3\n"
             "done=1\n", contents);
 }