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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 CheckGeoposition(fake_latitude_, fake_longitude_); | 610 CheckGeoposition(fake_latitude_, fake_longitude_); |
611 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); | 611 CheckStringValueFromJavascript("0", "geoSetMaxNavigateCount(0)"); |
612 | 612 |
613 // Permission should be requested after adding a watch. | 613 // Permission should be requested after adding a watch. |
614 iframe_xpath_ = L"//iframe[@id='iframe_1']"; | 614 iframe_xpath_ = L"//iframe[@id='iframe_1']"; |
615 AddGeolocationWatch(true); | 615 AddGeolocationWatch(true); |
616 SetInfobarResponse(iframe_urls_[1], true); | 616 SetInfobarResponse(iframe_urls_[1], true); |
617 CheckGeoposition(fake_latitude_, fake_longitude_); | 617 CheckGeoposition(fake_latitude_, fake_longitude_); |
618 } | 618 } |
619 | 619 |
620 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) { | 620 // Crashes on linux. http://crbug.com/129065 |
| 621 #if defined(OS_LINUX) |
| 622 #define MAYBE_TwoWatchesInOneFrame DISABLED_TwoWatchesInOneFrame |
| 623 #else |
| 624 #define MAYBE_TwoWatchesInOneFrame TwoWatchesInOneFrame |
| 625 #endif |
| 626 IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_TwoWatchesInOneFrame) { |
621 html_for_tests_ = "files/geolocation/two_watches.html"; | 627 html_for_tests_ = "files/geolocation/two_watches.html"; |
622 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); | 628 ASSERT_TRUE(Initialize(INITIALIZATION_NONE)); |
623 // First, set the JavaScript to navigate when it receives |final_position|. | 629 // First, set the JavaScript to navigate when it receives |final_position|. |
624 double final_position_latitude = 3.17; | 630 double final_position_latitude = 3.17; |
625 double final_position_longitude = 4.23; | 631 double final_position_longitude = 4.23; |
626 std::string script = base::StringPrintf( | 632 std::string script = base::StringPrintf( |
627 "window.domAutomationController.send(geoSetFinalPosition(%f, %f))", | 633 "window.domAutomationController.send(geoSetFinalPosition(%f, %f))", |
628 final_position_latitude, final_position_longitude); | 634 final_position_latitude, final_position_longitude); |
629 std::string js_result; | 635 std::string js_result; |
630 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( | 636 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 "window.domAutomationController.setAutomationId(0);" | 672 "window.domAutomationController.setAutomationId(0);" |
667 "window.domAutomationController.send(window.close());"; | 673 "window.domAutomationController.send(window.close());"; |
668 bool result = | 674 bool result = |
669 ui_test_utils::ExecuteJavaScript( | 675 ui_test_utils::ExecuteJavaScript( |
670 current_browser_->GetSelectedWebContents()->GetRenderViewHost(), | 676 current_browser_->GetSelectedWebContents()->GetRenderViewHost(), |
671 L"", UTF8ToWide(script)); | 677 L"", UTF8ToWide(script)); |
672 EXPECT_EQ(result, true); | 678 EXPECT_EQ(result, true); |
673 } | 679 } |
674 | 680 |
675 } // namespace | 681 } // namespace |
OLD | NEW |