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

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

Issue 11183018: Refactor ChromeGeolocationPermissionContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates from comments Created 8 years, 2 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698