| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 int bridge_id, | 204 int bridge_id, |
| 205 bool allowed) { | 205 bool allowed) { |
| 206 ASSERT_EQ(responses_.count(process->GetID()), 1U); | 206 ASSERT_EQ(responses_.count(process->GetID()), 1U); |
| 207 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); | 207 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); |
| 208 EXPECT_EQ(allowed, responses_[process->GetID()].second); | 208 EXPECT_EQ(allowed, responses_[process->GetID()].second); |
| 209 responses_.erase(process->GetID()); | 209 responses_.erase(process->GetID()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { | 212 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { |
| 213 WebContents* new_tab = | 213 WebContents* new_tab = |
| 214 WebContents::Create(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 214 WebContents::Create(profile(), NULL, MSG_ROUTING_NONE, NULL); |
| 215 new_tab->GetController().LoadURL( | 215 new_tab->GetController().LoadURL( |
| 216 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); | 216 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); |
| 217 RenderViewHostTester::For(new_tab->GetRenderViewHost())-> | 217 RenderViewHostTester::For(new_tab->GetRenderViewHost())-> |
| 218 SendNavigate(extra_tabs_.size() + 1, url); | 218 SendNavigate(extra_tabs_.size() + 1, url); |
| 219 extra_tabs_.push_back(new TabContents(new_tab)); | 219 extra_tabs_.push_back(new TabContents(new_tab)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void GeolocationPermissionContextTests::CheckTabContentsState( | 222 void GeolocationPermissionContextTests::CheckTabContentsState( |
| 223 const GURL& requesting_frame, | 223 const GURL& requesting_frame, |
| 224 ContentSetting expected_content_setting) { | 224 ContentSetting expected_content_setting) { |
| (...skipping 409 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 |