| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/commands.h" | 5 #include "chrome/test/chromedriver/commands.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const CommandCallback& callback) { | 38 const CommandCallback& callback) { |
| 39 base::DictionaryValue build; | 39 base::DictionaryValue build; |
| 40 build.SetString("version", "alpha"); | 40 build.SetString("version", "alpha"); |
| 41 | 41 |
| 42 base::DictionaryValue os; | 42 base::DictionaryValue os; |
| 43 os.SetString("name", base::SysInfo::OperatingSystemName()); | 43 os.SetString("name", base::SysInfo::OperatingSystemName()); |
| 44 os.SetString("version", base::SysInfo::OperatingSystemVersion()); | 44 os.SetString("version", base::SysInfo::OperatingSystemVersion()); |
| 45 os.SetString("arch", base::SysInfo::OperatingSystemArchitecture()); | 45 os.SetString("arch", base::SysInfo::OperatingSystemArchitecture()); |
| 46 | 46 |
| 47 base::DictionaryValue info; | 47 base::DictionaryValue info; |
| 48 info.Set("build", build.DeepCopy()); | 48 info.Set("build", base::MakeUnique<base::Value>(build)); |
| 49 info.Set("os", os.DeepCopy()); | 49 info.Set("os", base::MakeUnique<base::Value>(os)); |
| 50 callback.Run(Status(kOk), std::unique_ptr<base::Value>(info.DeepCopy()), | 50 callback.Run(Status(kOk), std::unique_ptr<base::Value>(info.DeepCopy()), |
| 51 std::string(), false); | 51 std::string(), false); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void ExecuteCreateSession( | 54 void ExecuteCreateSession( |
| 55 SessionThreadMap* session_thread_map, | 55 SessionThreadMap* session_thread_map, |
| 56 const Command& init_session_cmd, | 56 const Command& init_session_cmd, |
| 57 const base::DictionaryValue& params, | 57 const base::DictionaryValue& params, |
| 58 const std::string& session_id, | 58 const std::string& session_id, |
| 59 const CommandCallback& callback) { | 59 const CommandCallback& callback) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 85 const Status& status, | 85 const Status& status, |
| 86 std::unique_ptr<base::Value> value, | 86 std::unique_ptr<base::Value> value, |
| 87 const std::string& session_id, | 87 const std::string& session_id, |
| 88 bool w3c_compliant) { | 88 bool w3c_compliant) { |
| 89 if (!session_remaining_count) | 89 if (!session_remaining_count) |
| 90 return; | 90 return; |
| 91 | 91 |
| 92 (*session_remaining_count)--; | 92 (*session_remaining_count)--; |
| 93 | 93 |
| 94 std::unique_ptr<base::DictionaryValue> session(new base::DictionaryValue()); | 94 std::unique_ptr<base::DictionaryValue> session(new base::DictionaryValue()); |
| 95 session->Set("id", new base::Value(session_id)); | 95 session->SetString("id", session_id); |
| 96 session->Set("capabilities", value->DeepCopy()); | 96 session->Set("capabilities", base::MakeUnique<base::Value>(*value)); |
| 97 session_list->Append(std::move(session)); | 97 session_list->Append(std::move(session)); |
| 98 | 98 |
| 99 if (!*session_remaining_count) { | 99 if (!*session_remaining_count) { |
| 100 all_get_session_func.Run(); | 100 all_get_session_func.Run(); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 void ExecuteGetSessions(const Command& session_capabilities_command, | 106 void ExecuteGetSessions(const Command& session_capabilities_command, |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 | 327 |
| 328 namespace internal { | 328 namespace internal { |
| 329 | 329 |
| 330 void CreateSessionOnSessionThreadForTesting(const std::string& id) { | 330 void CreateSessionOnSessionThreadForTesting(const std::string& id) { |
| 331 SetThreadLocalSession(base::MakeUnique<Session>(id)); | 331 SetThreadLocalSession(base::MakeUnique<Session>(id)); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace internal | 334 } // namespace internal |
| OLD | NEW |