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

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

Issue 11746025: [chromedriver]Implement command: title. (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 27 matching lines...) Expand all
38 const base::DictionaryValue&, 38 const base::DictionaryValue&,
39 const std::string&, 39 const std::string&,
40 scoped_ptr<base::Value>*, 40 scoped_ptr<base::Value>*,
41 std::string*)> execute_session_command = base::Bind( 41 std::string*)> execute_session_command = base::Bind(
42 &ExecuteSessionCommand, 42 &ExecuteSessionCommand,
43 &session_map_); 43 &session_map_);
44 command_map_.Set("get", base::Bind(execute_session_command, 44 command_map_.Set("get", base::Bind(execute_session_command,
45 base::Bind(&ExecuteGet))); 45 base::Bind(&ExecuteGet)));
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("title", base::Bind(execute_session_command,
kkania 2013/01/04 04:35:34 i think it should be getTitle; see http://code.goo
chrisgao (Use stgao instead) 2013/01/05 01:19:09 Done.
49 base::Bind(&ExecuteTitle)));
48 Command quit_command = base::Bind(execute_session_command, 50 Command quit_command = base::Bind(execute_session_command,
49 base::Bind(&ExecuteQuit, &session_map_)); 51 base::Bind(&ExecuteQuit, &session_map_));
50 command_map_.Set("quit", quit_command); 52 command_map_.Set("quit", quit_command);
51 53
52 // Non-session commands. 54 // Non-session commands.
53 command_map_.Set("newSession", 55 command_map_.Set("newSession",
54 base::Bind(&ExecuteNewSession, &session_map_, launcher_.get())); 56 base::Bind(&ExecuteNewSession, &session_map_, launcher_.get()));
55 command_map_.Set("quitAll", 57 command_map_.Set("quitAll",
56 base::Bind(&ExecuteQuitAll, quit_command, &session_map_)); 58 base::Bind(&ExecuteQuitAll, quit_command, &session_map_));
57 } 59 }
(...skipping 15 matching lines...) Expand all
73 } 75 }
74 *status_code = status.code(); 76 *status_code = status.code();
75 if (status.IsError()) { 77 if (status.IsError()) {
76 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); 78 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue());
77 error->SetString("message", status.message()); 79 error->SetString("message", status.message());
78 value->reset(error.release()); 80 value->reset(error.release());
79 } 81 }
80 if (!*value) 82 if (!*value)
81 value->reset(base::Value::CreateNullValue()); 83 value->reset(base::Value::CreateNullValue());
82 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698