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

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

Issue 147083010: [chromedriver] Fix clicking on an <area> element broken by a blink change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address off-line comments. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/element_util.cc
diff --git a/chrome/test/chromedriver/element_util.cc b/chrome/test/chromedriver/element_util.cc
index ec0c962fe675e737c8d397aae9d1c6184ebb5e15..fc27c48778d873a7832f5d93414bc350b1013b88 100644
--- a/chrome/test/chromedriver/element_util.cc
+++ b/chrome/test/chromedriver/element_util.cc
@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/test/chromedriver/basic_types.h"
+#include "chrome/test/chromedriver/chrome/chrome.h"
#include "chrome/test/chromedriver/chrome/js.h"
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/web_view.h"
@@ -391,9 +392,20 @@ Status GetElementClickableLocation(
if (status.IsError())
return status;
+ std::string tmp_element_id = element_id;
+ if (tag_name == "area" && session->chrome->GetBuildNo() < 1799 &&
+ session->chrome->GetBuildNo() >= 1666) {
+ // This is to skip clickable verification for <area>.
+ // The problem is caused by document.ElementFromPoint(crbug.com/338601).
+ // It was introduced by blink r159012, which rolled into chromium r227489.
+ // And it was fixed in blink r165426, which rolled into chromium r245994.
+ // TODO(stgao): Revert after 33 is not supported.
+ tmp_element_id = std::string();
+ }
+
status = ScrollElementRegionIntoView(
session, web_view, target_element_id, rect,
- true /* center */, element_id, location);
+ true /* center */, tmp_element_id, location);
if (status.IsError())
return status;
location->Offset(rect.Width() / 2, rect.Height() / 2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698