Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: sql/connection_unittest.cc

Issue 1327063002: [tracing] Add sqlite memory statistics to tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/files/memory_mapped_file.h" 7 #include "base/files/memory_mapped_file.h"
8 #include "base/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/statistics_recorder.h" 11 #include "base/metrics/statistics_recorder.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "base/test/histogram_tester.h" 13 #include "base/test/histogram_tester.h"
14 #include "base/trace_event/process_memory_dump.h"
14 #include "sql/connection.h" 15 #include "sql/connection.h"
15 #include "sql/correct_sql_test_base.h" 16 #include "sql/correct_sql_test_base.h"
16 #include "sql/meta_table.h" 17 #include "sql/meta_table.h"
17 #include "sql/statement.h" 18 #include "sql/statement.h"
18 #include "sql/test/error_callback_support.h" 19 #include "sql/test/error_callback_support.h"
19 #include "sql/test/scoped_error_ignorer.h" 20 #include "sql/test/scoped_error_ignorer.h"
20 #include "sql/test/test_helpers.h" 21 #include "sql/test/test_helpers.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 #include "third_party/sqlite/sqlite3.h" 23 #include "third_party/sqlite/sqlite3.h"
23 24
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 base::File f(db_path(), kFlags); 1372 base::File f(db_path(), kFlags);
1372 ASSERT_TRUE(f.IsValid()); 1373 ASSERT_TRUE(f.IsValid());
1373 buf[0] = '4'; 1374 buf[0] = '4';
1374 ASSERT_EQ(f.Write(kOffset, buf, 1), 1); 1375 ASSERT_EQ(f.Write(kOffset, buf, 1), 1);
1375 } 1376 }
1376 ASSERT_EQ('4', m.data()[kOffset]); 1377 ASSERT_EQ('4', m.data()[kOffset]);
1377 } 1378 }
1378 } 1379 }
1379 #endif 1380 #endif
1380 1381
1382 TEST_F(SQLConnectionTest, OnMemoryDump) {
1383 base::trace_event::ProcessMemoryDump pmd(nullptr);
1384 base::trace_event::MemoryDumpArgs args = {
1385 base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
1386 ASSERT_TRUE(db().OnMemoryDump(args, &pmd));
1387 EXPECT_GE(pmd.allocator_dumps().size(), 1u);
1388 }
1389
1381 } // namespace 1390 } // namespace
OLDNEW
« sql/connection.cc ('K') | « sql/connection.cc ('k') | sql/sql.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698