| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" | 5 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" |
| 6 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" | 6 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace chrome { | 9 namespace chrome { |
| 10 | 10 |
| 11 class MediaGalleriesDialogTest : public testing::Test, | 11 class MediaGalleriesDialogTest : public testing::Test, |
| 12 public MediaGalleriesDialogController { | 12 public MediaGalleriesDialogController { |
| 13 public: | 13 public: |
| 14 MediaGalleriesDialogTest() : toggles_(0) {} | 14 MediaGalleriesDialogTest() : toggles_(0) {} |
| 15 virtual ~MediaGalleriesDialogTest() {} | 15 virtual ~MediaGalleriesDialogTest() {} |
| 16 | 16 |
| 17 virtual void DialogFinished(bool accepted) OVERRIDE {} | 17 virtual void DialogFinished(bool accepted) OVERRIDE {} |
| 18 virtual void GalleryToggled(const MediaGalleryPrefInfo* pref_info, | 18 virtual void DidToggleGallery(const MediaGalleryPrefInfo* pref_info, |
| 19 bool enabled) OVERRIDE { | 19 bool enabled) OVERRIDE { |
| 20 toggles_++; | 20 toggles_++; |
| 21 MediaGalleriesDialogController::GalleryToggled(pref_info, enabled); | 21 MediaGalleriesDialogController::DidToggleGallery(pref_info, enabled); |
| 22 } | 22 } |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 // Counter that tracks the number of times a checkbox has been toggled. | 25 // Counter that tracks the number of times a checkbox has been toggled. |
| 26 size_t toggles_; | 26 size_t toggles_; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Tests that checkboxes are initialized according to the contents of | 29 // Tests that checkboxes are initialized according to the contents of |
| 30 // |known_galleries|. | 30 // |known_galleries|. |
| 31 TEST_F(MediaGalleriesDialogTest, InitializeCheckboxes) { | 31 TEST_F(MediaGalleriesDialogTest, InitializeCheckboxes) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 MediaGalleryPrefInfo gallery2; | 89 MediaGalleryPrefInfo gallery2; |
| 90 dialog_->UpdateGallery(&gallery2, true); | 90 dialog_->UpdateGallery(&gallery2, true); |
| 91 EXPECT_EQ(2U, dialog_->checkbox_map_.size()); | 91 EXPECT_EQ(2U, dialog_->checkbox_map_.size()); |
| 92 | 92 |
| 93 dialog_->UpdateGallery(&gallery2, false); | 93 dialog_->UpdateGallery(&gallery2, false); |
| 94 EXPECT_EQ(2U, dialog_->checkbox_map_.size()); | 94 EXPECT_EQ(2U, dialog_->checkbox_map_.size()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace chrome | 97 } // namespace chrome |
| OLD | NEW |