| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
| 8 #include "chrome/browser/app_modal_dialog.h" | 8 #include "chrome/browser/app_modal_dialog.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 #endif | 380 #endif |
| 381 | 381 |
| 382 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_ErrorOnPermissionDenied) { | 382 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_ErrorOnPermissionDenied) { |
| 383 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 383 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
| 384 AddGeolocationWatch(true); | 384 AddGeolocationWatch(true); |
| 385 // Infobar was displayed, deny access and check for error code. | 385 // Infobar was displayed, deny access and check for error code. |
| 386 SetInfobarResponse(current_url_, false); | 386 SetInfobarResponse(current_url_, false); |
| 387 CheckStringValueFromJavascript("1", "geoGetLastError()"); | 387 CheckStringValueFromJavascript("1", "geoGetLastError()"); |
| 388 } | 388 } |
| 389 | 389 |
| 390 #if defined(OS_MACOSX) | |
| 391 // TODO(bulach): investigate why this fails on mac. It may be related to: | 390 // TODO(bulach): investigate why this fails on mac. It may be related to: |
| 392 // http://crbug.com/29424 | 391 // http://crbug.com/29424. This also fails on Vista: http://crbug.com/44589 |
| 393 #define MAYBE_NoInfobarForSecondTab DISABLED_NoInfobarForSecondTab | 392 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_NoInfobarForSecondTab) { |
| 394 #else | |
| 395 #define MAYBE_NoInfobarForSecondTab NoInfobarForSecondTab | |
| 396 #endif | |
| 397 | |
| 398 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_NoInfobarForSecondTab) { | |
| 399 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 393 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
| 400 AddGeolocationWatch(true); | 394 AddGeolocationWatch(true); |
| 401 SetInfobarResponse(current_url_, true); | 395 SetInfobarResponse(current_url_, true); |
| 402 // Disables further prompts from this tab. | 396 // Disables further prompts from this tab. |
| 403 CheckStringValueFromJavascript("false", "geoEnableAlerts(false)"); | 397 CheckStringValueFromJavascript("false", "geoEnableAlerts(false)"); |
| 404 | 398 |
| 405 // Checks infobar will not be created a second tab. | 399 // Checks infobar will not be created a second tab. |
| 406 ASSERT_TRUE(Initialize(INITIALIZATION_NEWTAB)); | 400 ASSERT_TRUE(Initialize(INITIALIZATION_NEWTAB)); |
| 407 AddGeolocationWatch(false); | 401 AddGeolocationWatch(false); |
| 408 CheckGeoposition(MockLocationProvider::instance_->position_); | 402 CheckGeoposition(MockLocationProvider::instance_->position_); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 SetInfobarResponse(iframe0_url_, true); | 629 SetInfobarResponse(iframe0_url_, true); |
| 636 CheckGeoposition(MockLocationProvider::instance_->position_); | 630 CheckGeoposition(MockLocationProvider::instance_->position_); |
| 637 CheckStringValueFromJavascript("false", "geoEnableAlerts(false)"); | 631 CheckStringValueFromJavascript("false", "geoEnableAlerts(false)"); |
| 638 | 632 |
| 639 // Permission should be requested after adding a watch. | 633 // Permission should be requested after adding a watch. |
| 640 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 634 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
| 641 AddGeolocationWatch(true); | 635 AddGeolocationWatch(true); |
| 642 SetInfobarResponse(iframe1_url_, true); | 636 SetInfobarResponse(iframe1_url_, true); |
| 643 CheckGeoposition(MockLocationProvider::instance_->position_); | 637 CheckGeoposition(MockLocationProvider::instance_->position_); |
| 644 } | 638 } |
| OLD | NEW |