| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 Status ExecuteSwitchToFrame(Session* session, | 343 Status ExecuteSwitchToFrame(Session* session, |
| 344 WebView* web_view, | 344 WebView* web_view, |
| 345 const base::DictionaryValue& params, | 345 const base::DictionaryValue& params, |
| 346 std::unique_ptr<base::Value>* value, | 346 std::unique_ptr<base::Value>* value, |
| 347 Timeout* timeout) { | 347 Timeout* timeout) { |
| 348 const base::Value* id; | 348 const base::Value* id; |
| 349 if (!params.Get("id", &id)) | 349 if (!params.Get("id", &id)) |
| 350 return Status(kUnknownError, "missing 'id'"); | 350 return Status(kUnknownError, "missing 'id'"); |
| 351 | 351 |
| 352 if (id->IsType(base::Value::TYPE_NULL)) { | 352 if (id->IsType(base::Value::Type::NONE)) { |
| 353 session->SwitchToTopFrame(); | 353 session->SwitchToTopFrame(); |
| 354 return Status(kOk); | 354 return Status(kOk); |
| 355 } | 355 } |
| 356 | 356 |
| 357 std::string script; | 357 std::string script; |
| 358 base::ListValue args; | 358 base::ListValue args; |
| 359 const base::DictionaryValue* id_dict; | 359 const base::DictionaryValue* id_dict; |
| 360 if (id->GetAsDictionary(&id_dict)) { | 360 if (id->GetAsDictionary(&id_dict)) { |
| 361 script = "function(elem) { return elem; }"; | 361 script = "function(elem) { return elem; }"; |
| 362 args.Append(id_dict->CreateDeepCopy()); | 362 args.Append(id_dict->CreateDeepCopy()); |
| (...skipping 714 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 |