chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc
// Tests that UpdateGallery will add a new checkbox, but only if it refers to
// a gallery that the dialog hasn't seen before.
Tests that UpdateGallery will add a new checkbox, but only if it refers to
a gallery that the dialog hasn't seen before.
Tests that UpdateGallery will add a new checkbox but only if it refers to a gallery that the dialog hasn ' t seen before .
TEST_F(MediaGalleriesDialogTest, UpdateAdds) {
  NiceMock<MediaGalleriesDialogControllerMock> controller;
  MediaGalleriesDialogController::KnownGalleryPermissions permissions;
  EXPECT_CALL(controller, permissions()).
      WillRepeatedly(ReturnRef(permissions));
  MediaGalleriesDialogGtk dialog(&controller);
  EXPECT_TRUE(dialog.checkbox_map_.empty());
  MediaGalleryPrefInfo gallery1 = MakePrefInfoForTesting(1);
  dialog.UpdateGallery(&gallery1, true);
  EXPECT_EQ(1U, dialog.checkbox_map_.size());
  MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2);
  dialog.UpdateGallery(&gallery2, true);
  EXPECT_EQ(2U, dialog.checkbox_map_.size());
  dialog.UpdateGallery(&gallery2, false);
  EXPECT_EQ(2U, dialog.checkbox_map_.size());
}
TEST_F ( MediaGalleriesDialogTest , UpdateAdds ) { NiceMock < MediaGalleriesDialogControllerMock > controller ; MediaGalleriesDialogController :: KnownGalleryPermissions permissions ; EXPECT_CALL ( controller , permissions ( ) ) . WillRepeatedly ( ReturnRef ( permissions ) ) ; MediaGalleriesDialogGtk dialog ( & controller ) ; EXPECT_TRUE ( dialog . checkbox_map_ . empty ( ) ) ; MediaGalleryPrefInfo gallery1 = MakePrefInfoForTesting ( 1 ) ; dialog . UpdateGallery ( & gallery1 , true ) ; EXPECT_EQ ( 1U , dialog . checkbox_map_ . size ( ) ) ; MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting ( 2 ) ; dialog . UpdateGallery ( & gallery2 , true ) ; EXPECT_EQ ( 2U , dialog . checkbox_map_ . size ( ) ) ; dialog . UpdateGallery ( & gallery2 , false ) ; EXPECT_EQ ( 2U , dialog . checkbox_map_ . size ( ) ) ; }
Tests that UpdateGallery will add a new checkbox, but only if it refers to
a gallery that the dialog hasn't seen before.
Tests that UpdateGallery will add a new checkbox but only if it refers to a gallery that the dialog hasn ' t seen before .