| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 6 | 6 |
| 7 #include "base/scoped_vector.h" | 7 #include "base/scoped_vector.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 10 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 10 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 EXPECT_EQ( | 283 EXPECT_EQ( |
| 284 CONTENT_SETTING_ASK, | 284 CONTENT_SETTING_ASK, |
| 285 profile()->GetGeolocationContentSettingsMap()->GetContentSetting( | 285 profile()->GetGeolocationContentSettingsMap()->GetContentSetting( |
| 286 requesting_frame_0, requesting_frame_0)); | 286 requesting_frame_0, requesting_frame_0)); |
| 287 EXPECT_EQ( | 287 EXPECT_EQ( |
| 288 CONTENT_SETTING_ALLOW, | 288 CONTENT_SETTING_ALLOW, |
| 289 profile()->GetGeolocationContentSettingsMap()->GetContentSetting( | 289 profile()->GetGeolocationContentSettingsMap()->GetContentSetting( |
| 290 requesting_frame_1, requesting_frame_0)); | 290 requesting_frame_1, requesting_frame_0)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 TEST_F(GeolocationPermissionContextTests, StopUpdating) { | 293 // TODO(jknotten): Remove this test once we have completely |
| 294 // switched over to client-based geolocation. |
| 295 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
| 296 #define MAYBE_StopUpdating DISABLED_StopUpdating |
| 297 #else |
| 298 #define MAYBE_StopUpdating StopUpdating |
| 299 #endif |
| 300 TEST_F(GeolocationPermissionContextTests, MAYBE_StopUpdating) { |
| 294 GURL requesting_frame("http://www.example.com/geolocation"); | 301 GURL requesting_frame("http://www.example.com/geolocation"); |
| 295 NavigateAndCommit(requesting_frame); | 302 NavigateAndCommit(requesting_frame); |
| 296 EXPECT_EQ(0, contents()->infobar_delegate_count()); | 303 EXPECT_EQ(0, contents()->infobar_delegate_count()); |
| 297 geolocation_permission_context_->RequestGeolocationPermission( | 304 geolocation_permission_context_->RequestGeolocationPermission( |
| 298 process_id(), render_id(), bridge_id(), requesting_frame); | 305 process_id(), render_id(), bridge_id(), requesting_frame); |
| 299 EXPECT_EQ(1, contents()->infobar_delegate_count()); | 306 EXPECT_EQ(1, contents()->infobar_delegate_count()); |
| 300 ConfirmInfoBarDelegate* infobar_0 = | 307 ConfirmInfoBarDelegate* infobar_0 = |
| 301 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); | 308 contents()->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); |
| 302 ASSERT_TRUE(infobar_0); | 309 ASSERT_TRUE(infobar_0); |
| 303 | 310 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 ASSERT_TRUE(infobar_1); | 422 ASSERT_TRUE(infobar_1); |
| 416 infobar_1->Accept(); | 423 infobar_1->Accept(); |
| 417 CheckPermissionMessageSentForTab(0, bridge_id() + 1, true); | 424 CheckPermissionMessageSentForTab(0, bridge_id() + 1, true); |
| 418 extra_tabs_[0]->RemoveInfoBar(infobar_1); | 425 extra_tabs_[0]->RemoveInfoBar(infobar_1); |
| 419 EXPECT_EQ(infobar_1, | 426 EXPECT_EQ(infobar_1, |
| 420 extra_tabs_[0]->removed_infobar_delegate_); | 427 extra_tabs_[0]->removed_infobar_delegate_); |
| 421 infobar_1->InfoBarClosed(); | 428 infobar_1->InfoBarClosed(); |
| 422 | 429 |
| 423 extra_tabs_.reset(); | 430 extra_tabs_.reset(); |
| 424 } | 431 } |
| OLD | NEW |