| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 bool allowed) { | 203 bool allowed) { |
| 204 ASSERT_EQ(responses_.count(process->GetID()), 1U); | 204 ASSERT_EQ(responses_.count(process->GetID()), 1U); |
| 205 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); | 205 EXPECT_EQ(bridge_id, responses_[process->GetID()].first); |
| 206 EXPECT_EQ(allowed, responses_[process->GetID()].second); | 206 EXPECT_EQ(allowed, responses_[process->GetID()].second); |
| 207 responses_.erase(process->GetID()); | 207 responses_.erase(process->GetID()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { | 210 void GeolocationPermissionContextTests::AddNewTab(const GURL& url) { |
| 211 TabContents* new_tab = | 211 TabContents* new_tab = |
| 212 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 212 new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
| 213 new_tab->controller().LoadURL(url, GURL(), content::PAGE_TRANSITION_TYPED, | 213 new_tab->controller().LoadURL(url, content::Referrer(), |
| 214 std::string()); | 214 content::PAGE_TRANSITION_TYPED, std::string()); |
| 215 static_cast<TestRenderViewHost*>(new_tab->render_manager_for_testing()-> | 215 static_cast<TestRenderViewHost*>(new_tab->render_manager_for_testing()-> |
| 216 current_host())->SendNavigate(extra_tabs_.size() + 1, url); | 216 current_host())->SendNavigate(extra_tabs_.size() + 1, url); |
| 217 extra_tabs_.push_back(new TabContentsWrapper(new_tab)); | 217 extra_tabs_.push_back(new TabContentsWrapper(new_tab)); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void GeolocationPermissionContextTests::CheckTabContentsState( | 220 void GeolocationPermissionContextTests::CheckTabContentsState( |
| 221 const GURL& requesting_frame, | 221 const GURL& requesting_frame, |
| 222 ContentSetting expected_content_setting) { | 222 ContentSetting expected_content_setting) { |
| 223 TabSpecificContentSettings* content_settings = | 223 TabSpecificContentSettings* content_settings = |
| 224 contents_wrapper()->content_settings(); | 224 contents_wrapper()->content_settings(); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 594 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
| 595 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 595 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
| 596 contents()->CommitPendingNavigation(); | 596 contents()->CommitPendingNavigation(); |
| 597 details.entry = contents()->controller().GetLastCommittedEntry(); | 597 details.entry = contents()->controller().GetLastCommittedEntry(); |
| 598 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 598 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
| 599 | 599 |
| 600 // Delete the tab contents. | 600 // Delete the tab contents. |
| 601 DeleteContents(); | 601 DeleteContents(); |
| 602 infobar_0->InfoBarClosed(); | 602 infobar_0->InfoBarClosed(); |
| 603 } | 603 } |
| OLD | NEW |