Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/test/chromedriver/command_executor_impl.cc

Issue 11884058: [chromedriver] Implement commands: findChildElement, findChildElements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_executor_impl.h" 5 #include "chrome/test/chromedriver/command_executor_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 command_map_.Set("executeScript", base::Bind(execute_session_command, 46 command_map_.Set("executeScript", base::Bind(execute_session_command,
47 base::Bind(&ExecuteExecuteScript))); 47 base::Bind(&ExecuteExecuteScript)));
48 command_map_.Set("switchToFrame", base::Bind(execute_session_command, 48 command_map_.Set("switchToFrame", base::Bind(execute_session_command,
49 base::Bind(&ExecuteSwitchToFrame))); 49 base::Bind(&ExecuteSwitchToFrame)));
50 command_map_.Set("getTitle", base::Bind(execute_session_command, 50 command_map_.Set("getTitle", base::Bind(execute_session_command,
51 base::Bind(&ExecuteGetTitle))); 51 base::Bind(&ExecuteGetTitle)));
52 command_map_.Set("findElement", base::Bind(execute_session_command, 52 command_map_.Set("findElement", base::Bind(execute_session_command,
53 base::Bind(&ExecuteFindElement))); 53 base::Bind(&ExecuteFindElement)));
54 command_map_.Set("findElements", base::Bind(execute_session_command, 54 command_map_.Set("findElements", base::Bind(execute_session_command,
55 base::Bind(&ExecuteFindElements))); 55 base::Bind(&ExecuteFindElements)));
56 command_map_.Set("findChildElement", base::Bind(execute_session_command,
57 base::Bind(&ExecuteFindChildElement)));
58 command_map_.Set("findChildElements", base::Bind(execute_session_command,
59 base::Bind(&ExecuteFindChildElements)));
56 command_map_.Set("setTimeout", base::Bind(execute_session_command, 60 command_map_.Set("setTimeout", base::Bind(execute_session_command,
57 base::Bind(&ExecuteSetTimeout))); 61 base::Bind(&ExecuteSetTimeout)));
58 Command quit_command = base::Bind(execute_session_command, 62 Command quit_command = base::Bind(execute_session_command,
59 base::Bind(&ExecuteQuit, &session_map_)); 63 base::Bind(&ExecuteQuit, &session_map_));
60 command_map_.Set("quit", quit_command); 64 command_map_.Set("quit", quit_command);
61 65
62 // Non-session commands. 66 // Non-session commands.
63 command_map_.Set("newSession", 67 command_map_.Set("newSession",
64 base::Bind(&ExecuteNewSession, &session_map_, launcher_.get())); 68 base::Bind(&ExecuteNewSession, &session_map_, launcher_.get()));
65 command_map_.Set("quitAll", 69 command_map_.Set("quitAll",
(...skipping 17 matching lines...) Expand all
83 } 87 }
84 *status_code = status.code(); 88 *status_code = status.code();
85 if (status.IsError()) { 89 if (status.IsError()) {
86 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); 90 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue());
87 error->SetString("message", status.message()); 91 error->SetString("message", status.message());
88 value->reset(error.release()); 92 value->reset(error.release());
89 } 93 }
90 if (!*value) 94 if (!*value)
91 value->reset(base::Value::CreateNullValue()); 95 value->reset(base::Value::CreateNullValue());
92 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698