| 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 "chrome/test/webdriver/webdriver_automation.h" | 5 #include "chrome/test/webdriver/webdriver_automation.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 if (!view_id.old_style()) { | 785 if (!view_id.old_style()) { |
| 786 AutomationMsg_NavigationResponseValues navigate_response; | 786 AutomationMsg_NavigationResponseValues navigate_response; |
| 787 if (!SendNavigateToURLJSONRequest(automation(), view_locator, url, | 787 if (!SendNavigateToURLJSONRequest(automation(), view_locator, url, |
| 788 0, &navigate_response, &auto_error)) { | 788 0, &navigate_response, &auto_error)) { |
| 789 *error = Error::FromAutomationError(auto_error); | 789 *error = Error::FromAutomationError(auto_error); |
| 790 return; | 790 return; |
| 791 } | 791 } |
| 792 } else { | 792 } else { |
| 793 scoped_refptr<BrowserProxy> browser = | 793 scoped_refptr<BrowserProxy> browser = |
| 794 automation()->GetBrowserWindow(view_locator.browser_index()); | 794 automation()->GetBrowserWindow(view_locator.browser_index()); |
| 795 if (!browser) { | 795 if (!browser.get()) { |
| 796 *error = new Error(kUnknownError, "Couldn't obtain browser proxy"); | 796 *error = new Error(kUnknownError, "Couldn't obtain browser proxy"); |
| 797 return; | 797 return; |
| 798 } | 798 } |
| 799 scoped_refptr<TabProxy> tab = browser->GetTab(view_locator.tab_index()); | 799 scoped_refptr<TabProxy> tab = browser->GetTab(view_locator.tab_index()); |
| 800 if (!tab) { | 800 if (!tab.get()) { |
| 801 *error = new Error(kUnknownError, "Couldn't obtain tab proxy"); | 801 *error = new Error(kUnknownError, "Couldn't obtain tab proxy"); |
| 802 return; | 802 return; |
| 803 } | 803 } |
| 804 if (!tab->NavigateToURLAsync(GURL(url))) { | 804 if (!tab->NavigateToURLAsync(GURL(url))) { |
| 805 *error = new Error(kUnknownError, "Unable to navigate to url"); | 805 *error = new Error(kUnknownError, "Unable to navigate to url"); |
| 806 return; | 806 return; |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 } | 809 } |
| 810 | 810 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 Error* Automation::CheckMaximizeSupported() { | 1209 Error* Automation::CheckMaximizeSupported() { |
| 1210 const char* message = | 1210 const char* message = |
| 1211 "Maximize automation interface is not supported for this version of " | 1211 "Maximize automation interface is not supported for this version of " |
| 1212 "Chrome."; | 1212 "Chrome."; |
| 1213 return CheckVersion(1160, message); | 1213 return CheckVersion(1160, message); |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 } // namespace webdriver | 1216 } // namespace webdriver |
| OLD | NEW |