OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
6 | 6 |
7 #include "base/scoped_vector.h" | 7 #include "base/scoped_vector.h" |
8 #include "chrome/browser/geolocation/location_arbitrator.h" | 8 #include "chrome/browser/geolocation/location_arbitrator.h" |
9 #include "chrome/browser/geolocation/location_provider.h" | 9 #include "chrome/browser/geolocation/location_provider.h" |
10 #include "chrome/browser/geolocation/mock_location_provider.h" | 10 #include "chrome/browser/geolocation/mock_location_provider.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 TestTabContentsWithPendingInfoBar* new_tab = | 123 TestTabContentsWithPendingInfoBar* new_tab = |
124 new TestTabContentsWithPendingInfoBar(profile(), NULL); | 124 new TestTabContentsWithPendingInfoBar(profile(), NULL); |
125 new_tab->controller().LoadURL(url, GURL(), PageTransition::TYPED); | 125 new_tab->controller().LoadURL(url, GURL(), PageTransition::TYPED); |
126 static_cast<TestRenderViewHost*>(new_tab->render_manager()-> | 126 static_cast<TestRenderViewHost*>(new_tab->render_manager()-> |
127 current_host())->SendNavigate(extra_tabs_.size() + 1, url); | 127 current_host())->SendNavigate(extra_tabs_.size() + 1, url); |
128 extra_tabs_.push_back(new_tab); | 128 extra_tabs_.push_back(new_tab); |
129 } | 129 } |
130 | 130 |
131 void CheckTabContentsState(const GURL& requesting_frame, | 131 void CheckTabContentsState(const GURL& requesting_frame, |
132 ContentSetting expected_content_setting) { | 132 ContentSetting expected_content_setting) { |
| 133 TabSpecificContentSettings* content_settings = |
| 134 contents()->GetTabSpecificContentSettings(); |
133 const GeolocationSettingsState::StateMap& state_map = | 135 const GeolocationSettingsState::StateMap& state_map = |
134 contents()->geolocation_settings_state().state_map(); | 136 content_settings->geolocation_settings_state().state_map(); |
135 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin())); | 137 EXPECT_EQ(1U, state_map.count(requesting_frame.GetOrigin())); |
136 EXPECT_EQ(0U, state_map.count(requesting_frame)); | 138 EXPECT_EQ(0U, state_map.count(requesting_frame)); |
137 GeolocationSettingsState::StateMap::const_iterator settings = | 139 GeolocationSettingsState::StateMap::const_iterator settings = |
138 state_map.find(requesting_frame.GetOrigin()); | 140 state_map.find(requesting_frame.GetOrigin()); |
139 ASSERT_FALSE(settings == state_map.end()) | 141 ASSERT_FALSE(settings == state_map.end()) |
140 << "geolocation state not found " << requesting_frame; | 142 << "geolocation state not found " << requesting_frame; |
141 EXPECT_EQ(expected_content_setting, settings->second); | 143 EXPECT_EQ(expected_content_setting, settings->second); |
142 } | 144 } |
143 | 145 |
144 protected: | 146 protected: |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 ASSERT_TRUE(infobar_1); | 409 ASSERT_TRUE(infobar_1); |
408 infobar_1->Accept(); | 410 infobar_1->Accept(); |
409 CheckPermissionMessageSentForTab(0, bridge_id() + 1, true); | 411 CheckPermissionMessageSentForTab(0, bridge_id() + 1, true); |
410 extra_tabs_[0]->RemoveInfoBar(infobar_1); | 412 extra_tabs_[0]->RemoveInfoBar(infobar_1); |
411 EXPECT_EQ(infobar_1, | 413 EXPECT_EQ(infobar_1, |
412 extra_tabs_[0]->removed_infobar_delegate_); | 414 extra_tabs_[0]->removed_infobar_delegate_); |
413 infobar_1->InfoBarClosed(); | 415 infobar_1->InfoBarClosed(); |
414 | 416 |
415 extra_tabs_.reset(); | 417 extra_tabs_.reset(); |
416 } | 418 } |
OLD | NEW |