| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 samples = tester.GetHistogramSamplesSinceCreation(kCommitTime); | 1314 samples = tester.GetHistogramSamplesSinceCreation(kCommitTime); |
| 1315 ASSERT_TRUE(samples); | 1315 ASSERT_TRUE(samples); |
| 1316 // 100 for commit adjust, 1 for measuring COMMIT. | 1316 // 100 for commit adjust, 1 for measuring COMMIT. |
| 1317 EXPECT_EQ(101, samples->sum()); | 1317 EXPECT_EQ(101, samples->sum()); |
| 1318 | 1318 |
| 1319 samples = tester.GetHistogramSamplesSinceCreation(kAutoCommitTime); | 1319 samples = tester.GetHistogramSamplesSinceCreation(kAutoCommitTime); |
| 1320 EXPECT_EQ(0, samples->sum()); | 1320 EXPECT_EQ(0, samples->sum()); |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 TEST_F(SQLConnectionTest, OnMemoryDump) { | 1323 TEST_F(SQLConnectionTest, OnMemoryDump) { |
| 1324 base::trace_event::ProcessMemoryDump pmd(nullptr); | |
| 1325 base::trace_event::MemoryDumpArgs args = { | 1324 base::trace_event::MemoryDumpArgs args = { |
| 1326 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; | 1325 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; |
| 1326 base::trace_event::ProcessMemoryDump pmd(nullptr, args); |
| 1327 ASSERT_TRUE(db().memory_dump_provider_->OnMemoryDump(args, &pmd)); | 1327 ASSERT_TRUE(db().memory_dump_provider_->OnMemoryDump(args, &pmd)); |
| 1328 EXPECT_GE(pmd.allocator_dumps().size(), 1u); | 1328 EXPECT_GE(pmd.allocator_dumps().size(), 1u); |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 // Test that the functions to collect diagnostic data run to completion, without | 1331 // Test that the functions to collect diagnostic data run to completion, without |
| 1332 // worrying too much about what they generate (since that will change). | 1332 // worrying too much about what they generate (since that will change). |
| 1333 TEST_F(SQLConnectionTest, CollectDiagnosticInfo) { | 1333 TEST_F(SQLConnectionTest, CollectDiagnosticInfo) { |
| 1334 // NOTE(shess): Mojo doesn't support everything CollectCorruptionInfo() uses, | 1334 // NOTE(shess): Mojo doesn't support everything CollectCorruptionInfo() uses, |
| 1335 // but it's not really clear if adding support would be useful. | 1335 // but it's not really clear if adding support would be useful. |
| 1336 #if !defined(MOJO_APPTEST_IMPL) | 1336 #if !defined(MOJO_APPTEST_IMPL) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 // With no key, map everything and create the key. | 1482 // With no key, map everything and create the key. |
| 1483 // TODO(shess): This really should be "maps everything after validating it", | 1483 // TODO(shess): This really should be "maps everything after validating it", |
| 1484 // but that is more complicated to structure. | 1484 // but that is more complicated to structure. |
| 1485 ASSERT_GT(db().GetAppropriateMmapSize(), kMmapAlot); | 1485 ASSERT_GT(db().GetAppropriateMmapSize(), kMmapAlot); |
| 1486 ASSERT_TRUE(MetaTable::GetMmapStatus(&db(), &mmap_status)); | 1486 ASSERT_TRUE(MetaTable::GetMmapStatus(&db(), &mmap_status)); |
| 1487 ASSERT_EQ(MetaTable::kMmapSuccess, mmap_status); | 1487 ASSERT_EQ(MetaTable::kMmapSuccess, mmap_status); |
| 1488 } | 1488 } |
| 1489 #endif | 1489 #endif |
| 1490 | 1490 |
| 1491 } // namespace sql | 1491 } // namespace sql |
| OLD | NEW |