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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 ChromeRenderViewHostTestHarness::SetUp(); | 257 ChromeRenderViewHostTestHarness::SetUp(); |
258 | 258 |
259 // Set up required helpers, and make this be as "tabby" as the code requires. | 259 // Set up required helpers, and make this be as "tabby" as the code requires. |
260 chrome::SetViewType(web_contents(), chrome::VIEW_TYPE_TAB_CONTENTS); | 260 chrome::SetViewType(web_contents(), chrome::VIEW_TYPE_TAB_CONTENTS); |
261 InfoBarService::CreateForWebContents(web_contents()); | 261 InfoBarService::CreateForWebContents(web_contents()); |
262 TabSpecificContentSettings::CreateForWebContents(web_contents()); | 262 TabSpecificContentSettings::CreateForWebContents(web_contents()); |
263 #if defined(OS_ANDROID) | 263 #if defined(OS_ANDROID) |
264 MockGoogleLocationSettingsHelper::SetLocationStatus(true, true); | 264 MockGoogleLocationSettingsHelper::SetLocationStatus(true, true); |
265 #endif | 265 #endif |
266 geolocation_permission_context_ = | 266 geolocation_permission_context_ = |
267 ChromeGeolocationPermissionContextFactory::Create(profile()); | 267 ChromeGeolocationPermissionContextFactory::GetForProfile(profile()); |
268 } | 268 } |
269 | 269 |
270 void GeolocationPermissionContextTests::TearDown() { | 270 void GeolocationPermissionContextTests::TearDown() { |
271 extra_tabs_.clear(); | 271 extra_tabs_.clear(); |
272 ChromeRenderViewHostTestHarness::TearDown(); | 272 ChromeRenderViewHostTestHarness::TearDown(); |
273 // Schedule another task on the DB thread to notify us that it's safe to | 273 // Schedule another task on the DB thread to notify us that it's safe to |
274 // carry on with the test. | 274 // carry on with the test. |
275 base::WaitableEvent done(false, false); | 275 base::WaitableEvent done(false, false); |
276 content::BrowserThread::PostTask( | 276 content::BrowserThread::PostTask( |
277 content::BrowserThread::DB, FROM_HERE, | 277 content::BrowserThread::DB, FROM_HERE, |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 676 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
677 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 677 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
678 content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); | 678 content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); |
679 details.entry = web_contents()->GetController().GetLastCommittedEntry(); | 679 details.entry = web_contents()->GetController().GetLastCommittedEntry(); |
680 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 680 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
681 | 681 |
682 // Delete the tab contents. | 682 // Delete the tab contents. |
683 DeleteContents(); | 683 DeleteContents(); |
684 infobar_0->InfoBarClosed(); | 684 infobar_0->InfoBarClosed(); |
685 } | 685 } |
OLD | NEW |