[M120 Migration][VD] Fix url crash in RequestCertificateConfirm
[platform/framework/web/chromium-efl.git] / sql / sql_memory_dump_provider_unittest.cc
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sql/sql_memory_dump_provider.h"
6
7 #include "base/files/scoped_temp_dir.h"
8 #include "base/trace_event/memory_dump_request_args.h"
9 #include "base/trace_event/process_memory_dump.h"
10 #include "sql/database.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace sql {
14
15 namespace {
16
17 class SQLMemoryDumpProviderTest : public testing::Test {
18  public:
19   ~SQLMemoryDumpProviderTest() override = default;
20
21   void SetUp() override {
22     ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
23     ASSERT_TRUE(db_.Open(
24         temp_dir_.GetPath().AppendASCII("memory_dump_provider_test.sqlite")));
25
26     ASSERT_TRUE(db_.Execute("CREATE TABLE foo (a, b)"));
27   }
28
29  protected:
30   base::ScopedTempDir temp_dir_;
31   Database db_;
32 };
33
34 TEST_F(SQLMemoryDumpProviderTest, OnMemoryDump) {
35   base::trace_event::MemoryDumpArgs args = {
36       base::trace_event::MemoryDumpLevelOfDetail::kDetailed};
37   base::trace_event::ProcessMemoryDump pmd(args);
38   ASSERT_TRUE(SqlMemoryDumpProvider::GetInstance()->OnMemoryDump(args, &pmd));
39   ASSERT_TRUE(pmd.GetAllocatorDump("sqlite"));
40 }
41
42 }  // namespace
43
44 }  // namespace sql