// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <stddef.h> #include <stdint.h> #include "base/files/scoped_temp_dir.h" #include "base/strings/stringprintf.h" #include "chrome/browser/extensions/activity_log/database_string_table.h" #include "sql/database.h" #include "sql/statement.h" #include "sql/transaction.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions { class DatabaseStringTableTest : public testing::Test { … }; // Check that initializing the database works. TEST_F(DatabaseStringTableTest, Init) { … } // Insert a new mapping into the table, then verify the table contents. TEST_F(DatabaseStringTableTest, Insert) { … } // Check that different strings are mapped to different values, and the same // string is mapped to the same value repeatably. TEST_F(DatabaseStringTableTest, InsertMultiple) { … } // Check that values can be read back from the database even after the // in-memory cache is cleared. TEST_F(DatabaseStringTableTest, CacheCleared) { … } // Check that direct database modifications are picked up after the cache is // cleared. TEST_F(DatabaseStringTableTest, DatabaseModified) { … } // Check that looking up an unknown id returns an error. TEST_F(DatabaseStringTableTest, BadLookup) { … } // Check looking up an inserted value, both cached and not cached. TEST_F(DatabaseStringTableTest, Lookup) { … } // Check that the in-memory cache for the string table does not become too // large, even if many items are inserted. TEST_F(DatabaseStringTableTest, Prune) { … } } // namespace extensions