| Index: chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc
|
| diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc
|
| index 416ae661ef6da2880da6282c9c335f11390e9ebd..4c78a680f459c29618a817589096c22c6e1ea265 100644
|
| --- a/chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc
|
| +++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view_unittest.cc
|
| @@ -52,11 +52,11 @@ class WebsiteSettingsPopupViewTestApi {
|
| }
|
|
|
| WebsiteSettingsPopupView* view() { return view_; }
|
| - views::View* permissions_content() { return view_->permissions_content_; }
|
| + views::View* permissions_view() { return view_->permissions_view_; }
|
|
|
| PermissionSelectorRow* GetPermissionSelectorAt(int index) {
|
| return static_cast<PermissionSelectorRow*>(
|
| - permissions_content()->child_at(index));
|
| + permissions_view()->child_at(index));
|
| }
|
|
|
| base::string16 GetPermissionButtonTextAt(int index) {
|
| @@ -175,11 +175,11 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
|
|
| const int kExpectedChildren =
|
| ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13;
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
|
|
| list.back().setting = CONTENT_SETTING_ALLOW;
|
| api_->SetPermissionInfo(list);
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
|
|
| PermissionSelectorRow* selector = api_->GetPermissionSelectorAt(0);
|
| EXPECT_EQ(3, selector->child_count());
|
| @@ -190,7 +190,7 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
| selector->child_at(kLabelIndex)->GetClassName());
|
| views::Label* label =
|
| static_cast<views::Label*>(selector->child_at(kLabelIndex));
|
| - EXPECT_EQ(base::ASCIIToUTF16("Location:"), label->text());
|
| + EXPECT_EQ(base::ASCIIToUTF16("Location"), label->text());
|
| EXPECT_EQ(base::ASCIIToUTF16("Allow"), api_->GetPermissionButtonTextAt(0));
|
|
|
| // Verify calling SetPermisisonInfo() directly updates the UI.
|
| @@ -202,26 +202,26 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
| // WebsiteSettings to update the pref.
|
| list.back().setting = CONTENT_SETTING_ALLOW;
|
| api_->GetPermissionSelectorAt(0)->PermissionChanged(list.back());
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
| EXPECT_EQ(base::ASCIIToUTF16("Allow"), api_->GetPermissionButtonTextAt(0));
|
|
|
| // Setting to the default via the UI should keep the button around.
|
| list.back().setting = CONTENT_SETTING_ASK;
|
| api_->GetPermissionSelectorAt(0)->PermissionChanged(list.back());
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
| EXPECT_EQ(base::ASCIIToUTF16("Ask"), api_->GetPermissionButtonTextAt(0));
|
|
|
| // However, since the setting is now default, recreating the dialog with those
|
| // settings should omit the permission from the UI.
|
| api_->SetPermissionInfo(list);
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
| }
|
|
|
| // Test UI construction and reconstruction with USB devices.
|
| TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
| const int kExpectedChildren =
|
| ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13;
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
|
|
| const GURL origin = GURL(kUrl).GetOrigin();
|
| scoped_refptr<device::UsbDevice> device =
|
| @@ -233,10 +233,10 @@ TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
|
|
| PermissionInfoList list;
|
| api_->SetPermissionInfo(list);
|
| - EXPECT_EQ(kExpectedChildren + 1, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren + 1, api_->permissions_view()->child_count());
|
|
|
| ChosenObjectRow* object_view = static_cast<ChosenObjectRow*>(
|
| - api_->permissions_content()->child_at(kExpectedChildren));
|
| + api_->permissions_view()->child_at(kExpectedChildren));
|
| EXPECT_EQ(3, object_view->child_count());
|
|
|
| const int kLabelIndex = 1;
|
| @@ -254,6 +254,6 @@ TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
| static_cast<views::ButtonListener*>(object_view);
|
| button_listener->ButtonPressed(button, event);
|
| api_->SetPermissionInfo(list);
|
| - EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count());
|
| + EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
| EXPECT_FALSE(store->HasDevicePermission(origin, origin, device));
|
| }
|
|
|