Commit 55c5edfb authored by James Cook's avatar James Cook Committed by Chromium LUCI CQ

Clean up browser_loader_unittest.cc slightly

The component ID is for the dogfood component, not the fishfood one,
so rename the variable. Ditto for component name.

Bug: none
Change-Id: I619a569821d4f670dcd3becda9513d528f808a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618840
Auto-Submit: James Cook <jamescook@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841763}
parent ea3e5390
......@@ -21,6 +21,10 @@ using update_client::UpdateClient;
namespace crosapi {
namespace {
// Copied from browser_loader.cc
constexpr char kLacrosComponentName[] = "lacros-dogfood-dev";
constexpr char kLacrosComponentId[] = "ldobopbhiamakmncndpkeelenhdmgfhk";
// Delegate for testing.
class DelegateImpl : public BrowserLoader::Delegate {
public:
......@@ -52,9 +56,9 @@ TEST_F(BrowserLoaderTest, ShowUpdateNotification) {
// Create dependencies for object under test.
scoped_refptr<component_updater::FakeCrOSComponentManager> component_manager =
base::MakeRefCounted<component_updater::FakeCrOSComponentManager>();
component_manager->set_supported_components({"lacros-fishfood"});
component_manager->set_supported_components({kLacrosComponentName});
component_manager->ResetComponentState(
"lacros-fishfood",
kLacrosComponentName,
component_updater::FakeCrOSComponentManager::ComponentInfo(
component_updater::CrOSComponentManager::Error::NONE,
base::FilePath("/install/path"), base::FilePath("/mount/path")));
......@@ -78,21 +82,20 @@ TEST_F(BrowserLoaderTest, ShowUpdateNotification) {
EXPECT_EQ(0, delegate->set_lacros_update_available_);
// Update check does not trigger an update notification.
constexpr char kLacrosFishfoodId[] = "ldobopbhiamakmncndpkeelenhdmgfhk";
browser_loader.OnEvent(
UpdateClient::Observer::Events::COMPONENT_CHECKING_FOR_UPDATES,
kLacrosFishfoodId);
kLacrosComponentId);
EXPECT_EQ(0, delegate->set_lacros_update_available_);
// Update download does not trigger an update notification.
browser_loader.OnEvent(
UpdateClient::Observer::Events::COMPONENT_UPDATE_DOWNLOADING,
kLacrosFishfoodId);
kLacrosComponentId);
EXPECT_EQ(0, delegate->set_lacros_update_available_);
// Update completion trigger the notification.
browser_loader.OnEvent(UpdateClient::Observer::Events::COMPONENT_UPDATED,
kLacrosFishfoodId);
kLacrosComponentId);
EXPECT_EQ(1, delegate->set_lacros_update_available_);
browser_part.ShutdownCrosComponentManager();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment