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

Side by Side Diff: LayoutTests/fast/files/resources/setup-for-read-common.js

Issue 15508003: Revert "Don't force layout for mouse event hit tests" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 function log(message) 1 function log(message)
2 { 2 {
3 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n")); 3 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n"));
4 if (message == "DONE") { 4 if (message == "DONE") {
5 if (window && window.testRunner) 5 if (window && window.testRunner)
6 testRunner.notifyDone(); 6 testRunner.notifyDone();
7 } 7 }
8 } 8 }
9 9
10 function onInputFileChange(testFileInfoList) 10 function onInputFileChange(testFileInfoList)
11 { 11 {
12 var files = document.getElementById("file").files; 12 var files = document.getElementById("file").files;
13 var testFiles = { }; 13 var testFiles = { };
14 for (var i = 0; i < files.length; i++) 14 for (var i = 0; i < files.length; i++)
15 testFiles[testFileInfoList[i]['name']] = files[i]; 15 testFiles[testFileInfoList[i]['name']] = files[i];
16 16
17 startTest(testFiles); 17 startTest(testFiles);
18 } 18 }
19 19
20 function runTests(testFileInfoList) 20 function runTests(testFileInfoList)
21 { 21 {
22 var pathsOnly = testFileInfoList.map(function(fileSpec) { return fileSpec['p ath']; }); 22 var pathsOnly = testFileInfoList.map(function(fileSpec) { return fileSpec['p ath']; });
23 // Mouse events only work after an initial layout
24 document.body.offsetLeft;
25 eventSender.beginDragWithFiles(pathsOnly); 23 eventSender.beginDragWithFiles(pathsOnly);
26 eventSender.mouseMoveTo(10, 10); 24 eventSender.mouseMoveTo(10, 10);
27 eventSender.mouseUp(); 25 eventSender.mouseUp();
28 } 26 }
29 27
30 function startWorker(testFiles, workerScriptURL) 28 function startWorker(testFiles, workerScriptURL)
31 { 29 {
32 var worker = new Worker(workerScriptURL); 30 var worker = new Worker(workerScriptURL);
33 worker.onmessage = function(event) 31 worker.onmessage = function(event)
34 { 32 {
35 log(event.data); 33 log(event.data);
36 if (event.data == "DONE") { 34 if (event.data == "DONE") {
37 if (window.testRunner) 35 if (window.testRunner)
38 testRunner.notifyDone(); 36 testRunner.notifyDone();
39 } 37 }
40 } 38 }
41 worker.onerror = function(event) 39 worker.onerror = function(event)
42 { 40 {
43 log("Received error from worker: " + event.message); 41 log("Received error from worker: " + event.message);
44 if (window.testRunner) 42 if (window.testRunner)
45 testRunner.notifyDone(); 43 testRunner.notifyDone();
46 } 44 }
47 worker.postMessage(testFiles); 45 worker.postMessage(testFiles);
48 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698