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

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

Issue 11746025: [chromedriver]Implement command: title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolved merge conflict. 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
« no previous file with comments | « chrome/test/chromedriver/commands.h ('k') | chrome/test/chromedriver/run_py_tests.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/commands.h" 5 #include "chrome/test/chromedriver/commands.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 base::ListValue args; 141 base::ListValue args;
142 args.Append(new base::StringValue(xpath)); 142 args.Append(new base::StringValue(xpath));
143 std::string frame; 143 std::string frame;
144 Status status = session->chrome->GetFrameByFunction( 144 Status status = session->chrome->GetFrameByFunction(
145 session->frame, evaluate_xpath_script, args, &frame); 145 session->frame, evaluate_xpath_script, args, &frame);
146 if (status.IsError()) 146 if (status.IsError())
147 return status; 147 return status;
148 session->frame = frame; 148 session->frame = frame;
149 return Status(kOk); 149 return Status(kOk);
150 } 150 }
151
152 Status ExecuteGetTitle(
153 Session* session,
154 const base::DictionaryValue& params,
155 scoped_ptr<base::Value>* value) {
156 const char* kGetTitleScript =
157 "function() {"
158 " if (document.title)"
159 " return document.title;"
160 " else"
161 " return document.URL;"
162 "}";
163 base::ListValue args;
164 return session->chrome->CallFunction(
165 session->frame, kGetTitleScript, args, value);
166 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/commands.h ('k') | chrome/test/chromedriver/run_py_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698