| Index: chrome/browser/ui/views/page_info/page_info_popup_view_unittest.cc
|
| diff --git a/chrome/browser/ui/views/page_info/website_settings_popup_view_unittest.cc b/chrome/browser/ui/views/page_info/page_info_popup_view_unittest.cc
|
| similarity index 88%
|
| rename from chrome/browser/ui/views/page_info/website_settings_popup_view_unittest.cc
|
| rename to chrome/browser/ui/views/page_info/page_info_popup_view_unittest.cc
|
| index 00f2047fa6589650b300e4c71b08d1d17c8119ea..5a65aa313fa962b95aed2c5b2a82b3751f22a235 100644
|
| --- a/chrome/browser/ui/views/page_info/website_settings_popup_view_unittest.cc
|
| +++ b/chrome/browser/ui/views/page_info/page_info_popup_view_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
| +#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
|
|
| #include "base/macros.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| @@ -29,11 +29,11 @@ const char* kUrl = "http://www.example.com/index.html";
|
|
|
| namespace test {
|
|
|
| -class WebsiteSettingsPopupViewTestApi {
|
| +class PageInfoPopupViewTestApi {
|
| public:
|
| - WebsiteSettingsPopupViewTestApi(gfx::NativeView parent,
|
| - Profile* profile,
|
| - content::WebContents* web_contents)
|
| + PageInfoPopupViewTestApi(gfx::NativeView parent,
|
| + Profile* profile,
|
| + content::WebContents* web_contents)
|
| : view_(nullptr),
|
| parent_(parent),
|
| profile_(profile),
|
| @@ -47,12 +47,11 @@ class WebsiteSettingsPopupViewTestApi {
|
|
|
| security_state::SecurityInfo security_info;
|
| views::View* anchor_view = nullptr;
|
| - view_ =
|
| - new WebsiteSettingsPopupView(anchor_view, parent_, profile_,
|
| - web_contents_, GURL(kUrl), security_info);
|
| + view_ = new PageInfoPopupView(anchor_view, parent_, profile_, web_contents_,
|
| + GURL(kUrl), security_info);
|
| }
|
|
|
| - WebsiteSettingsPopupView* view() { return view_; }
|
| + PageInfoPopupView* view() { return view_; }
|
| views::View* permissions_view() { return view_->permissions_view_; }
|
|
|
| PermissionSelectorRow* GetPermissionSelectorAt(int index) {
|
| @@ -84,20 +83,20 @@ class WebsiteSettingsPopupViewTestApi {
|
|
|
| // Simulates recreating the dialog with a new PermissionInfoList.
|
| void SetPermissionInfo(const PermissionInfoList& list) {
|
| - for (const WebsiteSettingsPopupView::PermissionInfo& info : list)
|
| + for (const PageInfoPopupView::PermissionInfo& info : list)
|
| view_->presenter_->OnSitePermissionChanged(info.type, info.setting);
|
| CreateView();
|
| }
|
|
|
| private:
|
| - WebsiteSettingsPopupView* view_; // Weak. Owned by its Widget.
|
| + PageInfoPopupView* view_; // Weak. Owned by its Widget.
|
|
|
| // For recreating the view.
|
| gfx::NativeView parent_;
|
| Profile* profile_;
|
| content::WebContents* web_contents_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTestApi);
|
| + DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTestApi);
|
| };
|
|
|
| } // namespace test
|
| @@ -125,9 +124,9 @@ class ScopedWebContentsTestHelper {
|
| DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper);
|
| };
|
|
|
| -class WebsiteSettingsPopupViewTest : public testing::Test {
|
| +class PageInfoPopupViewTest : public testing::Test {
|
| public:
|
| - WebsiteSettingsPopupViewTest() {}
|
| + PageInfoPopupViewTest() {}
|
|
|
| // testing::Test:
|
| void SetUp() override {
|
| @@ -138,7 +137,7 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
|
|
| content::WebContents* web_contents = web_contents_helper_.web_contents();
|
| TabSpecificContentSettings::CreateForWebContents(web_contents);
|
| - api_.reset(new test::WebsiteSettingsPopupViewTestApi(
|
| + api_.reset(new test::PageInfoPopupViewTestApi(
|
| parent_window_->GetNativeView(), web_contents_helper_.profile(),
|
| web_contents));
|
| }
|
| @@ -151,10 +150,10 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
| views::ScopedViewsTestHelper views_helper_;
|
|
|
| views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget.
|
| - std::unique_ptr<test::WebsiteSettingsPopupViewTestApi> api_;
|
| + std::unique_ptr<test::PageInfoPopupViewTestApi> api_;
|
|
|
| private:
|
| - DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTest);
|
| + DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTest);
|
| };
|
|
|
| } // namespace
|
| @@ -177,8 +176,8 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
| constexpr int kViewsPerPermissionRow = 3;
|
|
|
| // Test UI construction and reconstruction via
|
| -// WebsiteSettingsPopupView::SetPermissionInfo().
|
| -TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
| +// PageInfoPopupView::SetPermissionInfo().
|
| +TEST_F(PageInfoPopupViewTest, MAYBE_SetPermissionInfo) {
|
| PermissionInfoList list(1);
|
| list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION;
|
| list.back().source = content_settings::SETTING_SOURCE_USER;
|
| @@ -207,7 +206,7 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
| EXPECT_EQ(base::ASCIIToUTF16("Block"), api_->GetPermissionButtonTextAt(0));
|
|
|
| // Simulate a user selection via the UI. Note this will also cover logic in
|
| - // WebsiteSettings to update the pref.
|
| + // PageInfo to update the pref.
|
| list.back().setting = CONTENT_SETTING_ALLOW;
|
| api_->GetPermissionSelectorAt(0)->PermissionChanged(list.back());
|
| EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
| @@ -226,7 +225,7 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
| }
|
|
|
| // Test UI construction and reconstruction with USB devices.
|
| -TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
| +TEST_F(PageInfoPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
| const int kExpectedChildren =
|
| kViewsPerPermissionRow *
|
| (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13);
|
|
|