| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return false; | 341 return false; |
| 342 } | 342 } |
| 343 | 343 |
| 344 current_url_ = embedded_test_server()->GetURL(html_for_tests_); | 344 current_url_ = embedded_test_server()->GetURL(html_for_tests_); |
| 345 LOG(WARNING) << "before navigate"; | 345 LOG(WARNING) << "before navigate"; |
| 346 if (options == INITIALIZATION_OFFTHERECORD) { | 346 if (options == INITIALIZATION_OFFTHERECORD) { |
| 347 current_browser_ = ui_test_utils::OpenURLOffTheRecord( | 347 current_browser_ = ui_test_utils::OpenURLOffTheRecord( |
| 348 browser()->profile(), current_url_); | 348 browser()->profile(), current_url_); |
| 349 } else { | 349 } else { |
| 350 current_browser_ = browser(); | 350 current_browser_ = browser(); |
| 351 if (options == INITIALIZATION_NEWTAB) | 351 if (options == INITIALIZATION_NEWTAB) { |
| 352 chrome::NewTab(current_browser_); | 352 ui_test_utils::NavigateToURLWithDisposition( |
| 353 ui_test_utils::NavigateToURL(current_browser_, current_url_); | 353 current_browser_, current_url_, NEW_FOREGROUND_TAB, |
| 354 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | |
| 355 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 356 } else { |
| 357 ui_test_utils::NavigateToURL(current_browser_, current_url_); |
| 358 } |
| 354 } | 359 } |
| 355 LOG(WARNING) << "after navigate"; | 360 LOG(WARNING) << "after navigate"; |
| 356 | 361 |
| 357 EXPECT_TRUE(current_browser_); | 362 EXPECT_TRUE(current_browser_); |
| 358 return !!current_browser_; | 363 return !!current_browser_; |
| 359 } | 364 } |
| 360 | 365 |
| 361 void GeolocationBrowserTest::LoadIFrames(int number_iframes) { | 366 void GeolocationBrowserTest::LoadIFrames(int number_iframes) { |
| 362 // Limit to 3 iframes. | 367 // Limit to 3 iframes. |
| 363 DCHECK_LT(0, number_iframes); | 368 DCHECK_LT(0, number_iframes); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 741 |
| 737 set_iframe_xpath("//iframe[@id='iframe_2']"); | 742 set_iframe_xpath("//iframe[@id='iframe_2']"); |
| 738 AddGeolocationWatch(false); | 743 AddGeolocationWatch(false); |
| 739 | 744 |
| 740 std::string script = | 745 std::string script = |
| 741 "window.domAutomationController.send(window.close());"; | 746 "window.domAutomationController.send(window.close());"; |
| 742 bool result = content::ExecuteScript( | 747 bool result = content::ExecuteScript( |
| 743 current_browser()->tab_strip_model()->GetActiveWebContents(), script); | 748 current_browser()->tab_strip_model()->GetActiveWebContents(), script); |
| 744 EXPECT_EQ(result, true); | 749 EXPECT_EQ(result, true); |
| 745 } | 750 } |
| OLD | NEW |