| OLD | NEW |
| 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/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 6 | 6 |
| 7 #include "chrome/browser/net/ssl_config_service_manager.h" | 7 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 8 #include "chrome/browser/prefs/browser_prefs.h" | 8 #include "chrome/browser/prefs/browser_prefs.h" |
| 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 9 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/test/base/browser_with_test_window_test.h" | 12 #include "chrome/test/base/browser_with_test_window_test.h" |
| 12 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
| 13 #include "chrome/test/base/testing_pref_service.h" | 14 #include "chrome/test/base/testing_pref_service.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 15 #include "content/public/browser/host_zoom_map.h" | 16 #include "content/public/browser/host_zoom_map.h" |
| 16 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" |
| 19 | 20 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 ASSERT_EQ(parent_zoom_map->GetZoomLevel(host), zoom_level_25); | 136 ASSERT_EQ(parent_zoom_map->GetZoomLevel(host), zoom_level_25); |
| 136 | 137 |
| 137 // TODO(yosin) We need to wait ProfileImpl::Observe done for | 138 // TODO(yosin) We need to wait ProfileImpl::Observe done for |
| 138 // NOTIFICATION_ZOOM_LEVEL_CHANGED. | 139 // NOTIFICATION_ZOOM_LEVEL_CHANGED. |
| 139 | 140 |
| 140 // Prepare child profile as off the record profile. | 141 // Prepare child profile as off the record profile. |
| 141 scoped_ptr<OffTheRecordProfileImpl> child_profile( | 142 scoped_ptr<OffTheRecordProfileImpl> child_profile( |
| 142 new OffTheRecordProfileImpl(parent_profile.get())); | 143 new OffTheRecordProfileImpl(parent_profile.get())); |
| 143 child_profile->InitHostZoomMap(); | 144 child_profile->InitHostZoomMap(); |
| 144 | 145 |
| 146 ProfileDependencyManager::GetInstance()->CreateProfileServices( |
| 147 child_profile.get(), false); |
| 148 |
| 145 // Prepare child host zoom map. | 149 // Prepare child host zoom map. |
| 146 HostZoomMap* child_zoom_map = | 150 HostZoomMap* child_zoom_map = |
| 147 HostZoomMap::GetForBrowserContext(child_profile.get()); | 151 HostZoomMap::GetForBrowserContext(child_profile.get()); |
| 148 ASSERT_TRUE(child_zoom_map); | 152 ASSERT_TRUE(child_zoom_map); |
| 149 | 153 |
| 150 // Verity. | 154 // Verity. |
| 151 EXPECT_NE(parent_zoom_map, child_zoom_map); | 155 EXPECT_NE(parent_zoom_map, child_zoom_map); |
| 152 | 156 |
| 153 EXPECT_EQ(parent_zoom_map->GetZoomLevel(host), | 157 EXPECT_EQ(parent_zoom_map->GetZoomLevel(host), |
| 154 child_zoom_map->GetZoomLevel(host)) << | 158 child_zoom_map->GetZoomLevel(host)) << |
| 155 "Child must inherit from parent."; | 159 "Child must inherit from parent."; |
| 156 | 160 |
| 157 child_zoom_map->SetZoomLevel(host, zoom_level_30); | 161 child_zoom_map->SetZoomLevel(host, zoom_level_30); |
| 158 ASSERT_EQ(child_zoom_map->GetZoomLevel(host), zoom_level_30); | 162 ASSERT_EQ(child_zoom_map->GetZoomLevel(host), zoom_level_30); |
| 159 | 163 |
| 160 EXPECT_NE(parent_zoom_map->GetZoomLevel(host), | 164 EXPECT_NE(parent_zoom_map->GetZoomLevel(host), |
| 161 child_zoom_map->GetZoomLevel(host)) << | 165 child_zoom_map->GetZoomLevel(host)) << |
| 162 "Child change must not propaget to parent."; | 166 "Child change must not propagate to parent."; |
| 163 | 167 |
| 164 parent_zoom_map->SetZoomLevel(host, zoom_level_40); | 168 parent_zoom_map->SetZoomLevel(host, zoom_level_40); |
| 165 ASSERT_EQ(parent_zoom_map->GetZoomLevel(host), zoom_level_40); | 169 ASSERT_EQ(parent_zoom_map->GetZoomLevel(host), zoom_level_40); |
| 166 | 170 |
| 167 EXPECT_EQ(parent_zoom_map->GetZoomLevel(host), | 171 EXPECT_EQ(parent_zoom_map->GetZoomLevel(host), |
| 168 child_zoom_map->GetZoomLevel(host)) << | 172 child_zoom_map->GetZoomLevel(host)) << |
| 169 "Parent change should propaget to child."; | 173 "Parent change should propagate to child."; |
| 170 } | 174 } |
| OLD | NEW |