# HG changeset patch # User timkelly # Date 1286991028 18000 # Node ID 816abb894472dd54d47b23dd74f34edd13a1b217 # Parent fab48956482fa66bd094671298559070238af6ef Run create global prefs tests asynch on UI thread diff -r fab48956482f -r 816abb894472 builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestCreateGlobalPrefs.java --- a/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestCreateGlobalPrefs.java Wed Oct 13 11:00:18 2010 -0500 +++ b/builder/com.nokia.carbide.cdt.builder.test/src/com/nokia/carbide/cdt/builder/test/TestCreateGlobalPrefs.java Wed Oct 13 12:30:28 2010 -0500 @@ -17,6 +17,7 @@ */ package com.nokia.carbide.cdt.builder.test; +import org.eclipse.swt.widgets.Display; import org.eclipse.ui.dialogs.PreferencesUtil; import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; @@ -27,6 +28,9 @@ */ public class TestCreateGlobalPrefs extends BaseTest { + // Deprecated - are filtered + //com.nokia.cdt.debug.cw.symbian.ui.GlobalSettings + //com.nokia.carbide.cpp.logging.LoggingPreferencesPage private static final String[] carbidePrefIds = { "com.nokia.carbide.cpp.sdk.ui.preferences.BuildPlatformFilterPage", "com.nokia.carbide.cpp.internal.sdk.ui.SDKPreferencePage", "com.nokia.carbide.cpp.internal.sdk.ui.SDKPreferencePage", @@ -57,12 +61,23 @@ */ public void testCreatePrefs() throws Exception { - for (String id : carbidePrefIds){ - PreferencesUtil.createPreferenceDialogOn(WorkbenchUtils.getSafeShell(), id, null, null, 0); - } +// make sure to run on UI thread +// Display getAsynch() +// capture and throw exception +// wait to finish before existing + + // TODO: Need to throw exception on error when loading a pref page - // Deprecated - to be filtered - //com.nokia.cdt.debug.cw.symbian.ui.GlobalSettings - //com.nokia.carbide.cpp.logging.LoggingPreferencesPage + Display.getDefault().asyncExec(new Runnable() { + + @Override + public void run() { + for (String id : carbidePrefIds){ + PreferencesUtil.createPreferenceDialogOn(WorkbenchUtils.getSafeShell(), id, null, null, 0); + } + } + + }); + } }