OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/string16.h" | 5 #include "base/string16.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "content/browser/site_instance.h" | 8 #include "content/browser/site_instance.h" |
9 #include "content/browser/tab_contents/navigation_entry.h" | 9 #include "content/browser/tab_contents/navigation_entry.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 EXPECT_EQ(SECURITY_STYLE_UNKNOWN, entry2_.get()->ssl().security_style()); | 106 EXPECT_EQ(SECURITY_STYLE_UNKNOWN, entry2_.get()->ssl().security_style()); |
107 EXPECT_EQ(0, entry1_.get()->ssl().cert_id()); | 107 EXPECT_EQ(0, entry1_.get()->ssl().cert_id()); |
108 EXPECT_EQ(0, entry1_.get()->ssl().cert_status()); | 108 EXPECT_EQ(0, entry1_.get()->ssl().cert_status()); |
109 EXPECT_EQ(-1, entry1_.get()->ssl().security_bits()); | 109 EXPECT_EQ(-1, entry1_.get()->ssl().security_bits()); |
110 EXPECT_FALSE(entry1_.get()->ssl().displayed_insecure_content()); | 110 EXPECT_FALSE(entry1_.get()->ssl().displayed_insecure_content()); |
111 EXPECT_FALSE(entry1_.get()->ssl().ran_insecure_content()); | 111 EXPECT_FALSE(entry1_.get()->ssl().ran_insecure_content()); |
112 | 112 |
113 // Change from the defaults | 113 // Change from the defaults |
114 entry2_.get()->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATED); | 114 entry2_.get()->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATED); |
115 entry2_.get()->ssl().set_cert_id(4); | 115 entry2_.get()->ssl().set_cert_id(4); |
116 entry2_.get()->ssl().set_cert_status(net::CERT_STATUS_COMMON_NAME_INVALID); | 116 entry2_.get()->ssl().set_cert_status(1); |
117 entry2_.get()->ssl().set_security_bits(0); | 117 entry2_.get()->ssl().set_security_bits(0); |
118 entry2_.get()->ssl().set_displayed_insecure_content(); | 118 entry2_.get()->ssl().set_displayed_insecure_content(); |
119 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, | 119 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, |
120 entry2_.get()->ssl().security_style()); | 120 entry2_.get()->ssl().security_style()); |
121 EXPECT_EQ(4, entry2_.get()->ssl().cert_id()); | 121 EXPECT_EQ(4, entry2_.get()->ssl().cert_id()); |
122 EXPECT_EQ(net::CERT_STATUS_COMMON_NAME_INVALID, | 122 EXPECT_EQ(1, entry2_.get()->ssl().cert_status()); |
123 entry2_.get()->ssl().cert_status()); | |
124 EXPECT_EQ(0, entry2_.get()->ssl().security_bits()); | 123 EXPECT_EQ(0, entry2_.get()->ssl().security_bits()); |
125 EXPECT_TRUE(entry2_.get()->ssl().displayed_insecure_content()); | 124 EXPECT_TRUE(entry2_.get()->ssl().displayed_insecure_content()); |
126 | 125 |
127 entry2_.get()->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); | 126 entry2_.get()->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); |
128 entry2_.get()->ssl().set_ran_insecure_content(); | 127 entry2_.get()->ssl().set_ran_insecure_content(); |
129 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, | 128 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, |
130 entry2_.get()->ssl().security_style()); | 129 entry2_.get()->ssl().security_style()); |
131 EXPECT_TRUE(entry2_.get()->ssl().ran_insecure_content()); | 130 EXPECT_TRUE(entry2_.get()->ssl().ran_insecure_content()); |
132 } | 131 } |
133 | 132 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 EXPECT_FALSE(entry2_.get()->has_post_data()); | 179 EXPECT_FALSE(entry2_.get()->has_post_data()); |
181 entry2_.get()->set_has_post_data(true); | 180 entry2_.get()->set_has_post_data(true); |
182 EXPECT_TRUE(entry2_.get()->has_post_data()); | 181 EXPECT_TRUE(entry2_.get()->has_post_data()); |
183 | 182 |
184 // Restored | 183 // Restored |
185 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry1_->restore_type()); | 184 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry1_->restore_type()); |
186 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry2_->restore_type()); | 185 EXPECT_EQ(NavigationEntry::RESTORE_NONE, entry2_->restore_type()); |
187 entry2_->set_restore_type(NavigationEntry::RESTORE_LAST_SESSION); | 186 entry2_->set_restore_type(NavigationEntry::RESTORE_LAST_SESSION); |
188 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, entry2_->restore_type()); | 187 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, entry2_->restore_type()); |
189 } | 188 } |
OLD | NEW |