[ChromeDriver] Updated selenium test

In W3C mode the offset of an element is measured relative to
the center of the element and in legacy mode the offset
is measured relative to the upper-left corner.
Changed some Selenium tests to conform these W3C standards.

Bug: chromedriver:2858

Change-Id: If3545d2b0f671b6b63682376cd536e558add7710
diff --git a/jar/tests-selenium.jar b/jar/tests-selenium.jar
index 47e05d1..a371cc4 100644
--- a/jar/tests-selenium.jar
+++ b/jar/tests-selenium.jar
Binary files differ
diff --git a/seleniumHQ.patch b/seleniumHQ.patch
index 33855a2..8d6d7b2 100644
--- a/seleniumHQ.patch
+++ b/seleniumHQ.patch
@@ -192,10 +192,19 @@
      TemporaryFilesystem tempFs = TemporaryFilesystem.getDefaultTmpFS();
      tempPageDir = tempFs.createTempDir("pages", "test");
 diff --git a/java/client/test/org/openqa/selenium/interactions/BasicKeyboardInterfaceTest.java b/java/client/test/org/openqa/selenium/interactions/BasicKeyboardInterfaceTest.java
-index f79ae7d559..3a3602df07 100644
+index f79ae7d559..db33271998 100644
 --- a/java/client/test/org/openqa/selenium/interactions/BasicKeyboardInterfaceTest.java
 +++ b/java/client/test/org/openqa/selenium/interactions/BasicKeyboardInterfaceTest.java
-@@ -257,6 +257,8 @@ public void testSelectionSelectByWord() {
+@@ -231,6 +231,8 @@ public void testSelectionSelectBySymbol() {
+ 
+     shortWait.until(ExpectedConditions.attributeToBe(input, "value", "abc def"));
+ 
++    ((Interactive)driver).resetInputState();
++
+     getBuilder(driver).click(input)
+         .keyDown(Keys.SHIFT)
+         .sendKeys(Keys.LEFT)
+@@ -257,6 +259,8 @@ public void testSelectionSelectByWord() {
      getBuilder(driver).click(input).sendKeys("abc def").perform();
      wait.until(ExpectedConditions.attributeToBe(input, "value", "abc def"));
  
@@ -205,7 +214,7 @@
          .keyDown(Keys.SHIFT)
          .keyDown(Keys.CONTROL)
 diff --git a/java/client/test/org/openqa/selenium/interactions/BasicMouseInterfaceTest.java b/java/client/test/org/openqa/selenium/interactions/BasicMouseInterfaceTest.java
-index e52e8f46cb..2ec8da142d 100644
+index e52e8f46cb..4dfe05711b 100644
 --- a/java/client/test/org/openqa/selenium/interactions/BasicMouseInterfaceTest.java
 +++ b/java/client/test/org/openqa/selenium/interactions/BasicMouseInterfaceTest.java
 @@ -373,7 +373,7 @@ public void testMovingMouseToRelativeElementOffset() {
@@ -246,15 +255,26 @@
        .moveByOffset(shiftX, shiftY)
        .moveByOffset(-shiftX, -shiftY).perform();
  
-@@ -457,7 +458,7 @@ public void testCanMoveOverAndOutOfAnElement() {
+@@ -456,8 +457,9 @@ public void testCanMoveOverAndOutOfAnElement() {
+     WebElement greenbox = driver.findElement(By.id("greenbox"));
      WebElement redbox = driver.findElement(By.id("redbox"));
      Dimension size = redbox.getSize();
++    Dimension greenBoxSize = greenbox.getSize();
  
 -    new Actions(driver).moveToElement(greenbox, 1, 1).perform();
-+    new Actions(driver).moveToElement(greenbox, 1 - size.getWidth()/2, 1 - size.getHeight()/2).perform();
++    new Actions(driver).moveToElement(greenbox, 1- greenBoxSize.getWidth()/2, 1- greenBoxSize.getHeight()/2).perform();
  
      assertThat(Color.fromString(redbox.getCssValue("background-color")))
          .isEqualTo(GREEN.getColorValue());
+@@ -468,7 +470,7 @@ public void testCanMoveOverAndOutOfAnElement() {
+ 
+     // IE8 (and *only* IE8) requires a move of 2 pixels. All other browsers
+     // would be happy with 1.
+-    new Actions(driver).moveToElement(redbox, size.getWidth() + 2, size.getHeight() + 2)
++    new Actions(driver).moveToElement(redbox, size.getWidth()/2 + 2, size.getHeight()/2 + 2)
+         .perform();
+ 
+     wait.until(attributeToBe(redbox, "background-color", Colors.GREEN.getColorValue().asRgba()));
 diff --git a/java/client/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java b/java/client/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java
 index db1bdb6a73..ec2e2a0bb4 100644
 --- a/java/client/test/org/openqa/selenium/interactions/CombinedInputActionsTest.java