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

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

Issue 921443003: Fix RenderFrameCreated and RenderFrameDeleted WebContentsObserver methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete pending callbacks in ManifestManagerHost destructor. Created 5 years, 10 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
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/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
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
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));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698