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

Unified Diff: chrome/test/chromedriver/commands.cc

Issue 11746025: [chromedriver]Implement command: title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/commands.cc
diff --git a/chrome/test/chromedriver/commands.cc b/chrome/test/chromedriver/commands.cc
index f90388ab0648645c74f94b91098fb5b473964eda..38a77113e9ef0434ae09b89598716c830bbd8546 100644
--- a/chrome/test/chromedriver/commands.cc
+++ b/chrome/test/chromedriver/commands.cc
@@ -105,3 +105,19 @@ Status ExecuteExecuteScript(
return session->chrome->CallFunction(
"function(){" + script + "}", *args, value);
}
+
+Status ExecuteGetTitle(
+ Session* session,
+ const base::DictionaryValue& params,
+ scoped_ptr<base::Value>* value) {
+ const char* kGetTitleScript =
+ "function() {"
+ " if (document.title)"
+ " return document.title;"
+ " else"
+ " return document.URL;"
+ "}";
+ base::ListValue args;
+ return session->chrome->CallFunction(
+ kGetTitleScript, args, value);
+}

Powered by Google App Engine
This is Rietveld 408576698