Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/options/cookies_view.h" | 5 #include "chrome/browser/gtk/options/cookies_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 new MockBrowsingDataLocalStorageHelper(profile_.get()); | 36 new MockBrowsingDataLocalStorageHelper(profile_.get()); |
| 37 mock_browsing_data_appcache_helper_ = | 37 mock_browsing_data_appcache_helper_ = |
| 38 new MockBrowsingDataAppCacheHelper(profile_.get()); | 38 new MockBrowsingDataAppCacheHelper(profile_.get()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void CheckDetailsSensitivity(gboolean expected_cookies, | 41 void CheckDetailsSensitivity(gboolean expected_cookies, |
| 42 gboolean expected_database, | 42 gboolean expected_database, |
| 43 gboolean expected_local_storage, | 43 gboolean expected_local_storage, |
| 44 gboolean expected_appcache, | 44 gboolean expected_appcache, |
| 45 const CookiesView& cookies_view) { | 45 const CookiesView& cookies_view) { |
| 46 GtkChromeCookieView* display = GTK_CHROME_COOKIE_VIEW( | |
| 47 cookies_view.cookie_display_); | |
| 48 | |
| 46 // Cookies | 49 // Cookies |
| 47 EXPECT_EQ(expected_cookies, | 50 EXPECT_EQ(expected_cookies, |
| 48 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 51 GTK_WIDGET_SENSITIVE(display->cookie_name_entry_)); |
| 49 cookie_name_entry_)); | |
| 50 EXPECT_EQ(expected_cookies, | 52 EXPECT_EQ(expected_cookies, |
| 51 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 53 GTK_WIDGET_SENSITIVE(display->cookie_content_entry_)); |
| 52 cookie_content_entry_)); | |
| 53 EXPECT_EQ(expected_cookies, | 54 EXPECT_EQ(expected_cookies, |
| 54 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 55 GTK_WIDGET_SENSITIVE(display->cookie_domain_entry_)); |
| 55 cookie_domain_entry_)); | |
| 56 EXPECT_EQ(expected_cookies, | 56 EXPECT_EQ(expected_cookies, |
| 57 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 57 GTK_WIDGET_SENSITIVE(display->cookie_path_entry_)); |
| 58 cookie_path_entry_)); | |
| 59 EXPECT_EQ(expected_cookies, | 58 EXPECT_EQ(expected_cookies, |
| 60 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 59 GTK_WIDGET_SENSITIVE(display->cookie_send_for_entry_)); |
| 61 cookie_send_for_entry_)); | |
| 62 EXPECT_EQ(expected_cookies, | 60 EXPECT_EQ(expected_cookies, |
| 63 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 61 GTK_WIDGET_SENSITIVE(display->cookie_created_entry_)); |
| 64 cookie_created_entry_)); | |
| 65 EXPECT_EQ(expected_cookies, | 62 EXPECT_EQ(expected_cookies, |
| 66 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 63 GTK_WIDGET_SENSITIVE(display->cookie_expires_entry_)); |
| 67 cookie_expires_entry_)); | |
| 68 // Database | 64 // Database |
| 69 EXPECT_EQ(expected_database, | 65 EXPECT_EQ(expected_database, |
| 70 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 66 GTK_WIDGET_SENSITIVE(display->database_description_entry_)); |
| 71 database_description_entry_)); | |
| 72 EXPECT_EQ(expected_database, | 67 EXPECT_EQ(expected_database, |
| 73 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 68 GTK_WIDGET_SENSITIVE(display->database_size_entry_)); |
| 74 database_size_entry_)); | |
| 75 EXPECT_EQ(expected_database, | 69 EXPECT_EQ(expected_database, |
| 76 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 70 GTK_WIDGET_SENSITIVE(display->database_last_modified_entry_)); |
| 77 database_last_modified_entry_)); | |
| 78 // Local Storage | 71 // Local Storage |
| 79 EXPECT_EQ(expected_local_storage, | 72 EXPECT_EQ(expected_local_storage, |
| 80 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 73 GTK_WIDGET_SENSITIVE(display->local_storage_origin_entry_)); |
| 81 local_storage_origin_entry_)); | |
| 82 EXPECT_EQ(expected_local_storage, | 74 EXPECT_EQ(expected_local_storage, |
| 83 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 75 GTK_WIDGET_SENSITIVE(display->local_storage_size_entry_)); |
| 84 local_storage_size_entry_)); | 76 EXPECT_EQ(expected_local_storage, GTK_WIDGET_SENSITIVE( |
| 85 EXPECT_EQ(expected_local_storage, | 77 display->local_storage_last_modified_entry_)); |
|
Evan Stade
2010/04/27 19:32:35
if you line wrap in an arg list, I tihnk you are s
Elliot Glaysher
2010/04/27 21:03:45
I'm pretty sure this is correct. The emacs rules b
| |
| 86 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | |
| 87 local_storage_last_modified_entry_)); | |
| 88 // AppCache | 78 // AppCache |
| 89 EXPECT_EQ(expected_appcache, | 79 EXPECT_EQ(expected_appcache, |
| 90 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 80 GTK_WIDGET_SENSITIVE(display->appcache_manifest_entry_)); |
| 91 appcache_manifest_entry_)); | |
| 92 EXPECT_EQ(expected_appcache, | 81 EXPECT_EQ(expected_appcache, |
| 93 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 82 GTK_WIDGET_SENSITIVE(display->appcache_size_entry_)); |
| 94 appcache_size_entry_)); | |
| 95 EXPECT_EQ(expected_appcache, | 83 EXPECT_EQ(expected_appcache, |
| 96 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 84 GTK_WIDGET_SENSITIVE(display->appcache_created_entry_)); |
| 97 appcache_created_entry_)); | |
| 98 EXPECT_EQ(expected_appcache, | 85 EXPECT_EQ(expected_appcache, |
| 99 GTK_WIDGET_SENSITIVE(cookies_view.cookie_display_-> | 86 GTK_WIDGET_SENSITIVE(display->appcache_last_accessed_entry_)); |
| 100 appcache_last_accessed_entry_)); | |
| 101 } | 87 } |
| 102 | 88 |
| 103 // Get the cookie names in the cookie list, as a comma seperated string. | 89 // Get the cookie names in the cookie list, as a comma seperated string. |
| 104 // (Note that the CookieMonster cookie list is sorted by domain.) | 90 // (Note that the CookieMonster cookie list is sorted by domain.) |
| 105 // Ex: | 91 // Ex: |
| 106 // monster->SetCookie(GURL("http://b"), "X=1") | 92 // monster->SetCookie(GURL("http://b"), "X=1") |
| 107 // monster->SetCookie(GURL("http://a"), "Y=1") | 93 // monster->SetCookie(GURL("http://a"), "Y=1") |
| 108 // EXPECT_STREQ("Y,X", GetMonsterCookies(monster).c_str()); | 94 // EXPECT_STREQ("Y,X", GetMonsterCookies(monster).c_str()); |
| 109 std::string GetMonsterCookies(net::CookieMonster* monster) { | 95 std::string GetMonsterCookies(net::CookieMonster* monster) { |
| 110 std::vector<std::string> parts; | 96 std::vector<std::string> parts; |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1182 SCOPED_TRACE("First selection removed"); | 1168 SCOPED_TRACE("First selection removed"); |
| 1183 EXPECT_STREQ("C,B", GetMonsterCookies(monster).c_str()); | 1169 EXPECT_STREQ("C,B", GetMonsterCookies(monster).c_str()); |
| 1184 EXPECT_STREQ("gdbhost1,_Web Databases,__db1," | 1170 EXPECT_STREQ("gdbhost1,_Web Databases,__db1," |
| 1185 "host1,_Local Storage,__origin1", | 1171 "host1,_Local Storage,__origin1", |
| 1186 GetDisplayedCookies(cookies_view).c_str()); | 1172 GetDisplayedCookies(cookies_view).c_str()); |
| 1187 EXPECT_EQ(TRUE, GTK_WIDGET_SENSITIVE(cookies_view.remove_all_button_)); | 1173 EXPECT_EQ(TRUE, GTK_WIDGET_SENSITIVE(cookies_view.remove_all_button_)); |
| 1188 EXPECT_EQ(FALSE, GTK_WIDGET_SENSITIVE(cookies_view.remove_button_)); | 1174 EXPECT_EQ(FALSE, GTK_WIDGET_SENSITIVE(cookies_view.remove_button_)); |
| 1189 CheckDetailsSensitivity(FALSE, FALSE, FALSE, FALSE, cookies_view); | 1175 CheckDetailsSensitivity(FALSE, FALSE, FALSE, FALSE, cookies_view); |
| 1190 } | 1176 } |
| 1191 } | 1177 } |
| OLD | NEW |