OLD | NEW |
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/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 MockRenderProcessHost* process, | 213 MockRenderProcessHost* process, |
214 int bridge_id, | 214 int bridge_id, |
215 bool allowed) { | 215 bool allowed) { |
216 ASSERT_EQ(responses_.count(process->GetID()), 1U); | 216 ASSERT_EQ(responses_.count(process->GetID()), 1U); |
217 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); | 217 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); |
218 EXPECT_EQ(allowed, responses_[process->GetID()].second); | 218 EXPECT_EQ(allowed, responses_[process->GetID()].second); |
219 responses_.erase(process->GetID()); | 219 responses_.erase(process->GetID()); |
220 } | 220 } |
221 | 221 |
222 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { | 222 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { |
223 content::WebContents* new_tab = content::WebContents::Create( | 223 content::WebContents* new_tab = CreateTestWebContents(); |
224 content::WebContents::CreateParams(profile())); | |
225 new_tab->GetController().LoadURL( | 224 new_tab->GetController().LoadURL( |
226 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 225 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
227 content::RenderFrameHostTester::For(new_tab->GetMainFrame()) | 226 content::RenderFrameHostTester::For(new_tab->GetMainFrame()) |
228 ->SendNavigate(extra_tabs_.size() + 1, url); | 227 ->SendNavigate(extra_tabs_.size() + 1, url); |
229 | 228 |
230 // Set up required helpers, and make this be as "tabby" as the code requires. | 229 // Set up required helpers, and make this be as "tabby" as the code requires. |
231 #if defined(ENABLE_EXTENSIONS) | 230 #if defined(ENABLE_EXTENSIONS) |
232 extensions::SetViewType(new_tab, extensions::VIEW_TYPE_TAB_CONTENTS); | 231 extensions::SetViewType(new_tab, extensions::VIEW_TYPE_TAB_CONTENTS); |
233 #endif | 232 #endif |
234 InfoBarService::CreateForWebContents(new_tab); | 233 InfoBarService::CreateForWebContents(new_tab); |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 13); | 968 13); |
970 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 969 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
971 requesting_frame_0.GetOrigin(), | 970 requesting_frame_0.GetOrigin(), |
972 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 971 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
973 11); | 972 11); |
974 } | 973 } |
975 | 974 |
976 INSTANTIATE_TEST_CASE_P(GeolocationPermissionContextTestsWithAndWithoutBubbles, | 975 INSTANTIATE_TEST_CASE_P(GeolocationPermissionContextTestsWithAndWithoutBubbles, |
977 GeolocationPermissionContextParamTests, | 976 GeolocationPermissionContextParamTests, |
978 ::testing::Values(false, true)); | 977 ::testing::Values(false, true)); |
OLD | NEW |