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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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) 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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 CookiesTreeModel cookies_model( 1104 CookiesTreeModel cookies_model(
1105 container, special_storage_policy_.get(), false); 1105 container, special_storage_policy_.get(), false);
1106 1106
1107 mock_browsing_data_cookie_helper_->AddCookieSamples(host, "A=1"); 1107 mock_browsing_data_cookie_helper_->AddCookieSamples(host, "A=1");
1108 mock_browsing_data_cookie_helper_->Notify(); 1108 mock_browsing_data_cookie_helper_->Notify();
1109 1109
1110 TestingProfile profile; 1110 TestingProfile profile;
1111 HostContentSettingsMap* content_settings = 1111 HostContentSettingsMap* content_settings =
1112 profile.GetHostContentSettingsMap(); 1112 profile.GetHostContentSettingsMap();
1113 CookieSettings* cookie_settings = 1113 CookieSettings* cookie_settings =
1114 CookieSettings::Factory::GetForProfile(&profile); 1114 CookieSettings::Factory::GetForProfile(&profile).get();
1115 MockSettingsObserver observer; 1115 MockSettingsObserver observer;
1116 1116
1117 CookieTreeRootNode* root = 1117 CookieTreeRootNode* root =
1118 static_cast<CookieTreeRootNode*>(cookies_model.GetRoot()); 1118 static_cast<CookieTreeRootNode*>(cookies_model.GetRoot());
1119 CookieTreeHostNode* origin = 1119 CookieTreeHostNode* origin =
1120 root->GetOrCreateHostNode(host); 1120 root->GetOrCreateHostNode(host);
1121 1121
1122 EXPECT_EQ(1, origin->child_count()); 1122 EXPECT_EQ(1, origin->child_count());
1123 EXPECT_TRUE(origin->CanCreateContentException()); 1123 EXPECT_TRUE(origin->CanCreateContentException());
1124 EXPECT_CALL(observer, 1124 EXPECT_CALL(observer,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 EXPECT_EQ("A,C", GetDisplayedCookies(&cookies_model)); 1196 EXPECT_EQ("A,C", GetDisplayedCookies(&cookies_model));
1197 1197
1198 cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo3"))); 1198 cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo3")));
1199 EXPECT_EQ("D", GetDisplayedCookies(&cookies_model)); 1199 EXPECT_EQ("D", GetDisplayedCookies(&cookies_model));
1200 1200
1201 cookies_model.UpdateSearchResults(string16()); 1201 cookies_model.UpdateSearchResults(string16());
1202 EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model)); 1202 EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model));
1203 } 1203 }
1204 1204
1205 } // namespace 1205 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698