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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 browser_info->major_version <= 30 && | 479 browser_info->major_version <= 30 && |
480 browser_info->is_android; | 480 browser_info->is_android; |
481 if (!is_kitkat_webview) { | 481 if (!is_kitkat_webview) { |
482 // Page.getNavigationHistory isn't implemented in WebView for KitKat and | 482 // Page.getNavigationHistory isn't implemented in WebView for KitKat and |
483 // older Android releases. | 483 // older Android releases. |
484 status = web_view->GetUrl(&url); | 484 status = web_view->GetUrl(&url); |
485 if (status.IsError()) | 485 if (status.IsError()) |
486 return status; | 486 return status; |
487 } | 487 } |
488 } | 488 } |
489 value->reset(new base::StringValue(url)); | 489 value->reset(new base::Value(url)); |
490 return Status(kOk); | 490 return Status(kOk); |
491 } | 491 } |
492 | 492 |
493 Status ExecuteGoBack(Session* session, | 493 Status ExecuteGoBack(Session* session, |
494 WebView* web_view, | 494 WebView* web_view, |
495 const base::DictionaryValue& params, | 495 const base::DictionaryValue& params, |
496 std::unique_ptr<base::Value>* value, | 496 std::unique_ptr<base::Value>* value, |
497 Timeout* timeout) { | 497 Timeout* timeout) { |
498 timeout->SetDuration(session->page_load_timeout); | 498 timeout->SetDuration(session->page_load_timeout); |
499 Status status = web_view->TraverseHistory(-1, timeout); | 499 Status status = web_view->TraverseHistory(-1, timeout); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 } else { | 878 } else { |
879 status = web_view->CaptureScreenshot(&screenshot); | 879 status = web_view->CaptureScreenshot(&screenshot); |
880 } | 880 } |
881 if (status.IsError()) { | 881 if (status.IsError()) { |
882 LOG(WARNING) << "screenshot failed, retrying"; | 882 LOG(WARNING) << "screenshot failed, retrying"; |
883 status = web_view->CaptureScreenshot(&screenshot); | 883 status = web_view->CaptureScreenshot(&screenshot); |
884 } | 884 } |
885 if (status.IsError()) | 885 if (status.IsError()) |
886 return status; | 886 return status; |
887 | 887 |
888 value->reset(new base::StringValue(screenshot)); | 888 value->reset(new base::Value(screenshot)); |
889 return Status(kOk); | 889 return Status(kOk); |
890 } | 890 } |
891 | 891 |
892 Status ExecuteGetCookies(Session* session, | 892 Status ExecuteGetCookies(Session* session, |
893 WebView* web_view, | 893 WebView* web_view, |
894 const base::DictionaryValue& params, | 894 const base::DictionaryValue& params, |
895 std::unique_ptr<base::Value>* value, | 895 std::unique_ptr<base::Value>* value, |
896 Timeout* timeout) { | 896 Timeout* timeout) { |
897 std::list<Cookie> cookies; | 897 std::list<Cookie> cookies; |
898 Status status = GetVisibleCookies(web_view, &cookies); | 898 Status status = GetVisibleCookies(web_view, &cookies); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 return status; | 1077 return status; |
1078 } | 1078 } |
1079 | 1079 |
1080 Status ExecuteTakeHeapSnapshot(Session* session, | 1080 Status ExecuteTakeHeapSnapshot(Session* session, |
1081 WebView* web_view, | 1081 WebView* web_view, |
1082 const base::DictionaryValue& params, | 1082 const base::DictionaryValue& params, |
1083 std::unique_ptr<base::Value>* value, | 1083 std::unique_ptr<base::Value>* value, |
1084 Timeout* timeout) { | 1084 Timeout* timeout) { |
1085 return web_view->TakeHeapSnapshot(value); | 1085 return web_view->TakeHeapSnapshot(value); |
1086 } | 1086 } |
OLD | NEW |