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

Unified Diff: chrome/test/webdriver/server.cc

Issue 6723004: ChromeDriver should be able to focus on a frame using its frame element, (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 9 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/webdriver/server.cc
===================================================================
--- chrome/test/webdriver/server.cc (revision 79141)
+++ chrome/test/webdriver/server.cc (working copy)
@@ -77,25 +77,8 @@
base::WaitableEvent* shutdown_event) {
dispatcher->AddShutdown("/shutdown", shutdown_event);
- dispatcher->Add<CreateSession>( "/session");
- dispatcher->Add<BackCommand>( "/session/*/back");
- dispatcher->Add<ExecuteCommand>( "/session/*/execute");
- dispatcher->Add<ForwardCommand>( "/session/*/forward");
- dispatcher->Add<SwitchFrameCommand>( "/session/*/frame");
- dispatcher->Add<RefreshCommand>( "/session/*/refresh");
- dispatcher->Add<SourceCommand>( "/session/*/source");
- dispatcher->Add<SpeedCommand>( "/session/*/speed");
- dispatcher->Add<TitleCommand>( "/session/*/title");
- dispatcher->Add<URLCommand>( "/session/*/url");
- dispatcher->Add<WindowCommand>( "/session/*/window");
- dispatcher->Add<WindowHandleCommand>( "/session/*/window_handle");
- dispatcher->Add<WindowHandlesCommand>("/session/*/window_handles");
- dispatcher->Add<ImplicitWaitCommand>( "/session/*/timeouts/implicit_wait");
+ dispatcher->Add<CreateSession>("/session");
- // Cookie functions.
- dispatcher->Add<CookieCommand>( "/session/*/cookie");
- dispatcher->Add<NamedCookieCommand>("/session/*/cookie/*");
-
// WebElement commands
dispatcher->Add<FindOneElementCommand>( "/session/*/element");
dispatcher->Add<FindManyElementsCommand>("/session/*/elements");
@@ -124,6 +107,30 @@
dispatcher->Add<DragCommand>( "/session/*/element/*/drag");
dispatcher->Add<HoverCommand>("/session/*/element/*/hover");
+ // All session based commands should be listed after the element based
+ // commands to avoid potential mapping conflicts from an overzealous
+ // wildcard match. For example, /session/*/title maps to the handler to
+ // fetch the page title. If mapped first, this would overwrite the handler
+ // for /session/*/element/*/attribute/title, which should fetch the title
+ // attribute of the element.
+ dispatcher->Add<BackCommand>( "/session/*/back");
+ dispatcher->Add<ExecuteCommand>( "/session/*/execute");
+ dispatcher->Add<ForwardCommand>( "/session/*/forward");
+ dispatcher->Add<SwitchFrameCommand>( "/session/*/frame");
+ dispatcher->Add<RefreshCommand>( "/session/*/refresh");
+ dispatcher->Add<SourceCommand>( "/session/*/source");
+ dispatcher->Add<SpeedCommand>( "/session/*/speed");
+ dispatcher->Add<TitleCommand>( "/session/*/title");
+ dispatcher->Add<URLCommand>( "/session/*/url");
+ dispatcher->Add<WindowCommand>( "/session/*/window");
+ dispatcher->Add<WindowHandleCommand>( "/session/*/window_handle");
+ dispatcher->Add<WindowHandlesCommand>("/session/*/window_handles");
+ dispatcher->Add<ImplicitWaitCommand>( "/session/*/timeouts/implicit_wait");
+
+ // Cookie functions.
+ dispatcher->Add<CookieCommand>( "/session/*/cookie");
+ dispatcher->Add<NamedCookieCommand>("/session/*/cookie/*");
+
// Commands that have not been implemented yet. We list these out explicitly
// so that tests that attempt to use them fail with a meaningful error.
dispatcher->SetNotImplemented("/session/*/execute_async");

Powered by Google App Engine
This is Rietveld 408576698