Commit 2a65624a authored by lazyboy's avatar lazyboy Committed by Commit bot

Fix WebViewTest.TestContextMenu on official builders.

We stopped showing "Inspect Element" on dev/beta/stable, therefore
TestContextMenu does not seem to find any menu item when right-click
is performed.
This CL makes sure we always have an <input> on the right-click target
so that we have some items to show in the context menu.

BUG=470300
Test=None, internal test only change.

Review URL: https://codereview.chromium.org/1016033010

Cr-Commit-Position: refs/heads/master@{#322326}
parent e2f6955f
...@@ -25,4 +25,22 @@ var onPostMessageReceived = function(e) { ...@@ -25,4 +25,22 @@ var onPostMessageReceived = function(e) {
return; return;
} }
}; };
var setup = function() {
// Make sure there is always stuff to show in context menu by
// inserting an <input> element.
// Note that we don't always show "Inspect element", so this is
// necessary.
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.top = 0;
div.style.left = 0;
var input = document.createElement('input');
div.appendChild(input);
document.body.style.padding = 0;
document.body.style.margin = 0;
document.body.appendChild(div);
};
setup();
window.addEventListener('message', onPostMessageReceived, false); window.addEventListener('message', onPostMessageReceived, false);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment