зеркало из https://github.com/mozilla/gecko-dev.git
Bug 737457 - Intermittent browser/devtools/tilt/test/browser_tilt_picking_highlight02.js | Test timed out | Found a tab after previous test timed out; r=rcampbell
This commit is contained in:
Родитель
acd1622b13
Коммит
b9fbed5629
|
@ -22,8 +22,9 @@ function test() {
|
|||
let canvas = presenter.canvas;
|
||||
|
||||
presenter._onSetupMesh = function() {
|
||||
let p = getPickablePoint(presenter);
|
||||
|
||||
presenter.pickNode(canvas.width / 2, 10, {
|
||||
presenter.pickNode(p[0], p[1], {
|
||||
onpick: function(data)
|
||||
{
|
||||
ok(data.index > 0,
|
||||
|
|
|
@ -24,7 +24,9 @@ function test() {
|
|||
Services.obs.addObserver(whenNodeRemoved, NODE_REMOVED, false);
|
||||
|
||||
presenter._onSetupMesh = function() {
|
||||
presenter.highlightNodeAt(presenter.canvas.width / 2, 10, {
|
||||
let p = getPickablePoint(presenter);
|
||||
|
||||
presenter.highlightNodeAt(p[0], p[1], {
|
||||
onpick: function()
|
||||
{
|
||||
ok(presenter._currentSelection > 0,
|
||||
|
|
|
@ -14,7 +14,6 @@ function test() {
|
|||
return;
|
||||
}
|
||||
|
||||
requestLongerTimeout(10);
|
||||
waitForExplicitFinish();
|
||||
|
||||
createTab(function() {
|
||||
|
|
|
@ -23,7 +23,7 @@ function test() {
|
|||
presenter = instance.presenter;
|
||||
Services.obs.addObserver(whenHighlighting, HIGHLIGHTING, false);
|
||||
|
||||
presenter._onSetupMesh = function() {
|
||||
presenter._onInitializationFinished = function() {
|
||||
let contentDocument = presenter.contentWindow.document;
|
||||
let div = contentDocument.getElementById("first-law");
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ function test() {
|
|||
presenter = instance.presenter;
|
||||
Services.obs.addObserver(whenHighlighting, HIGHLIGHTING, false);
|
||||
|
||||
presenter._onSetupMesh = function() {
|
||||
presenter.highlightNodeAt(presenter.canvas.width / 2, 10);
|
||||
presenter._onInitializationFinished = function() {
|
||||
presenter.highlightNodeAt.apply(this, getPickablePoint(presenter));
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ function whenHighlighting() {
|
|||
executeSoon(function() {
|
||||
Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING);
|
||||
Services.obs.addObserver(whenUnhighlighting, UNHIGHLIGHTING, false);
|
||||
presenter.highlightNodeAt(-1, -1);
|
||||
presenter.highlightNode(null);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ function test() {
|
|||
presenter = instance.presenter;
|
||||
Services.obs.addObserver(whenHighlighting, HIGHLIGHTING, false);
|
||||
|
||||
presenter._onSetupMesh = function() {
|
||||
presenter.highlightNodeFor(5); // 1 = html, 2 = body, 3 = first div
|
||||
presenter._onInitializationFinished = function() {
|
||||
presenter.highlightNodeFor(3); // 1 = html, 2 = body, 3 = first div
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
@ -14,7 +14,6 @@ function test() {
|
|||
return;
|
||||
}
|
||||
|
||||
requestLongerTimeout(10);
|
||||
waitForExplicitFinish();
|
||||
|
||||
createTab(function() {
|
||||
|
|
|
@ -24,6 +24,7 @@ const DEFAULT_HTML = "data:text/html," +
|
|||
"<DOCTYPE html>" +
|
||||
"<html>" +
|
||||
"<head>" +
|
||||
"<meta charset='utf-8'/>" +
|
||||
"<title>Three Laws</title>" +
|
||||
"</head>" +
|
||||
"<body>" +
|
||||
|
@ -194,3 +195,16 @@ function createTilt(callbacks, close) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getPickablePoint(presenter) {
|
||||
let vertices = presenter._meshStacks[0].vertices.components;
|
||||
|
||||
let topLeft = vec3.create([vertices[0], vertices[1], vertices[2]]);
|
||||
let bottomRight = vec3.create([vertices[6], vertices[7], vertices[8]]);
|
||||
let center = vec3.lerp(topLeft, bottomRight, 0.5, []);
|
||||
|
||||
let renderer = presenter._renderer;
|
||||
let viewport = [0, 0, renderer.width, renderer.height];
|
||||
|
||||
return vec3.project(center, viewport, renderer.mvMatrix, renderer.projMatrix);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче