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

Side by Side Diff: chrome/browser/cookies_tree_model_unittest.cc

Issue 7676002: When deleting storage through the cookies tree model, also update its cache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 4 months 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/cookies_tree_model.h" 5 #include "chrome/browser/cookies_tree_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/content_settings/mock_settings_observer.h" 10 #include "chrome/browser/content_settings/mock_settings_observer.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 mock_browsing_data_cookie_helper_->Reset(); 319 mock_browsing_data_cookie_helper_->Reset();
320 mock_browsing_data_database_helper_->Reset(); 320 mock_browsing_data_database_helper_->Reset();
321 mock_browsing_data_local_storage_helper_->Reset(); 321 mock_browsing_data_local_storage_helper_->Reset();
322 mock_browsing_data_session_storage_helper_->Reset(); 322 mock_browsing_data_session_storage_helper_->Reset();
323 mock_browsing_data_indexed_db_helper_->Reset(); 323 mock_browsing_data_indexed_db_helper_->Reset();
324 mock_browsing_data_file_system_helper_->Reset(); 324 mock_browsing_data_file_system_helper_->Reset();
325 325
326 cookies_model->DeleteAllStoredObjects(); 326 cookies_model->DeleteAllStoredObjects();
327 327
328 // Make sure the nodes are also deleted from the model's cache.
329 // http://crbug.com/43249
330 cookies_model->UpdateSearchResults(std::wstring());
331
328 { 332 {
329 SCOPED_TRACE("After removing"); 333 SCOPED_TRACE("After removing");
330 EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount()); 334 EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount());
331 EXPECT_EQ(0, cookies_model->GetRoot()->child_count()); 335 EXPECT_EQ(0, cookies_model->GetRoot()->child_count());
332 EXPECT_EQ(std::string(""), GetDisplayedCookies(cookies_model.get())); 336 EXPECT_EQ(std::string(""), GetDisplayedCookies(cookies_model.get()));
333 EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted()); 337 EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted());
334 EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted()); 338 EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted());
335 EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted()); 339 EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted());
336 EXPECT_FALSE(mock_browsing_data_session_storage_helper_->AllDeleted()); 340 EXPECT_FALSE(mock_browsing_data_session_storage_helper_->AllDeleted());
337 EXPECT_TRUE(mock_browsing_data_indexed_db_helper_->AllDeleted()); 341 EXPECT_TRUE(mock_browsing_data_indexed_db_helper_->AllDeleted());
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 cookies_model->UpdateSearchResults(std::wstring(L"fshost3")); 992 cookies_model->UpdateSearchResults(std::wstring(L"fshost3"));
989 EXPECT_EQ("http://fshost3:3/", 993 EXPECT_EQ("http://fshost3:3/",
990 GetDisplayedFileSystems(cookies_model.get())); 994 GetDisplayedFileSystems(cookies_model.get()));
991 995
992 cookies_model->UpdateSearchResults(std::wstring()); 996 cookies_model->UpdateSearchResults(std::wstring());
993 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", 997 EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/",
994 GetDisplayedFileSystems(cookies_model.get())); 998 GetDisplayedFileSystems(cookies_model.get()));
995 } 999 }
996 1000
997 } // namespace 1001 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cookies_tree_model.cc ('k') | chrome/browser/mock_browsing_data_database_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698