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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_unittest.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests by instanciating a TestConfirmInfoBarDelegateFactory Created 6 years 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 (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/message_loop.h" 8 #include "base/message_loop/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"
11 #include "chrome/browser/infobars/infobar_service.h" 11 #include "chrome/browser/infobars/infobar_service.h"
12 #include "chrome/browser/ui/website_settings/website_settings_ui.h" 12 #include "chrome/browser/ui/website_settings/website_settings_ui.h"
13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
14 #include "chrome/test/base/testing_profile.h" 14 #include "chrome/test/base/testing_profile.h"
15 #include "components/content_settings/core/browser/host_content_settings_map.h" 15 #include "components/content_settings/core/browser/host_content_settings_map.h"
16 #include "components/content_settings/core/common/content_settings.h" 16 #include "components/content_settings/core/common/content_settings.h"
17 #include "components/content_settings/core/common/content_settings_types.h" 17 #include "components/content_settings/core/common/content_settings_types.h"
18 #include "components/infobars/core/infobar.h" 18 #include "components/infobars/core/infobar.h"
19 #include "components/infobars/test/test_confirm_infobar_delegate_factory.h"
19 #include "content/public/browser/cert_store.h" 20 #include "content/public/browser/cert_store.h"
20 #include "content/public/common/ssl_status.h" 21 #include "content/public/common/ssl_status.h"
21 #include "net/cert/cert_status_flags.h" 22 #include "net/cert/cert_status_flags.h"
22 #include "net/cert/x509_certificate.h" 23 #include "net/cert/x509_certificate.h"
23 #include "net/ssl/ssl_connection_status_flags.h" 24 #include "net/ssl/ssl_connection_status_flags.h"
24 #include "net/test/test_certificate_data.h" 25 #include "net/test/test_certificate_data.h"
25 #include "testing/gmock/include/gmock/gmock.h" 26 #include "testing/gmock/include/gmock/gmock.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 28
28 using content::SSLStatus; 29 using content::SSLStatus;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 143
143 SSLStatus ssl_; 144 SSLStatus ssl_;
144 145
145 private: 146 private:
146 scoped_ptr<WebsiteSettings> website_settings_; 147 scoped_ptr<WebsiteSettings> website_settings_;
147 scoped_ptr<MockWebsiteSettingsUI> mock_ui_; 148 scoped_ptr<MockWebsiteSettingsUI> mock_ui_;
148 int cert_id_; 149 int cert_id_;
149 scoped_refptr<net::X509Certificate> cert_; 150 scoped_refptr<net::X509Certificate> cert_;
150 MockCertStore cert_store_; 151 MockCertStore cert_store_;
151 GURL url_; 152 GURL url_;
153 TestConfirmInfoBarDelegateFactory confirm_info_bar_delegate_factory_;
152 }; 154 };
153 155
154 } // namespace 156 } // namespace
155 157
156 TEST_F(WebsiteSettingsTest, OnPermissionsChanged) { 158 TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
157 // Setup site permissions. 159 // Setup site permissions.
158 HostContentSettingsMap* content_settings = 160 HostContentSettingsMap* content_settings =
159 profile()->GetHostContentSettingsMap(); 161 profile()->GetHostContentSettingsMap();
160 ContentSetting setting = content_settings->GetContentSetting( 162 ContentSetting setting = content_settings->GetContentSetting(
161 url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string()); 163 url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string());
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 407
406 TEST_F(WebsiteSettingsTest, InternalPage) { 408 TEST_F(WebsiteSettingsTest, InternalPage) {
407 SetURL("chrome://bookmarks"); 409 SetURL("chrome://bookmarks");
408 SetDefaultUIExpectations(mock_ui()); 410 SetDefaultUIExpectations(mock_ui());
409 EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE, 411 EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE,
410 website_settings()->site_connection_status()); 412 website_settings()->site_connection_status());
411 EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE, 413 EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE,
412 website_settings()->site_identity_status()); 414 website_settings()->site_identity_status());
413 EXPECT_EQ(base::string16(), website_settings()->organization_name()); 415 EXPECT_EQ(base::string16(), website_settings()->organization_name());
414 } 416 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698