| 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/page_info/page_info.h" | 5 #include "chrome/browser/ui/page_info/page_info.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 SetDefaultUIExpectations(mock_ui()); | 696 SetDefaultUIExpectations(mock_ui()); |
| 697 EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED, | 697 EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED, |
| 698 page_info()->site_connection_status()); | 698 page_info()->site_connection_status()); |
| 699 EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_NO_CERT, | 699 EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_NO_CERT, |
| 700 page_info()->site_identity_status()); | 700 page_info()->site_identity_status()); |
| 701 EXPECT_EQ(base::string16(), page_info()->organization_name()); | 701 EXPECT_EQ(base::string16(), page_info()->organization_name()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 // On desktop, internal URLs aren't handled by PageInfo class. Instead, a | 704 // On desktop, internal URLs aren't handled by PageInfo class. Instead, a |
| 705 // custom and simpler bubble is shown, so no need to test. | 705 // custom and simpler bubble is shown, so no need to test. |
| 706 #if defined(OS_ANDROID) || defined(OS_IOS) | 706 #if defined(OS_ANDROID) |
| 707 TEST_F(PageInfoTest, InternalPage) { | 707 TEST_F(PageInfoTest, InternalPage) { |
| 708 SetURL("chrome://bookmarks"); | 708 SetURL("chrome://bookmarks"); |
| 709 SetDefaultUIExpectations(mock_ui()); | 709 SetDefaultUIExpectations(mock_ui()); |
| 710 EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE, | 710 EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE, |
| 711 page_info()->site_connection_status()); | 711 page_info()->site_connection_status()); |
| 712 EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE, | 712 EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE, |
| 713 page_info()->site_identity_status()); | 713 page_info()->site_identity_status()); |
| 714 EXPECT_EQ(base::string16(), page_info()->organization_name()); | 714 EXPECT_EQ(base::string16(), page_info()->organization_name()); |
| 715 } | 715 } |
| 716 #endif | 716 #endif |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 // Now, simulate activation on that origin, which is encoded by the existence | 796 // Now, simulate activation on that origin, which is encoded by the existence |
| 797 // of the website setting. The setting should then appear in page_info. | 797 // of the website setting. The setting should then appear in page_info. |
| 798 HostContentSettingsMap* content_settings = | 798 HostContentSettingsMap* content_settings = |
| 799 HostContentSettingsMapFactory::GetForProfile(profile()); | 799 HostContentSettingsMapFactory::GetForProfile(profile()); |
| 800 content_settings->SetWebsiteSettingDefaultScope( | 800 content_settings->SetWebsiteSettingDefaultScope( |
| 801 url(), GURL(), CONTENT_SETTINGS_TYPE_ADS_DATA, std::string(), | 801 url(), GURL(), CONTENT_SETTINGS_TYPE_ADS_DATA, std::string(), |
| 802 base::MakeUnique<base::DictionaryValue>()); | 802 base::MakeUnique<base::DictionaryValue>()); |
| 803 page_info(); | 803 page_info(); |
| 804 EXPECT_TRUE(showing_setting(last_permission_info_list())); | 804 EXPECT_TRUE(showing_setting(last_permission_info_list())); |
| 805 } | 805 } |
| OLD | NEW |