| 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/browsing_data/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 public: | 40 public: |
| 41 virtual ~CookiesTreeModelTest() { | 41 virtual ~CookiesTreeModelTest() { |
| 42 // Avoid memory leaks. | 42 // Avoid memory leaks. |
| 43 special_storage_policy_ = NULL; | 43 special_storage_policy_ = NULL; |
| 44 profile_.reset(); | 44 profile_.reset(); |
| 45 base::MessageLoop::current()->RunUntilIdle(); | 45 base::MessageLoop::current()->RunUntilIdle(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 virtual void SetUp() OVERRIDE { | 48 virtual void SetUp() OVERRIDE { |
| 49 profile_.reset(new TestingProfile()); | 49 profile_.reset(new TestingProfile()); |
| 50 profile_->CreateRequestContext(); | |
| 51 mock_browsing_data_cookie_helper_ = | 50 mock_browsing_data_cookie_helper_ = |
| 52 new MockBrowsingDataCookieHelper(profile_->GetRequestContext()); | 51 new MockBrowsingDataCookieHelper(profile_->GetRequestContext()); |
| 53 mock_browsing_data_database_helper_ = | 52 mock_browsing_data_database_helper_ = |
| 54 new MockBrowsingDataDatabaseHelper(profile_.get()); | 53 new MockBrowsingDataDatabaseHelper(profile_.get()); |
| 55 mock_browsing_data_local_storage_helper_ = | 54 mock_browsing_data_local_storage_helper_ = |
| 56 new MockBrowsingDataLocalStorageHelper(profile_.get()); | 55 new MockBrowsingDataLocalStorageHelper(profile_.get()); |
| 57 mock_browsing_data_session_storage_helper_ = | 56 mock_browsing_data_session_storage_helper_ = |
| 58 new MockBrowsingDataLocalStorageHelper(profile_.get()); | 57 new MockBrowsingDataLocalStorageHelper(profile_.get()); |
| 59 mock_browsing_data_appcache_helper_ = | 58 mock_browsing_data_appcache_helper_ = |
| 60 new MockBrowsingDataAppCacheHelper(profile_.get()); | 59 new MockBrowsingDataAppCacheHelper(profile_.get()); |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 EXPECT_EQ("A,C", GetDisplayedCookies(&cookies_model)); | 1185 EXPECT_EQ("A,C", GetDisplayedCookies(&cookies_model)); |
| 1187 | 1186 |
| 1188 cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo3"))); | 1187 cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo3"))); |
| 1189 EXPECT_EQ("D", GetDisplayedCookies(&cookies_model)); | 1188 EXPECT_EQ("D", GetDisplayedCookies(&cookies_model)); |
| 1190 | 1189 |
| 1191 cookies_model.UpdateSearchResults(string16()); | 1190 cookies_model.UpdateSearchResults(string16()); |
| 1192 EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model)); | 1191 EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model)); |
| 1193 } | 1192 } |
| 1194 | 1193 |
| 1195 } // namespace | 1194 } // namespace |
| OLD | NEW |