chromium/components/commerce/core/bookmark_update_manager_unittest.cc

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

#include <math.h>
#include <map>
#include <memory>
#include <vector>

#include "base/cancelable_callback.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/clock.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/commerce/core/bookmark_update_manager.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/mock_shopping_service.h"
#include "components/commerce/core/pref_names.h"
#include "components/commerce/core/test_utils.h"
#include "components/power_bookmarks/core/power_bookmark_utils.h"
#include "components/power_bookmarks/core/proto/power_bookmark_meta.pb.h"
#include "components/power_bookmarks/core/proto/shopping_specifics.pb.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace commerce {

class BookmarkUpdateManagerTest : public testing::Test {};

// Test that an update is scheduled
TEST_F(BookmarkUpdateManagerTest, UpdateScheduled) {}

// Test that the kill switch blocks updates.
TEST_F(BookmarkUpdateManagerTest, NoUpdateScheduled_KillSwitch) {}

// Ensure that calling ScheduleUpdate multiple times does not affect the
// previously scheduled update.
TEST_F(BookmarkUpdateManagerTest, UpdateNotDoubleScheduled) {}

TEST_F(BookmarkUpdateManagerTest, RunScheduledTask) {}

TEST_F(BookmarkUpdateManagerTest, RunScheduledTask_BlockedByFeatureCheck) {}

// Ensure that updates are handled in batches that the backend can handle. For
// example: if the backend can only handle 30 updates per call, make sure two
// batches are sent.
TEST_F(BookmarkUpdateManagerTest, RunBatchedUpdate) {}

// Same as the above test, but ensures that if a user has more than the max
// allowed updatable bookmarks, we stop updating.
TEST_F(BookmarkUpdateManagerTest, RunBatchedUpdate_OverMaxAllowed) {}

TEST_F(BookmarkUpdateManagerTest, RunBatchedUpdate_BatchingDisabled) {}

}  // namespace commerce