From f6c71b74cbc4f2540af07ef594419c2e89fd04f9 Mon Sep 17 00:00:00 2001 From: Oleg Besedin Date: Thu, 28 Jul 2011 16:32:10 -0400 Subject: Bug 353366 - Tests failures for empty label width (testSaveAs, testExportResources, etc.) --- .../src/org/eclipse/ui/tests/harness/util/DialogCheck.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java b/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java index f7f0c375715..3ce5d7c164e 100644 --- a/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java +++ b/tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/DialogCheck.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -172,7 +172,9 @@ public class DialogCheck { private static void verifyLabelText(Label label, Assert assertion) { String widget = label.toString(); Point size = label.getSize(); - + String labelText = label.getText(); + if (labelText.isEmpty()) + return; //compute the size with no line wrapping Point preferred = label.computeSize(SWT.DEFAULT, SWT.DEFAULT); //if (size.y/preferred.y) == X, then label spans X lines, so divide -- cgit v1.2.3