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

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: remove wrong explicit 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 InfoBarService::CreateForWebContents(new_tab); 216 InfoBarService::CreateForWebContents(new_tab);
217 217
218 extra_tabs_.push_back(new_tab); 218 extra_tabs_.push_back(new_tab);
219 } 219 }
220 220
221 void GeolocationPermissionContextTests::CheckTabContentsState( 221 void GeolocationPermissionContextTests::CheckTabContentsState(
222 const GURL& requesting_frame, 222 const GURL& requesting_frame,
223 ContentSetting expected_content_setting) { 223 ContentSetting expected_content_setting) {
224 TabSpecificContentSettings* content_settings = 224 TabSpecificContentSettings* content_settings =
225 TabSpecificContentSettings::FromWebContents(web_contents()); 225 TabSpecificContentSettings::FromWebContents(web_contents());
226 const GeolocationSettingsState::StateMap& state_map = 226 const ContentSettingsUsagesState::StateMap& state_map =
227 content_settings->geolocation_settings_state().state_map(); 227 content_settings->geolocation_usages_state().state_map();
228 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin())); 228 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin()));
229 EXPECT_EQ(0U, state_map.count(requesting_frame)); 229 EXPECT_EQ(0U, state_map.count(requesting_frame));
230 GeolocationSettingsState::StateMap::const_iterator settings = 230 ContentSettingsUsagesState::StateMap::const_iterator settings =
231 state_map.find(requesting_frame.GetOrigin()); 231 state_map.find(requesting_frame.GetOrigin());
232 ASSERT_FALSE(settings == state_map.end()) 232 ASSERT_FALSE(settings == state_map.end())
233 << "geolocation state not found " << requesting_frame; 233 << "geolocation state not found " << requesting_frame;
234 EXPECT_EQ(expected_content_setting, settings->second); 234 EXPECT_EQ(expected_content_setting, settings->second);
235 } 235 }
236 236
237 void GeolocationPermissionContextTests::SetUp() { 237 void GeolocationPermissionContextTests::SetUp() {
238 ChromeRenderViewHostTestHarness::SetUp(); 238 ChromeRenderViewHostTestHarness::SetUp();
239 239
240 // Set up required helpers, and make this be as "tabby" as the code requires. 240 // 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
649 details.entry = web_contents()->GetController().GetLastCommittedEntry(); 649 details.entry = web_contents()->GetController().GetLastCommittedEntry();
650 EXPECT_FALSE(infobar_0->ShouldExpire(details)); 650 EXPECT_FALSE(infobar_0->ShouldExpire(details));
651 // Ensure the infobar will expire when we commit the pending navigation. 651 // Ensure the infobar will expire when we commit the pending navigation.
652 details.entry = web_contents()->GetController().GetActiveEntry(); 652 details.entry = web_contents()->GetController().GetActiveEntry();
653 EXPECT_TRUE(infobar_0->ShouldExpire(details)); 653 EXPECT_TRUE(infobar_0->ShouldExpire(details));
654 654
655 // Delete the tab contents. 655 // Delete the tab contents.
656 DeleteContents(); 656 DeleteContents();
657 delete infobar_0; 657 delete infobar_0;
658 } 658 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698