| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 | 237 |
| 238 void GeolocationPermissionContextTests::SetUp() { | 238 void GeolocationPermissionContextTests::SetUp() { |
| 239 db_thread_.Start(); | 239 db_thread_.Start(); |
| 240 TabContentsTestHarness::SetUp(); | 240 TabContentsTestHarness::SetUp(); |
| 241 geolocation_permission_context_ = | 241 geolocation_permission_context_ = |
| 242 new ChromeGeolocationPermissionContext(profile()); | 242 new ChromeGeolocationPermissionContext(profile()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void GeolocationPermissionContextTests::TearDown() { | 245 void GeolocationPermissionContextTests::TearDown() { |
| 246 extra_tabs_.reset(); | 246 extra_tabs_.clear(); |
| 247 TabContentsTestHarness::TearDown(); | 247 TabContentsTestHarness::TearDown(); |
| 248 // Schedule another task on the DB thread to notify us that it's safe to | 248 // Schedule another task on the DB thread to notify us that it's safe to |
| 249 // carry on with the test. | 249 // carry on with the test. |
| 250 base::WaitableEvent done(false, false); | 250 base::WaitableEvent done(false, false); |
| 251 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 251 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
| 252 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 252 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
| 253 done.Wait(); | 253 done.Wait(); |
| 254 db_thread_.Stop(); | 254 db_thread_.Stop(); |
| 255 } | 255 } |
| 256 | 256 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 634 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
| 635 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 635 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
| 636 WebContentsTester::For(contents())->CommitPendingNavigation(); | 636 WebContentsTester::For(contents())->CommitPendingNavigation(); |
| 637 details.entry = contents()->GetController().GetLastCommittedEntry(); | 637 details.entry = contents()->GetController().GetLastCommittedEntry(); |
| 638 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 638 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
| 639 | 639 |
| 640 // Delete the tab contents. | 640 // Delete the tab contents. |
| 641 DeleteContents(); | 641 DeleteContents(); |
| 642 infobar_0->InfoBarClosed(); | 642 infobar_0->InfoBarClosed(); |
| 643 } | 643 } |
| OLD | NEW |