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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html

Issue 1775613004: Fix mouse-event-buttons-attribute flakiness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html b/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html
index cc8ad65bc1bfbe51e752dad9836bc6862603a9ca..d57e7434b55147333581d7a22400c241657b9284 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute.html
@@ -14,9 +14,7 @@
top: 100px;
}
</style>
-
-<div id="target"></div>
-<img id="drag" src="resources/greenbox30.png" draggable>
+<body>
Rick Byers 2016/03/09 20:16:16 nit: style says to omit body when it's not necessa
Navid Zolghadr 2016/03/09 20:21:07 Sure.
<script src="../../resources/js-test.js"></script>
<script>
@@ -24,8 +22,6 @@ const L = 'leftButton';
const R = 'rightButton';
const M = 'middleButton';
-var targetDiv = document.getElementById('target');
-var dragImg = document.getElementById('drag');
var seqNo = 0;
var testSet = [
{ initialButtons: [], action: doubleClickAction },
@@ -125,6 +121,8 @@ function printTestInfo(testItem)
}
function init() {
+ var targetDiv = document.getElementById('target');
+ var dragImg = document.getElementById('drag');
var eventList = ['dblclick', 'click', 'mousedown', 'mouseup', 'mousemove', 'mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'mousewheel', 'dragstart', 'dragend', 'dragenter', 'dragleave', 'dragover', 'drag', 'contextmenu'];
eventList.forEach(function(eventName) {
targetDiv.addEventListener(eventName, function(event) {
@@ -137,27 +135,36 @@ function init() {
}
function runTests() {
- for (var i = 0; i < testSet.length; i++) {
- printTestInfo(testSet[i]);
+ init();
+ if(window.eventSender) {
+ for (var i = 0; i < testSet.length; i++) {
+ printTestInfo(testSet[i]);
- // Reset the state for the new test
- seqNo = 0;
- eventSender.setMouseButtonState(-1, testSet[i].initialButtons);
- internals.settings.setShowContextMenuOnMouseUp(testSet[i].showContextMenuOnMouseUp);
+ // Reset the state for the new test
+ seqNo = 0;
+ eventSender.setMouseButtonState(-1, testSet[i].initialButtons);
+ internals.settings.setShowContextMenuOnMouseUp(testSet[i].showContextMenuOnMouseUp);
- testSet[i].action();
+ testSet[i].action();
- // Reset the mouse position
- eventSender.mouseMoveTo(-1, -1);
+ // Reset the mouse position
+ eventSender.mouseMoveTo(-1, -1);
- debug('');
+ debug('');
+ }
+ finishJSTest();
}
}
-init();
-if (window.eventSender)
- runTests();
-else
+if (window.eventSender) {
+ testRunner.waitUntilDone();
+ window.jsTestIsAsync = true;
Rick Byers 2016/03/09 20:16:16 does this actually need to be an async test? IIRC
Navid Zolghadr 2016/03/09 20:21:07 The problem was that I would get one "PASS success
mustaq 2016/03/09 21:38:01 I thought too-early TEST COMPLETE message is a sig
Navid Zolghadr 2016/03/10 13:57:50 I'm a bit confused of what you asked me to do. I t
mustaq 2016/03/10 14:51:12 Yes, I meant patch#2 or even #3 worth a try, to co
+} else {
debug("This test requires eventSender");
+}
</script>
+
+<div id="target"></div>
+<img id="drag" src="resources/greenbox30.png" onload="runTests()" draggable>
+</body>
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698