Chromium Code Reviews| 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/window_commands.h" | 5 #include "chrome/test/chromedriver/window_commands.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 status = web_view->HandleReceivedEvents(); | 215 status = web_view->HandleReceivedEvents(); |
| 216 if (status.IsError()) | 216 if (status.IsError()) |
| 217 return status; | 217 return status; |
| 218 | 218 |
| 219 if (web_view->GetJavaScriptDialogManager()->IsDialogOpen()) { | 219 if (web_view->GetJavaScriptDialogManager()->IsDialogOpen()) { |
| 220 std::string alert_text; | 220 std::string alert_text; |
| 221 status = | 221 status = |
| 222 web_view->GetJavaScriptDialogManager()->GetDialogMessage(&alert_text); | 222 web_view->GetJavaScriptDialogManager()->GetDialogMessage(&alert_text); |
| 223 if (status.IsError()) | 223 if (status.IsError()) |
| 224 return status; | 224 return status; |
| 225 status = web_view->GetJavaScriptDialogManager() | |
|
samuong
2016/03/30 17:22:56
please add a comment above this line saying:
// C
gmanikpure
2016/04/01 16:54:07
Done.
| |
| 226 ->HandleDialog(true, session->prompt_text.get()); | |
|
samuong
2016/03/30 17:22:56
nit: break line after the opening ( for HandleDial
gmanikpure
2016/04/01 16:54:07
Done.
| |
| 227 if (status.IsError()) | |
| 228 return status; | |
| 225 return Status(kUnexpectedAlertOpen, "{Alert text : " + alert_text + "}"); | 229 return Status(kUnexpectedAlertOpen, "{Alert text : " + alert_text + "}"); |
| 226 } | 230 } |
| 227 | 231 |
| 228 Status nav_status(kOk); | 232 Status nav_status(kOk); |
| 229 for (int attempt = 0; attempt < 3; attempt++) { | 233 for (int attempt = 0; attempt < 3; attempt++) { |
| 230 if (attempt == 2) { | 234 if (attempt == 2) { |
| 231 // Switch to main frame and retry command if subframe no longer exists. | 235 // Switch to main frame and retry command if subframe no longer exists. |
| 232 session->SwitchToTopFrame(); | 236 session->SwitchToTopFrame(); |
| 233 } | 237 } |
| 234 | 238 |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1053 return status; | 1057 return status; |
| 1054 } | 1058 } |
| 1055 | 1059 |
| 1056 Status ExecuteTakeHeapSnapshot( | 1060 Status ExecuteTakeHeapSnapshot( |
| 1057 Session* session, | 1061 Session* session, |
| 1058 WebView* web_view, | 1062 WebView* web_view, |
| 1059 const base::DictionaryValue& params, | 1063 const base::DictionaryValue& params, |
| 1060 scoped_ptr<base::Value>* value) { | 1064 scoped_ptr<base::Value>* value) { |
| 1061 return web_view->TakeHeapSnapshot(value); | 1065 return web_view->TakeHeapSnapshot(value); |
| 1062 } | 1066 } |
| OLD | NEW |