| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 Timeout* timeout) { | 851 Timeout* timeout) { |
| 852 Status status = session->chrome->ActivateWebView(web_view->GetId()); | 852 Status status = session->chrome->ActivateWebView(web_view->GetId()); |
| 853 if (status.IsError()) | 853 if (status.IsError()) |
| 854 return status; | 854 return status; |
| 855 | 855 |
| 856 std::string screenshot; | 856 std::string screenshot; |
| 857 ChromeDesktopImpl* desktop = NULL; | 857 ChromeDesktopImpl* desktop = NULL; |
| 858 status = session->chrome->GetAsDesktop(&desktop); | 858 status = session->chrome->GetAsDesktop(&desktop); |
| 859 if (status.IsOk() && !session->force_devtools_screenshot) { | 859 if (status.IsOk() && !session->force_devtools_screenshot) { |
| 860 AutomationExtension* extension = NULL; | 860 AutomationExtension* extension = NULL; |
| 861 status = desktop->GetAutomationExtension(&extension); | 861 status = desktop->GetAutomationExtension(&extension, |
| 862 session->w3c_compliant); |
| 862 if (status.IsError()) | 863 if (status.IsError()) |
| 863 return status; | 864 return status; |
| 864 status = extension->CaptureScreenshot(&screenshot); | 865 status = extension->CaptureScreenshot(&screenshot); |
| 865 } else { | 866 } else { |
| 866 status = web_view->CaptureScreenshot(&screenshot); | 867 status = web_view->CaptureScreenshot(&screenshot); |
| 867 } | 868 } |
| 868 if (status.IsError()) { | 869 if (status.IsError()) { |
| 869 LOG(WARNING) << "screenshot failed, retrying"; | 870 LOG(WARNING) << "screenshot failed, retrying"; |
| 870 status = web_view->CaptureScreenshot(&screenshot); | 871 status = web_view->CaptureScreenshot(&screenshot); |
| 871 } | 872 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 return status; | 1065 return status; |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 Status ExecuteTakeHeapSnapshot(Session* session, | 1068 Status ExecuteTakeHeapSnapshot(Session* session, |
| 1068 WebView* web_view, | 1069 WebView* web_view, |
| 1069 const base::DictionaryValue& params, | 1070 const base::DictionaryValue& params, |
| 1070 std::unique_ptr<base::Value>* value, | 1071 std::unique_ptr<base::Value>* value, |
| 1071 Timeout* timeout) { | 1072 Timeout* timeout) { |
| 1072 return web_view->TakeHeapSnapshot(value); | 1073 return web_view->TakeHeapSnapshot(value); |
| 1073 } | 1074 } |
| OLD | NEW |