OLD | NEW |
---|---|
1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 | 118 |
119 // Inspect the log file contents. | 119 // Inspect the log file contents. |
120 std::string content; | 120 std::string content; |
121 ASSERT_TRUE(base::ReadFileToString(temp_path_, &content)); | 121 ASSERT_TRUE(base::ReadFileToString(temp_path_, &content)); |
122 ASSERT_THAT(content, testing::EndsWith(kMessage)); | 122 ASSERT_THAT(content, testing::EndsWith(kMessage)); |
123 | 123 |
124 // We should have exactly one minidump in the temp directory. | 124 // We should have exactly one minidump in the temp directory. |
125 using base::FileEnumerator; | 125 using base::FileEnumerator; |
126 FileEnumerator fe(temp_dir_.path(), false, FileEnumerator::FILES, L"*.dmp"); | 126 FileEnumerator fe(temp_dir_.path(), false, FileEnumerator::FILES, L"*.dmp"); |
127 base::FilePath minidump(fe.Next()); | 127 base::FilePath minidump(fe.Next()); |
128 #ifndef _WIN64 | |
128 EXPECT_FALSE(minidump.empty()); | 129 EXPECT_FALSE(minidump.empty()); |
130 #else | |
131 // The 64 bit version of the logger doesn't support writting minidumps yet | |
132 // because it relies on Kasko, which hasn't been ported to 64-bit. Make sure | |
133 // that no PDB get produced until we switch the minidump generation to using | |
134 // Crashpad. | |
chrisha
2016/10/13 20:22:49
Missing TODO(sebmarchand) somewhere here too?
Sébastien Marchand
2016/10/13 21:05:45
Done.
| |
135 EXPECT_TRUE(minidump.empty()); | |
136 #endif | |
129 EXPECT_TRUE(fe.Next().empty()); | 137 EXPECT_TRUE(fe.Next().empty()); |
130 | 138 |
131 // TODO(rogerm): Inspect the contents of the minidump. | 139 // TODO(rogerm): Inspect the contents of the minidump. |
132 } | 140 } |
133 | 141 |
134 TEST_F(AsanLoggerTest, Stop) { | 142 TEST_F(AsanLoggerTest, Stop) { |
135 // Setup a log file destination. | 143 // Setup a log file destination. |
136 base::ScopedFILE destination(base::OpenFile(temp_path_, "wb")); | 144 base::ScopedFILE destination(base::OpenFile(temp_path_, "wb")); |
137 | 145 |
138 // Start up the logging service. | 146 // Start up the logging service. |
(...skipping 15 matching lines...) Expand all Loading... | |
154 trace::common::Service* server_base = static_cast<trace::common::Service*>( | 162 trace::common::Service* server_base = static_cast<trace::common::Service*>( |
155 &server); | 163 &server); |
156 EXPECT_CALL(*this, LoggerStoppedCallback(server_base)).Times(1). | 164 EXPECT_CALL(*this, LoggerStoppedCallback(server_base)).Times(1). |
157 WillOnce(Return(true)); | 165 WillOnce(Return(true)); |
158 client_.Stop(); | 166 client_.Stop(); |
159 ASSERT_TRUE(server.Join()); | 167 ASSERT_TRUE(server.Join()); |
160 } | 168 } |
161 | 169 |
162 } // namespace asan | 170 } // namespace asan |
163 } // namespace agent | 171 } // namespace agent |
OLD | NEW |