OLD | NEW |
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/exclusive_access/exclusive_access_manager.h" | 8 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
9 #include "chrome/browser/ui/views/website_settings/chosen_object_view.h" | 9 #include "chrome/browser/ui/views/website_settings/chosen_object_view.h" |
10 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" | 10 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 void TearDown() override { parent_window_->CloseNow(); } | 144 void TearDown() override { parent_window_->CloseNow(); } |
145 | 145 |
146 protected: | 146 protected: |
147 TestDeviceClient device_client_; | 147 TestDeviceClient device_client_; |
148 ScopedWebContentsTestHelper web_contents_helper_; | 148 ScopedWebContentsTestHelper web_contents_helper_; |
149 views::ScopedViewsTestHelper views_helper_; | 149 views::ScopedViewsTestHelper views_helper_; |
150 | 150 |
151 views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget. | 151 views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget. |
152 scoped_ptr<test::WebsiteSettingsPopupViewTestApi> api_; | 152 std::unique_ptr<test::WebsiteSettingsPopupViewTestApi> api_; |
153 | 153 |
154 private: | 154 private: |
155 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTest); | 155 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTest); |
156 }; | 156 }; |
157 | 157 |
158 } // namespace | 158 } // namespace |
159 | 159 |
160 // Test UI construction and reconstruction via | 160 // Test UI construction and reconstruction via |
161 // WebsiteSettingsPopupView::SetPermissionInfo(). | 161 // WebsiteSettingsPopupView::SetPermissionInfo(). |
162 TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfo) { | 162 TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfo) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 247 const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), |
248 ui::EventTimeForNow(), 0, 0); | 248 ui::EventTimeForNow(), 0, 0); |
249 views::ButtonListener* button_listener = | 249 views::ButtonListener* button_listener = |
250 static_cast<views::ButtonListener*>(object_view); | 250 static_cast<views::ButtonListener*>(object_view); |
251 button_listener->ButtonPressed(button, event); | 251 button_listener->ButtonPressed(button, event); |
252 api_->SetPermissionInfo(list); | 252 api_->SetPermissionInfo(list); |
253 EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count()); | 253 EXPECT_EQ(kExpectedChildren, api_->permissions_content()->child_count()); |
254 EXPECT_FALSE(store->HasDevicePermission( | 254 EXPECT_FALSE(store->HasDevicePermission( |
255 origin, origin, *device::usb::DeviceInfo::From(*device))); | 255 origin, origin, *device::usb::DeviceInfo::From(*device))); |
256 } | 256 } |
OLD | NEW |