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

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl_unittest.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 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) 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/profiles/off_the_record_profile_impl.h" 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h"
6 6
7 #include "base/prefs/pref_registry_simple.h" 7 #include "base/prefs/pref_registry_simple.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ASSERT_TRUE(parent_zoom_map); 135 ASSERT_TRUE(parent_zoom_map);
136 136
137 parent_zoom_map->SetZoomLevelForHost(host, zoom_level_25); 137 parent_zoom_map->SetZoomLevelForHost(host, zoom_level_25);
138 ASSERT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host), 138 ASSERT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host),
139 zoom_level_25); 139 zoom_level_25);
140 140
141 // TODO(yosin) We need to wait ProfileImpl::Observe done for 141 // TODO(yosin) We need to wait ProfileImpl::Observe done for
142 // OnZoomLevelChanged. 142 // OnZoomLevelChanged.
143 143
144 // Prepare an off the record profile owned by the parent profile. 144 // Prepare an off the record profile owned by the parent profile.
145 parent_profile->SetOffTheRecordProfile(
146 scoped_ptr<Profile>(new OffTheRecordProfileImpl(parent_profile)));
147 OffTheRecordProfileImpl* child_profile = 145 OffTheRecordProfileImpl* child_profile =
148 static_cast<OffTheRecordProfileImpl*>( 146 static_cast<OffTheRecordProfileImpl*>(
149 parent_profile->GetOffTheRecordProfile()); 147 parent_profile->GetOffTheRecordProfile());
150 child_profile->InitIoData();
151 child_profile->InitHostZoomMap();
152 148
153 // Prepare child host zoom map. 149 // Prepare child host zoom map.
154 HostZoomMap* child_zoom_map = 150 HostZoomMap* child_zoom_map =
155 HostZoomMap::GetForBrowserContext(child_profile); 151 HostZoomMap::GetForBrowserContext(child_profile);
156 ASSERT_TRUE(child_zoom_map); 152 ASSERT_TRUE(child_zoom_map);
157 153
158 // Verify. 154 // Verify.
159 EXPECT_NE(parent_zoom_map, child_zoom_map); 155 EXPECT_NE(parent_zoom_map, child_zoom_map);
160 156
161 EXPECT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host), 157 EXPECT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host),
(...skipping 12 matching lines...) Expand all
174 parent_zoom_map->SetZoomLevelForHost(host, zoom_level_40); 170 parent_zoom_map->SetZoomLevelForHost(host, zoom_level_40);
175 ASSERT_EQ( 171 ASSERT_EQ(
176 parent_zoom_map->GetZoomLevelForHostAndScheme("http", host), 172 parent_zoom_map->GetZoomLevelForHostAndScheme("http", host),
177 zoom_level_40); 173 zoom_level_40);
178 174
179 EXPECT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host), 175 EXPECT_EQ(parent_zoom_map->GetZoomLevelForHostAndScheme("http", host),
180 child_zoom_map->GetZoomLevelForHostAndScheme("http", host)) << 176 child_zoom_map->GetZoomLevelForHostAndScheme("http", host)) <<
181 "Parent change should propagate to child."; 177 "Parent change should propagate to child.";
182 base::RunLoop().RunUntilIdle(); 178 base::RunLoop().RunUntilIdle();
183 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698