| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 405 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 406 profile()->GetHostContentSettingsMap()->GetContentSetting( | 406 profile()->GetHostContentSettingsMap()->GetContentSetting( |
| 407 requesting_frame_1, | 407 requesting_frame_1, |
| 408 requesting_frame_0, | 408 requesting_frame_0, |
| 409 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 409 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 410 std::string())); | 410 std::string())); |
| 411 } | 411 } |
| 412 | 412 |
| 413 TEST_F(GeolocationPermissionContextTests, InvalidURL) { | 413 TEST_F(GeolocationPermissionContextTests, InvalidURL) { |
| 414 GURL invalid_embedder; | 414 GURL invalid_embedder("about:blank"); |
| 415 GURL requesting_frame("about:blank"); | 415 GURL requesting_frame; |
| 416 NavigateAndCommit(invalid_embedder); | 416 NavigateAndCommit(invalid_embedder); |
| 417 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); | 417 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); |
| 418 RequestGeolocationPermission( | 418 RequestGeolocationPermission( |
| 419 process_id(), render_id(), bridge_id(), requesting_frame); | 419 process_id(), render_id(), bridge_id(), requesting_frame); |
| 420 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); | 420 EXPECT_EQ(0U, infobar_tab_helper()->infobar_count()); |
| 421 CheckPermissionMessageSent(bridge_id(), false); | 421 CheckPermissionMessageSent(bridge_id(), false); |
| 422 } | 422 } |
| 423 | 423 |
| 424 TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) { | 424 TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) { |
| 425 GURL url_a("http://www.example.com/geolocation"); | 425 GURL url_a("http://www.example.com/geolocation"); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 ASSERT_FALSE(infobar_0->ShouldExpire(details)); | 591 ASSERT_FALSE(infobar_0->ShouldExpire(details)); |
| 592 // Commit the "GoBack()" above, and ensure the infobar is now expired. | 592 // Commit the "GoBack()" above, and ensure the infobar is now expired. |
| 593 contents()->CommitPendingNavigation(); | 593 contents()->CommitPendingNavigation(); |
| 594 details.entry = contents()->GetController().GetLastCommittedEntry(); | 594 details.entry = contents()->GetController().GetLastCommittedEntry(); |
| 595 ASSERT_TRUE(infobar_0->ShouldExpire(details)); | 595 ASSERT_TRUE(infobar_0->ShouldExpire(details)); |
| 596 | 596 |
| 597 // Delete the tab contents. | 597 // Delete the tab contents. |
| 598 DeleteContents(); | 598 DeleteContents(); |
| 599 infobar_0->InfoBarClosed(); | 599 infobar_0->InfoBarClosed(); |
| 600 } | 600 } |
| OLD | NEW |