| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.
h" | 7 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.
h" |
| 8 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" | 8 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" |
| 9 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" | 9 #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" |
| 10 #include "components/storage_monitor/storage_info.h" | 10 #include "components/storage_monitor/storage_info.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 gallery.display_name = base::ASCIIToUTF16("Display Name"); | 29 gallery.display_name = base::ASCIIToUTF16("Display Name"); |
| 30 return gallery; | 30 return gallery; |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 class MediaGalleriesDialogTest : public testing::Test { | 35 class MediaGalleriesDialogTest : public testing::Test { |
| 36 public: | 36 public: |
| 37 MediaGalleriesDialogTest() {} | 37 MediaGalleriesDialogTest() {} |
| 38 virtual ~MediaGalleriesDialogTest() {} | 38 virtual ~MediaGalleriesDialogTest() {} |
| 39 virtual void SetUp() OVERRIDE { | 39 virtual void SetUp() override { |
| 40 std::vector<base::string16> headers; | 40 std::vector<base::string16> headers; |
| 41 headers.push_back(base::string16()); | 41 headers.push_back(base::string16()); |
| 42 headers.push_back(base::ASCIIToUTF16("header2")); | 42 headers.push_back(base::ASCIIToUTF16("header2")); |
| 43 ON_CALL(controller_, GetSectionHeaders()). | 43 ON_CALL(controller_, GetSectionHeaders()). |
| 44 WillByDefault(Return(headers)); | 44 WillByDefault(Return(headers)); |
| 45 EXPECT_CALL(controller_, GetSectionEntries(_)). | 45 EXPECT_CALL(controller_, GetSectionEntries(_)). |
| 46 Times(AnyNumber()); | 46 Times(AnyNumber()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual void TearDown() OVERRIDE { | 49 virtual void TearDown() override { |
| 50 Mock::VerifyAndClearExpectations(&controller_); | 50 Mock::VerifyAndClearExpectations(&controller_); |
| 51 } | 51 } |
| 52 | 52 |
| 53 NiceMock<MediaGalleriesDialogControllerMock>* controller() { | 53 NiceMock<MediaGalleriesDialogControllerMock>* controller() { |
| 54 return &controller_; | 54 return &controller_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // TODO(gbillock): Get rid of this mock; make something specialized. | 58 // TODO(gbillock): Get rid of this mock; make something specialized. |
| 59 NiceMock<MediaGalleriesDialogControllerMock> controller_; | 59 NiceMock<MediaGalleriesDialogControllerMock> controller_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2); | 152 MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2); |
| 153 attached_permissions.push_back( | 153 attached_permissions.push_back( |
| 154 MediaGalleriesDialogController::Entry(gallery2, true)); | 154 MediaGalleriesDialogController::Entry(gallery2, true)); |
| 155 dialog.UpdateGalleries(); | 155 dialog.UpdateGalleries(); |
| 156 EXPECT_EQ(2U, dialog.checkbox_map_.size()); | 156 EXPECT_EQ(2U, dialog.checkbox_map_.size()); |
| 157 | 157 |
| 158 attached_permissions.pop_back(); | 158 attached_permissions.pop_back(); |
| 159 dialog.UpdateGalleries(); | 159 dialog.UpdateGalleries(); |
| 160 EXPECT_EQ(1U, dialog.checkbox_map_.size()); | 160 EXPECT_EQ(1U, dialog.checkbox_map_.size()); |
| 161 } | 161 } |
| OLD | NEW |