Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk_unittest.cc

Issue 12095074: Media Galleries: Keep media gallery permission dialogs in sync with the gallery (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address nits Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/string_number_conversions.h" 5 #include "base/string_number_conversions.h"
6 #include "chrome/browser/system_monitor/media_storage_util.h" 6 #include "chrome/browser/system_monitor/media_storage_util.h"
7 #include "chrome/browser/media_gallery/media_galleries_dialog_controller_mock.h" 7 #include "chrome/browser/media_gallery/media_galleries_dialog_controller_mock.h"
8 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h" 8 #include "chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 EXPECT_EQ(1U, dialog.checkbox_map_.size()); 104 EXPECT_EQ(1U, dialog.checkbox_map_.size());
105 105
106 MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2); 106 MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2);
107 dialog.UpdateGallery(&gallery2, true); 107 dialog.UpdateGallery(&gallery2, true);
108 EXPECT_EQ(2U, dialog.checkbox_map_.size()); 108 EXPECT_EQ(2U, dialog.checkbox_map_.size());
109 109
110 dialog.UpdateGallery(&gallery2, false); 110 dialog.UpdateGallery(&gallery2, false);
111 EXPECT_EQ(2U, dialog.checkbox_map_.size()); 111 EXPECT_EQ(2U, dialog.checkbox_map_.size());
112 } 112 }
113 113
114 TEST_F(MediaGalleriesDialogTest, ForgetDeletes) {
Evan Stade 2013/02/13 00:18:51 comment for this test. Why no equivalent test for
Lei Zhang 2013/02/13 01:51:07 There's no tests for views what so ever.
115 NiceMock<MediaGalleriesDialogControllerMock> controller;
116
117 MediaGalleriesDialogController::KnownGalleryPermissions permissions;
118 EXPECT_CALL(controller, permissions()).
119 WillRepeatedly(ReturnRef(permissions));
120
121 MediaGalleriesDialogGtk dialog(&controller);
122
123 EXPECT_TRUE(dialog.checkbox_map_.empty());
124
125 MediaGalleryPrefInfo gallery1 = MakePrefInfoForTesting(1);
126 dialog.UpdateGallery(&gallery1, true);
127 EXPECT_EQ(1U, dialog.checkbox_map_.size());
128
129 MediaGalleryPrefInfo gallery2 = MakePrefInfoForTesting(2);
130 dialog.UpdateGallery(&gallery2, true);
131 EXPECT_EQ(2U, dialog.checkbox_map_.size());
132
133 dialog.ForgetGallery(&gallery2);
134 EXPECT_EQ(1U, dialog.checkbox_map_.size());
135 }
136
114 } // namespace chrome 137 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698