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

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

Issue 6720050: Make contents settable in RVHTH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 6 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
7 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 7 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
8 #include "chrome/test/testing_profile.h" 8 #include "chrome/test/testing_profile.h"
9 #include "content/browser/browser_thread.h" 9 #include "content/browser/browser_thread.h"
10 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h " 10 #include "content/browser/geolocation/arbitrator_dependency_factories_for_test.h "
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 state_map.find(requesting_frame.GetOrigin()); 169 state_map.find(requesting_frame.GetOrigin());
170 ASSERT_FALSE(settings == state_map.end()) 170 ASSERT_FALSE(settings == state_map.end())
171 << "geolocation state not found " << requesting_frame; 171 << "geolocation state not found " << requesting_frame;
172 EXPECT_EQ(expected_content_setting, settings->second); 172 EXPECT_EQ(expected_content_setting, settings->second);
173 } 173 }
174 174
175 void GeolocationPermissionContextTests::SetUp() { 175 void GeolocationPermissionContextTests::SetUp() {
176 RenderViewHostTestHarness::SetUp(); 176 RenderViewHostTestHarness::SetUp();
177 GeolocationArbitrator::SetDependencyFactoryForTest( 177 GeolocationArbitrator::SetDependencyFactoryForTest(
178 dependency_factory_.get()); 178 dependency_factory_.get());
179 SiteInstance* site_instance = contents_->GetSiteInstance(); 179 SiteInstance* site_instance = contents()->GetSiteInstance();
180 tab_contents_with_pending_infobar_ = 180 tab_contents_with_pending_infobar_ =
181 new TestTabContentsWithPendingInfoBar(profile_.get(), site_instance); 181 new TestTabContentsWithPendingInfoBar(profile_.get(), site_instance);
182 contents_.reset(tab_contents_with_pending_infobar_); 182 SetContents(tab_contents_with_pending_infobar_);
183 geolocation_permission_context_ = 183 geolocation_permission_context_ =
184 new GeolocationPermissionContext(profile()); 184 new GeolocationPermissionContext(profile());
185 } 185 }
186 186
187 void GeolocationPermissionContextTests::TearDown() { 187 void GeolocationPermissionContextTests::TearDown() {
188 GeolocationArbitrator::SetDependencyFactoryForTest(NULL); 188 GeolocationArbitrator::SetDependencyFactoryForTest(NULL);
189 RenderViewHostTestHarness::TearDown(); 189 RenderViewHostTestHarness::TearDown();
190 } 190 }
191 191
192 192
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // Ensure only one infobar is created. 450 // Ensure only one infobar is created.
451 EXPECT_EQ(1U, contents()->infobar_count()); 451 EXPECT_EQ(1U, contents()->infobar_count());
452 ConfirmInfoBarDelegate* infobar_0 = 452 ConfirmInfoBarDelegate* infobar_0 =
453 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); 453 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate();
454 ASSERT_TRUE(infobar_0); 454 ASSERT_TRUE(infobar_0);
455 string16 text_0 = infobar_0->GetMessageText(); 455 string16 text_0 = infobar_0->GetMessageText();
456 456
457 // Delete the tab contents. 457 // Delete the tab contents.
458 DeleteContents(); 458 DeleteContents();
459 } 459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698