OLD | NEW |
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 "chrome/browser/ui/website_settings/website_settings.h" | 5 #include "chrome/browser/ui/website_settings/website_settings.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 MOCK_METHOD1(SetCookieInfo, void(const CookieInfoList& cookie_info_list)); | 67 MOCK_METHOD1(SetCookieInfo, void(const CookieInfoList& cookie_info_list)); |
68 MOCK_METHOD1(SetPermissionInfo, | 68 MOCK_METHOD1(SetPermissionInfo, |
69 void(const PermissionInfoList& permission_info_list)); | 69 void(const PermissionInfoList& permission_info_list)); |
70 MOCK_METHOD1(SetIdentityInfo, void(const IdentityInfo& identity_info)); | 70 MOCK_METHOD1(SetIdentityInfo, void(const IdentityInfo& identity_info)); |
71 MOCK_METHOD1(SetFirstVisit, void(const string16& first_visit)); | 71 MOCK_METHOD1(SetFirstVisit, void(const string16& first_visit)); |
72 MOCK_METHOD1(SetSelectedTab, void(TabId tab_id)); | 72 MOCK_METHOD1(SetSelectedTab, void(TabId tab_id)); |
73 }; | 73 }; |
74 | 74 |
75 class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness { | 75 class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness { |
76 public: | 76 public: |
77 WebsiteSettingsTest() | 77 WebsiteSettingsTest() : cert_id_(0), url_("http://www.example.com") {} |
78 : website_settings_(NULL), | |
79 mock_ui_(NULL), | |
80 cert_id_(0), | |
81 url_("http://www.example.com") { | |
82 } | |
83 | 78 |
84 virtual ~WebsiteSettingsTest() { | 79 virtual ~WebsiteSettingsTest() { |
85 } | 80 } |
86 | 81 |
87 virtual void SetUp() { | 82 virtual void SetUp() { |
88 ChromeRenderViewHostTestHarness::SetUp(); | 83 ChromeRenderViewHostTestHarness::SetUp(); |
89 // Setup stub SSLStatus. | 84 // Setup stub SSLStatus. |
90 ssl_.security_style = content::SECURITY_STYLE_UNAUTHENTICATED; | 85 ssl_.security_style = content::SECURITY_STYLE_UNAUTHENTICATED; |
91 | 86 |
92 // Create the certificate. | 87 // Create the certificate. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW); | 390 CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW); |
396 website_settings()->OnUIClosing(); | 391 website_settings()->OnUIClosing(); |
397 EXPECT_EQ(1u, infobar_service()->infobar_count()); | 392 EXPECT_EQ(1u, infobar_service()->infobar_count()); |
398 | 393 |
399 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete | 394 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete |
400 // it. Hence the |delegate| must be cleaned up after it was removed from the | 395 // it. Hence the |delegate| must be cleaned up after it was removed from the |
401 // |infobar_service|. | 396 // |infobar_service|. |
402 scoped_ptr<InfoBarDelegate> delegate(infobar_service()->infobar_at(0)); | 397 scoped_ptr<InfoBarDelegate> delegate(infobar_service()->infobar_at(0)); |
403 infobar_service()->RemoveInfoBar(delegate.get()); | 398 infobar_service()->RemoveInfoBar(delegate.get()); |
404 } | 399 } |
OLD | NEW |