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); |
+} |