chromium/third_party/blink/renderer/modules/storage/cached_storage_area_test.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 "third_party/blink/renderer/modules/storage/cached_storage_area.h"

#include <tuple>

#include "base/memory/scoped_refptr.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/modules/storage/storage_controller.h"
#include "third_party/blink/renderer/modules/storage/storage_namespace.h"
#include "third_party/blink/renderer/modules/storage/testing/fake_area_source.h"
#include "third_party/blink/renderer/modules/storage/testing/mock_storage_area.h"
#include "third_party/blink/renderer/platform/testing/scoped_mocked_url.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink {

FormatOption;
ElementsAre;
UnorderedElementsAre;

class CachedStorageAreaTest : public testing::Test {};

class CachedStorageAreaTestWithParam
    : public CachedStorageAreaTest,
      public testing::WithParamInterface<bool> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(CachedStorageAreaTestWithParam, Basics) {}

TEST_P(CachedStorageAreaTestWithParam, GetLength) {}

TEST_P(CachedStorageAreaTestWithParam, GetKey) {}

TEST_P(CachedStorageAreaTestWithParam, GetItem) {}

TEST_P(CachedStorageAreaTestWithParam, SetItem) {}

// Verify that regardless of how many times `SetItem` is called in one task,
// only one checkpoint is generated.
TEST_P(CachedStorageAreaTestWithParam, SetItemCheckpoints) {}

TEST_P(CachedStorageAreaTestWithParam, Clear_AlreadyEmpty) {}

TEST_P(CachedStorageAreaTestWithParam, Clear_WithData) {}

TEST_P(CachedStorageAreaTestWithParam, RemoveItem_NothingToRemove) {}

TEST_P(CachedStorageAreaTestWithParam, RemoveItem) {}

TEST_P(CachedStorageAreaTestWithParam, BrowserDisconnect) {}

TEST_P(CachedStorageAreaTestWithParam, ResetConnectionWithNoDelta) {}

TEST_P(CachedStorageAreaTestWithParam, ResetConnectionWithKeyDiff) {}

TEST_P(CachedStorageAreaTestWithParam, ResetConnectionWithMissingBackendKey) {}

TEST_P(CachedStorageAreaTestWithParam, ResetConnectionWithMissingLocalKey) {}

TEST_P(CachedStorageAreaTestWithParam, ResetConnectionWithComplexDiff) {}

TEST_F(CachedStorageAreaTest, KeyMutationsAreIgnoredUntilCompletion) {}

TEST_F(CachedStorageAreaTest, ChangeEvents) {}

TEST_F(CachedStorageAreaTest, RevertOnChangeFailed) {}

TEST_F(CachedStorageAreaTest, RevertOnChangeFailedWithSubsequentChanges) {}

TEST_F(CachedStorageAreaTest, RevertOnConsecutiveChangeFailures) {}

TEST_F(CachedStorageAreaTest, RevertOnChangeFailedWithNonLocalChanges) {}

TEST_F(CachedStorageAreaTest, RevertOnChangeFailedAfterNonLocalClear) {}

namespace {

class StringEncoding : public CachedStorageAreaTest,
                       public testing::WithParamInterface<FormatOption> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(StringEncoding, RoundTrip_ASCII) {}

TEST_P(StringEncoding, RoundTrip_Latin1) {}

TEST_P(StringEncoding, RoundTrip_UTF16) {}

TEST_P(StringEncoding, RoundTrip_InvalidUTF16) {}

}  // namespace

TEST_F(CachedStorageAreaTest, StringEncoding_LocalStorage) {}

TEST_F(CachedStorageAreaTest, StringEncoding_UTF8) {}

TEST_F(CachedStorageAreaTest, StringEncoding_UTF16) {}

TEST_F(CachedStorageAreaTest, RecoveryWhenNoLocalDOMWindowPresent) {}

}  // namespace blink