| 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" |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 int node_id; | 549 int node_id; |
| 550 status = internal::GetNodeIdFromFunction( | 550 status = internal::GetNodeIdFromFunction( |
| 551 client_.get(), context_id, "function(element) { return element; }", | 551 client_.get(), context_id, "function(element) { return element; }", |
| 552 args, &found_node, &node_id, w3c_compliant_); | 552 args, &found_node, &node_id, w3c_compliant_); |
| 553 if (status.IsError()) | 553 if (status.IsError()) |
| 554 return status; | 554 return status; |
| 555 if (!found_node) | 555 if (!found_node) |
| 556 return Status(kUnknownError, "no node ID for file input"); | 556 return Status(kUnknownError, "no node ID for file input"); |
| 557 base::DictionaryValue params; | 557 base::DictionaryValue params; |
| 558 params.SetInteger("nodeId", node_id); | 558 params.SetInteger("nodeId", node_id); |
| 559 params.Set("files", file_list.DeepCopy()); | 559 params.Set("files", base::MakeUnique<base::Value>(file_list)); |
| 560 return client_->SendCommand("DOM.setFileInputFiles", params); | 560 return client_->SendCommand("DOM.setFileInputFiles", params); |
| 561 } | 561 } |
| 562 | 562 |
| 563 Status WebViewImpl::TakeHeapSnapshot(std::unique_ptr<base::Value>* snapshot) { | 563 Status WebViewImpl::TakeHeapSnapshot(std::unique_ptr<base::Value>* snapshot) { |
| 564 return heap_snapshot_taker_->TakeSnapshot(snapshot); | 564 return heap_snapshot_taker_->TakeSnapshot(snapshot); |
| 565 } | 565 } |
| 566 | 566 |
| 567 Status WebViewImpl::InitProfileInternal() { | 567 Status WebViewImpl::InitProfileInternal() { |
| 568 base::DictionaryValue params; | 568 base::DictionaryValue params; |
| 569 | 569 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 938 |
| 939 if (!cmd_result->GetInteger("nodeId", node_id)) | 939 if (!cmd_result->GetInteger("nodeId", node_id)) |
| 940 return Status(kUnknownError, "DOM.requestNode missing int 'nodeId'"); | 940 return Status(kUnknownError, "DOM.requestNode missing int 'nodeId'"); |
| 941 *found_node = true; | 941 *found_node = true; |
| 942 return Status(kOk); | 942 return Status(kOk); |
| 943 } | 943 } |
| 944 | 944 |
| 945 | 945 |
| 946 | 946 |
| 947 } // namespace internal | 947 } // namespace internal |
| OLD | NEW |