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:
Victor Porof 2012-03-28 10:54:21 +03:00
Родитель acd1622b13
Коммит b9fbed5629
8 изменённых файлов: 25 добавлений и 10 удалений

Просмотреть файл

@ -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);
}