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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 MockRenderProcessHost* process, | 198 MockRenderProcessHost* process, |
199 int bridge_id, | 199 int bridge_id, |
200 bool allowed) { | 200 bool allowed) { |
201 ASSERT_EQ(responses_.count(process->GetID()), 1U); | 201 ASSERT_EQ(responses_.count(process->GetID()), 1U); |
202 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); | 202 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); |
203 EXPECT_EQ(allowed, responses_[process->GetID()].second); | 203 EXPECT_EQ(allowed, responses_[process->GetID()].second); |
204 responses_.erase(process->GetID()); | 204 responses_.erase(process->GetID()); |
205 } | 205 } |
206 | 206 |
207 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { | 207 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { |
208 content::WebContents* new_tab = content::WebContents::Create( | 208 content::WebContents* new_tab = CreateTestWebContents(); |
209 content::WebContents::CreateParams(profile())); | |
210 new_tab->GetController().LoadURL( | 209 new_tab->GetController().LoadURL( |
211 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); | 210 url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); |
212 content::RenderFrameHostTester::For(new_tab->GetMainFrame()) | 211 content::RenderFrameHostTester::For(new_tab->GetMainFrame()) |
213 ->SendNavigate(extra_tabs_.size() + 1, url); | 212 ->SendNavigate(extra_tabs_.size() + 1, url); |
214 | 213 |
215 // Set up required helpers, and make this be as "tabby" as the code requires. | 214 // Set up required helpers, and make this be as "tabby" as the code requires. |
216 #if defined(ENABLE_EXTENSIONS) | 215 #if defined(ENABLE_EXTENSIONS) |
217 extensions::SetViewType(new_tab, extensions::VIEW_TYPE_TAB_CONTENTS); | 216 extensions::SetViewType(new_tab, extensions::VIEW_TYPE_TAB_CONTENTS); |
218 #endif | 217 #endif |
219 InfoBarService::CreateForWebContents(new_tab); | 218 InfoBarService::CreateForWebContents(new_tab); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 // it is the embedder. | 778 // it is the embedder. |
780 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), | 779 EXPECT_EQ(map->GetLastUsage(requesting_frame_0.GetOrigin(), |
781 requesting_frame_0.GetOrigin(), | 780 requesting_frame_0.GetOrigin(), |
782 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 781 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
783 13); | 782 13); |
784 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), | 783 EXPECT_EQ(map->GetLastUsage(requesting_frame_1.GetOrigin(), |
785 requesting_frame_0.GetOrigin(), | 784 requesting_frame_0.GetOrigin(), |
786 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), | 785 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), |
787 11); | 786 11); |
788 } | 787 } |
OLD | NEW |