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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 state_map.find(requesting_frame.GetOrigin()); | 240 state_map.find(requesting_frame.GetOrigin()); |
241 ASSERT_FALSE(settings == state_map.end()) | 241 ASSERT_FALSE(settings == state_map.end()) |
242 << "geolocation state not found " << requesting_frame; | 242 << "geolocation state not found " << requesting_frame; |
243 EXPECT_EQ(expected_content_setting, settings->second); | 243 EXPECT_EQ(expected_content_setting, settings->second); |
244 } | 244 } |
245 | 245 |
246 void GeolocationPermissionContextTests::SetUp() { | 246 void GeolocationPermissionContextTests::SetUp() { |
247 db_thread_.Start(); | 247 db_thread_.Start(); |
248 TabContentsTestHarness::SetUp(); | 248 TabContentsTestHarness::SetUp(); |
249 geolocation_permission_context_ = | 249 geolocation_permission_context_ = |
250 new ChromeGeolocationPermissionContext(profile()); | 250 ChromeGeolocationPermissionContext::Create(profile()); |
251 } | 251 } |
252 | 252 |
253 void GeolocationPermissionContextTests::TearDown() { | 253 void GeolocationPermissionContextTests::TearDown() { |
254 extra_tabs_.clear(); | 254 extra_tabs_.clear(); |
255 TabContentsTestHarness::TearDown(); | 255 TabContentsTestHarness::TearDown(); |
256 // Schedule another task on the DB thread to notify us that it's safe to | 256 // Schedule another task on the DB thread to notify us that it's safe to |
257 // carry on with the test. | 257 // carry on with the test. |
258 base::WaitableEvent done(false, false); | 258 base::WaitableEvent done(false, false); |
259 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 259 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
260 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 260 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 642 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
643 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 643 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
644 WebContentsTester::For(contents())->CommitPendingNavigation(); | 644 WebContentsTester::For(contents())->CommitPendingNavigation(); |
645 details.entry = contents()->GetController().GetLastCommittedEntry(); | 645 details.entry = contents()->GetController().GetLastCommittedEntry(); |
646 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 646 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
647 | 647 |
648 // Delete the tab contents. | 648 // Delete the tab contents. |
649 DeleteContents(); | 649 DeleteContents(); |
650 infobar_0->InfoBarClosed(); | 650 infobar_0->InfoBarClosed(); |
651 } | 651 } |
OLD | NEW |