| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromedriver/session_commands.h" | 5 #include "chrome/test/chromedriver/session_commands.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" // For CHECK macros. | 10 #include "base/logging.h" // For CHECK macros. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 if (window_name == name) { | 151 if (window_name == name) { |
| 152 web_view = *it; | 152 web_view = *it; |
| 153 break; | 153 break; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 if (!web_view) | 158 if (!web_view) |
| 159 return Status(kNoSuchWindow); | 159 return Status(kNoSuchWindow); |
| 160 session->window = web_view->GetId(); | 160 session->window = web_view->GetId(); |
| 161 session->frame = ""; | 161 session->SwitchToTopFrame(); |
| 162 session->mouse_position = WebPoint(0, 0); | 162 session->mouse_position = WebPoint(0, 0); |
| 163 return Status(kOk); | 163 return Status(kOk); |
| 164 } | 164 } |
| 165 | 165 |
| 166 Status ExecuteSetTimeout( | 166 Status ExecuteSetTimeout( |
| 167 Session* session, | 167 Session* session, |
| 168 const base::DictionaryValue& params, | 168 const base::DictionaryValue& params, |
| 169 scoped_ptr<base::Value>* value) { | 169 scoped_ptr<base::Value>* value) { |
| 170 int ms; | 170 int ms; |
| 171 if (!params.GetInteger("ms", &ms) || ms < 0) | 171 if (!params.GetInteger("ms", &ms) || ms < 0) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 Status ExecuteDismissAlert( | 240 Status ExecuteDismissAlert( |
| 241 Session* session, | 241 Session* session, |
| 242 const base::DictionaryValue& params, | 242 const base::DictionaryValue& params, |
| 243 scoped_ptr<base::Value>* value) { | 243 scoped_ptr<base::Value>* value) { |
| 244 Status status = session->chrome->HandleJavaScriptDialog( | 244 Status status = session->chrome->HandleJavaScriptDialog( |
| 245 false, session->prompt_text); | 245 false, session->prompt_text); |
| 246 session->prompt_text = ""; | 246 session->prompt_text = ""; |
| 247 return status; | 247 return status; |
| 248 } | 248 } |
| OLD | NEW |