chromium/chrome/browser/extensions/activity_log/activity_database_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/activity_log/activity_database.h"

#include <stddef.h>

#include <string>

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/activity_log/activity_action_constants.h"
#include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
#include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/dom_action_types.h"
#include "sql/statement.h"
#include "testing/gtest/include/gtest/gtest.h"

constants;

namespace extensions {

// A dummy implementation of ActivityDatabase::Delegate, sufficient for
// the unit tests.
class ActivityDatabaseTestPolicy : public ActivityDatabase::Delegate {};

const char* const ActivityDatabaseTestPolicy::kTableContentFields[] =;
const char* const ActivityDatabaseTestPolicy::kTableFieldTypes[] =;

bool ActivityDatabaseTestPolicy::InitDatabase(sql::Database* db) {}

bool ActivityDatabaseTestPolicy::FlushDatabase(sql::Database* db) {}

void ActivityDatabaseTestPolicy::Record(ActivityDatabase* db,
                                        scoped_refptr<Action> action) {}

class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness {};

// Check that the database is initialized properly.
TEST_F(ActivityDatabaseTest, Init) {}

// Check that actions are recorded in the db.
TEST_F(ActivityDatabaseTest, RecordAction) {}

TEST_F(ActivityDatabaseTest, BatchModeOff) {}

TEST_F(ActivityDatabaseTest, BatchModeOn) {}

TEST_F(ActivityDatabaseTest, BatchModeFlush) {}

// Check that nothing explodes if the DB isn't initialized.
TEST_F(ActivityDatabaseTest, InitFailure) {}

}  // namespace extensions