| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <fstream> | 5 #include <fstream> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const DumpInfo& dump_info = *(dumps[0]); | 106 const DumpInfo& dump_info = *(dumps[0]); |
| 107 ASSERT_TRUE(dump_info.valid()); | 107 ASSERT_TRUE(dump_info.valid()); |
| 108 EXPECT_EQ(new_minidump.value(), dump_info.crashed_process_dump()); | 108 EXPECT_EQ(new_minidump.value(), dump_info.crashed_process_dump()); |
| 109 EXPECT_EQ(dumpstate.value(), dump_info.logfile()); | 109 EXPECT_EQ(dumpstate.value(), dump_info.logfile()); |
| 110 EXPECT_EQ("youtube", dump_info.params().previous_app_name); | 110 EXPECT_EQ("youtube", dump_info.params().previous_app_name); |
| 111 EXPECT_EQ("pandora", dump_info.params().current_app_name); | 111 EXPECT_EQ("pandora", dump_info.params().current_app_name); |
| 112 EXPECT_EQ("netflix", dump_info.params().last_app_name); | 112 EXPECT_EQ("netflix", dump_info.params().last_app_name); |
| 113 } | 113 } |
| 114 | 114 |
| 115 base::FilePath minidump_path() { return minidump_.path(); } | 115 base::FilePath minidump_path() { return minidump_.path(); } |
| 116 base::FilePath home_path() { return fake_home_dir_.path(); } | 116 base::FilePath home_path() { return fake_home_dir_.GetPath(); } |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 base::ScopedTempDir fake_home_dir_; | 119 base::ScopedTempDir fake_home_dir_; |
| 120 ScopedTempFile minidump_; | 120 ScopedTempFile minidump_; |
| 121 std::unique_ptr<base::ScopedPathOverride> home_override_; | 121 std::unique_ptr<base::ScopedPathOverride> home_override_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(CastCrashReporterClientTest); | 123 DISALLOW_COPY_AND_ASSIGN(CastCrashReporterClientTest); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #if DCHECK_IS_ON() | 126 #if DCHECK_IS_ON() |
| (...skipping 17 matching lines...) Expand all Loading... |
| 144 base::ThreadRestrictions::SetIOAllowed(true); | 144 base::ThreadRestrictions::SetIOAllowed(true); |
| 145 CastCrashReporterClient client; | 145 CastCrashReporterClient client; |
| 146 ASSERT_TRUE(client.HandleCrashDump(minidump_path().value().c_str())); | 146 ASSERT_TRUE(client.HandleCrashDump(minidump_path().value().c_str())); |
| 147 | 147 |
| 148 // Assert that the thread is not IO restricted when the function exits. | 148 // Assert that the thread is not IO restricted when the function exits. |
| 149 // Note that SetIOAllowed returns the previous value. | 149 // Note that SetIOAllowed returns the previous value. |
| 150 ASSERT_TRUE(base::ThreadRestrictions::SetIOAllowed(true)); | 150 ASSERT_TRUE(base::ThreadRestrictions::SetIOAllowed(true)); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace chromecast | 153 } // namespace chromecast |
| OLD | NEW |