OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/debug/crash_logging.h" | 5 #include "base/debug/crash_logging.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <map> | 9 #include <map> |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/macros.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
12 | 15 |
13 namespace { | 16 namespace { |
14 | 17 |
15 std::map<std::string, std::string>* key_values_ = NULL; | 18 std::map<std::string, std::string>* key_values_ = NULL; |
16 | 19 |
17 } // namespace | 20 } // namespace |
18 | 21 |
19 class CrashLoggingTest : public testing::Test { | 22 class CrashLoggingTest : public testing::Test { |
20 public: | 23 public: |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 EXPECT_EQ("wor", results[2]); | 176 EXPECT_EQ("wor", results[2]); |
174 EXPECT_EQ("ld", results[3]); | 177 EXPECT_EQ("ld", results[3]); |
175 } | 178 } |
176 | 179 |
177 TEST_F(CrashLoggingTest, ChunkRounding) { | 180 TEST_F(CrashLoggingTest, ChunkRounding) { |
178 // If max_length=12 and max_chunk_length=5, there should be 3 chunks, | 181 // If max_length=12 and max_chunk_length=5, there should be 3 chunks, |
179 // not 2. | 182 // not 2. |
180 base::debug::CrashKey key = { "round", 12 }; | 183 base::debug::CrashKey key = { "round", 12 }; |
181 EXPECT_EQ(3u, base::debug::InitCrashKeys(&key, 1, 5)); | 184 EXPECT_EQ(3u, base::debug::InitCrashKeys(&key, 1, 5)); |
182 } | 185 } |
OLD | NEW |