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/chrome/web_view_impl.h" | 5 #include "chrome/test/chromedriver/chrome/web_view_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ptr_util.h" |
14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
16 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
18 #include "base/values.h" | 19 #include "base/values.h" |
19 #include "chrome/test/chromedriver/chrome/browser_info.h" | 20 #include "chrome/test/chromedriver/chrome/browser_info.h" |
20 #include "chrome/test/chromedriver/chrome/debugger_tracker.h" | 21 #include "chrome/test/chromedriver/chrome/debugger_tracker.h" |
21 #include "chrome/test/chromedriver/chrome/devtools_client_impl.h" | 22 #include "chrome/test/chromedriver/chrome/devtools_client_impl.h" |
22 #include "chrome/test/chromedriver/chrome/dom_tracker.h" | 23 #include "chrome/test/chromedriver/chrome/dom_tracker.h" |
23 #include "chrome/test/chromedriver/chrome/frame_tracker.h" | 24 #include "chrome/test/chromedriver/chrome/frame_tracker.h" |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 Status status = EvaluateScript(client, context_id, expression, ReturnByValue, | 828 Status status = EvaluateScript(client, context_id, expression, ReturnByValue, |
828 &temp_result); | 829 &temp_result); |
829 if (status.IsError()) | 830 if (status.IsError()) |
830 return status; | 831 return status; |
831 | 832 |
832 std::string type; | 833 std::string type; |
833 if (!temp_result->GetString("type", &type)) | 834 if (!temp_result->GetString("type", &type)) |
834 return Status(kUnknownError, "Runtime.evaluate missing string 'type'"); | 835 return Status(kUnknownError, "Runtime.evaluate missing string 'type'"); |
835 | 836 |
836 if (type == "undefined") { | 837 if (type == "undefined") { |
837 *result = base::Value::CreateNullValue(); | 838 *result = base::MakeUnique<base::Value>(); |
838 } else { | 839 } else { |
839 base::Value* value; | 840 base::Value* value; |
840 if (!temp_result->Get("value", &value)) | 841 if (!temp_result->Get("value", &value)) |
841 return Status(kUnknownError, "Runtime.evaluate missing 'value'"); | 842 return Status(kUnknownError, "Runtime.evaluate missing 'value'"); |
842 result->reset(value->DeepCopy()); | 843 result->reset(value->DeepCopy()); |
843 } | 844 } |
844 return Status(kOk); | 845 return Status(kOk); |
845 } | 846 } |
846 | 847 |
847 Status ParseCallFunctionResult(const base::Value& temp_result, | 848 Status ParseCallFunctionResult(const base::Value& temp_result, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 | 921 |
921 if (!cmd_result->GetInteger("nodeId", node_id)) | 922 if (!cmd_result->GetInteger("nodeId", node_id)) |
922 return Status(kUnknownError, "DOM.requestNode missing int 'nodeId'"); | 923 return Status(kUnknownError, "DOM.requestNode missing int 'nodeId'"); |
923 *found_node = true; | 924 *found_node = true; |
924 return Status(kOk); | 925 return Status(kOk); |
925 } | 926 } |
926 | 927 |
927 | 928 |
928 | 929 |
929 } // namespace internal | 930 } // namespace internal |
OLD | NEW |