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

Side by Side Diff: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc

Issue 19375002: Move GeolocationSettingsState to ContentSettingsUsagesState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review #9 Created 7 years, 5 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/geolocation/chrome_geolocation_permission_context.h" 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 InfoBarService::CreateForWebContents(new_tab); 214 InfoBarService::CreateForWebContents(new_tab);
215 215
216 extra_tabs_.push_back(new_tab); 216 extra_tabs_.push_back(new_tab);
217 } 217 }
218 218
219 void GeolocationPermissionContextTests::CheckTabContentsState( 219 void GeolocationPermissionContextTests::CheckTabContentsState(
220 const GURL& requesting_frame, 220 const GURL& requesting_frame,
221 ContentSetting expected_content_setting) { 221 ContentSetting expected_content_setting) {
222 TabSpecificContentSettings* content_settings = 222 TabSpecificContentSettings* content_settings =
223 TabSpecificContentSettings::FromWebContents(web_contents()); 223 TabSpecificContentSettings::FromWebContents(web_contents());
224 const GeolocationSettingsState::StateMap& state_map = 224 const ContentSettingsUsagesState::StateMap& state_map =
225 content_settings->geolocation_settings_state().state_map(); 225 content_settings->geolocation_usages_state().state_map();
226 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin())); 226 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin()));
227 EXPECT_EQ(0U, state_map.count(requesting_frame)); 227 EXPECT_EQ(0U, state_map.count(requesting_frame));
228 GeolocationSettingsState::StateMap::const_iterator settings = 228 ContentSettingsUsagesState::StateMap::const_iterator settings =
229 state_map.find(requesting_frame.GetOrigin()); 229 state_map.find(requesting_frame.GetOrigin());
230 ASSERT_FALSE(settings == state_map.end()) 230 ASSERT_FALSE(settings == state_map.end())
231 << "geolocation state not found " << requesting_frame; 231 << "geolocation state not found " << requesting_frame;
232 EXPECT_EQ(expected_content_setting, settings->second); 232 EXPECT_EQ(expected_content_setting, settings->second);
233 } 233 }
234 234
235 void GeolocationPermissionContextTests::SetUp() { 235 void GeolocationPermissionContextTests::SetUp() {
236 ChromeRenderViewHostTestHarness::SetUp(); 236 ChromeRenderViewHostTestHarness::SetUp();
237 237
238 // Set up required helpers, and make this be as "tabby" as the code requires. 238 // Set up required helpers, and make this be as "tabby" as the code requires.
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 details.entry = web_contents()->GetController().GetLastCommittedEntry(); 647 details.entry = web_contents()->GetController().GetLastCommittedEntry();
648 EXPECT_FALSE(infobar_delegate->ShouldExpire(details)); 648 EXPECT_FALSE(infobar_delegate->ShouldExpire(details));
649 // Ensure the infobar will expire when we commit the pending navigation. 649 // Ensure the infobar will expire when we commit the pending navigation.
650 details.entry = web_contents()->GetController().GetActiveEntry(); 650 details.entry = web_contents()->GetController().GetActiveEntry();
651 EXPECT_TRUE(infobar_delegate->ShouldExpire(details)); 651 EXPECT_TRUE(infobar_delegate->ShouldExpire(details));
652 652
653 // Delete the tab contents. 653 // Delete the tab contents.
654 DeleteContents(); 654 DeleteContents();
655 delete infobar_delegate; 655 delete infobar_delegate;
656 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698