Skip to content

Commit

Permalink
Remove bookmark related SingleClientWebAppsSyncTests
Browse files Browse the repository at this point in the history
Bug: 1065748
Change-Id: I719eb68bbfef9918f02fda411a0c00ad04d4fbce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4108552
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084542}
  • Loading branch information
htalat authored and Chromium LUCI CQ committed Dec 16, 2022
1 parent 59120af commit 9fd281c
Showing 1 changed file with 0 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "components/sync/driver/sync_user_settings.h"
#include "components/sync/protocol/app_specifics.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/extension_specifics.pb.h"
#include "components/sync/test/fake_server_verifier.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
Expand All @@ -43,9 +42,6 @@ namespace {
// Default time (creation and last modified) used when creating entities.
const int64_t kDefaultTime = 1234L;

// Default version used when creating extension entities.
const char kVersion[] = "1.0.0.1";

class SingleClientWebAppsSyncTest : public WebAppsSyncTestBase {
public:
SingleClientWebAppsSyncTest() : WebAppsSyncTestBase(SINGLE_CLIENT) {}
Expand Down Expand Up @@ -98,24 +94,6 @@ class SingleClientWebAppsSyncTest : public WebAppsSyncTestBase {
/*non_unique_name=*/"", app_id, entity_specifics, kDefaultTime,
kDefaultTime));
}

// TODO(crbug.com/1065748): remove this function and any tests.
void InjectBookmarkAppEntityToFakeServer(const std::string& app_id,
const std::string& url) {
sync_pb::EntitySpecifics entity;
sync_pb::AppSpecifics* app_specifics = entity.mutable_app();

sync_pb::ExtensionSpecifics* extension_specifics =
app_specifics->mutable_extension();
// Required fields for a valid ExtensionSpecifics
extension_specifics->set_id(app_id);
extension_specifics->set_update_url(url);
extension_specifics->set_version(kVersion);
fake_server_->InjectEntity(
syncer::PersistentUniqueClientEntity::CreateFromSpecificsForTesting(
/*non_unique_name=*/"", app_id, entity, kDefaultTime,
kDefaultTime));
}
};

IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
Expand Down Expand Up @@ -158,55 +136,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
EXPECT_TRUE(web_app_registrar.IsInstalled(app_id));
}

IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
PRE_BookmarkAppNotSyncInstalled) {
std::string url = "https://example.com/";
const std::string app_id =
GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(url));
InjectBookmarkAppEntityToFakeServer(app_id, url);
ASSERT_TRUE(SetupSync());
AwaitWebAppQuiescence();
auto& web_app_registrar =
WebAppProvider::GetForTest(GetProfile(0))->registrar_unsafe();

EXPECT_EQ(web_app_registrar.GetAppById(app_id), nullptr);
}

// Make sure bookmark app is not installed by BMO migration on
// re-initialization.
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
BookmarkAppNotSyncInstalled) {
std::string url = "https://example.com/";
const std::string app_id =
GenerateAppId(/*manifest_id=*/absl::nullopt, GURL(url));
ASSERT_TRUE(SetupSync());
AwaitWebAppQuiescence();
auto& web_app_registrar =
WebAppProvider::GetForTest(GetProfile(0))->registrar_unsafe();

EXPECT_FALSE(web_app_registrar.IsInstalled(app_id));
}

// Web app install should not commit APPS sync entity.
IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
AppInstallDoNotSyncBookmarkApp) {
ASSERT_TRUE(SetupSync());
WebAppInstallInfo info;
std::string name = "Test name";
info.title = base::UTF8ToUTF16(name);
info.description = u"Test description";
info.start_url = GURL("http://www.chromium.org/path");
info.scope = GURL("http://www.chromium.org/");
AppId app_id = apps_helper::InstallWebApp(GetProfile(0), info);
ASSERT_TRUE(SetupSync());

fake_server::FakeServerVerifier fake_server_verifier(fake_server_.get());
EXPECT_TRUE(fake_server_verifier.VerifyEntityCountByTypeAndName(
1, syncer::WEB_APPS, name));
EXPECT_TRUE(fake_server_verifier.VerifyEntityCountByTypeAndName(
0, syncer::APPS, name));
}

IN_PROC_BROWSER_TEST_F(SingleClientWebAppsSyncTest,
AppWithMalformedIdNotSyncInstalled) {
const std::string app_id = "invalid_id";
Expand Down

0 comments on commit 9fd281c

Please sign in to comment.