chromium/content/browser/database_browsertest.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 "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"

namespace content {

// WebSQL is disabled everywhere except Android WebView (crbug.com/333756088).
#if !BUILDFLAG(IS_ANDROID)
#define MAYBE_DatabaseTest
#else
#define MAYBE_DatabaseTest
#endif
class MAYBE_DatabaseTest : public ContentBrowserTest {};

// Insert records to the database.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, InsertRecord) {}

// Update records in the database.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, UpdateRecord) {}

// Delete records in the database.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, DeleteRecord) {}

// Attempts to delete a nonexistent row in the table.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, DeleteNonexistentRow) {}

// Insert, update, and delete records in the database.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, DatabaseOperations) {}

// Create records in the database and verify they persist after reload.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, ReloadPage) {}

// Attempt to read a database created in a regular browser from an off the
// record browser.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest,
                       OffTheRecordCannotReadRegularDatabase) {}

// Attempt to read a database created in an off the record browser from a
// regular browser.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest,
                       RegularCannotReadOffTheRecordDatabase) {}

// Verify DB changes within first window are present in the second window.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, ModificationPersistInSecondTab) {}

// Verify database modifications persist after restarting browser.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, PRE_DatabasePersistsAfterRelaunch) {}

IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, DatabasePersistsAfterRelaunch) {}

// Verify OTR database is removed after OTR window closes.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest,
                       PRE_OffTheRecordDatabaseNotPersistent) {}

IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest, OffTheRecordDatabaseNotPersistent) {}

// Verify database modifications persist after crashing window.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest,
                       ModificationsPersistAfterRendererCrash) {}

// Test to check if database modifications are persistent across windows in
// off the record window.
IN_PROC_BROWSER_TEST_F(MAYBE_DatabaseTest,
                       OffTheRecordDBPersistentAcrossWindows) {}

}  // namespace content