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

Side by Side Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc

Issue 1575623002: Disable Web Notifications in Incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permfix
Patch Set: No Profile* in WebsiteSettingsPopupView Created 4 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/views/website_settings/website_settings_popup_view.h " 5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/ui/views/website_settings/chosen_object_view.h" 8 #include "chrome/browser/ui/views/website_settings/chosen_object_view.h"
9 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" 9 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h"
10 #include "chrome/browser/usb/usb_chooser_context.h" 10 #include "chrome/browser/usb/usb_chooser_context.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 }; 154 };
155 155
156 } // namespace 156 } // namespace
157 157
158 // Test UI construction and reconstruction via 158 // Test UI construction and reconstruction via
159 // WebsiteSettingsPopupView::SetPermissionInfo(). 159 // WebsiteSettingsPopupView::SetPermissionInfo().
160 TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfo) { 160 TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfo) {
161 PermissionInfoList list(1); 161 PermissionInfoList list(1);
162 list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION; 162 list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION;
163 list.back().source = content_settings::SETTING_SOURCE_USER; 163 list.back().source = content_settings::SETTING_SOURCE_USER;
164 list.back().is_incognito = false;
164 165
165 EXPECT_EQ(0, api_->permissions_content()->child_count()); 166 EXPECT_EQ(0, api_->permissions_content()->child_count());
166 167
167 list.back().setting = CONTENT_SETTING_ALLOW; 168 list.back().setting = CONTENT_SETTING_ALLOW;
168 api_->SetPermissionInfo(list); 169 api_->SetPermissionInfo(list);
169 EXPECT_EQ(1, api_->permissions_content()->child_count()); 170 EXPECT_EQ(1, api_->permissions_content()->child_count());
170 171
171 PermissionSelectorView* selector = api_->GetPermissionSelectorAt(0); 172 PermissionSelectorView* selector = api_->GetPermissionSelectorAt(0);
172 EXPECT_EQ(3, selector->child_count()); 173 EXPECT_EQ(3, selector->child_count());
173 174
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 240
240 const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 241 const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
241 ui::EventTimeForNow(), 0, 0); 242 ui::EventTimeForNow(), 0, 0);
242 views::ButtonListener* button_listener = 243 views::ButtonListener* button_listener =
243 static_cast<views::ButtonListener*>(object_view); 244 static_cast<views::ButtonListener*>(object_view);
244 button_listener->ButtonPressed(button, event); 245 button_listener->ButtonPressed(button, event);
245 api_->SetPermissionInfo(list); 246 api_->SetPermissionInfo(list);
246 EXPECT_EQ(0, api_->permissions_content()->child_count()); 247 EXPECT_EQ(0, api_->permissions_content()->child_count());
247 EXPECT_FALSE(store->HasDevicePermission(url, url, device->guid())); 248 EXPECT_FALSE(store->HasDevicePermission(url, url, device->guid()));
248 } 249 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698