Bug 950565 - Fix for intermittent browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js | Test timed out; r=me

This commit is contained in:
Mihai Sucan 2014-01-16 23:33:02 +02:00
parent 7c9bd47907
commit 9b22c41e51

View File

@ -107,24 +107,15 @@ function onStyleEditorReady(aPanel)
function checkStyleEditorForSheetAndLine(aHref, aLine, aCallback)
{
let foundEditor = null;
waitForSuccess({
name: "style editor for stylesheet",
validatorFn: function()
{
for (let editor of StyleEditorUI.editors) {
if (editor.styleSheet.href == aHref) {
foundEditor = editor;
return true;
}
}
return false;
},
successFn: function()
{
performLineCheck(foundEditor, aLine, aCallback);
},
failureFn: finishTest,
});
for (let editor of StyleEditorUI.editors) {
if (editor.styleSheet.href == aHref) {
foundEditor = editor;
break;
}
}
ok(foundEditor, "found style editor for " + aHref);
performLineCheck(foundEditor, aLine, aCallback);
}
function performLineCheck(aEditor, aLine, aCallback)
@ -139,17 +130,13 @@ function performLineCheck(aEditor, aLine, aCallback)
aCallback && executeSoon(aCallback);
}
waitForSuccess({
name: "source editor load",
validatorFn: function()
{
return aEditor.sourceEditor;
},
successFn: checkForCorrectState,
failureFn: function() {
info("selectedStyleSheetIndex " + StyleEditorUI.selectedStyleSheetIndex
+ " expected " + aEditor.styleSheet.styleSheetIndex);
finishTest();
},
info("wait for source editor to load");
// Get out of the styleeditor-selected event loop.
executeSoon(() => {
aEditor.getSourceEditor().then(() => {
// Get out of the editor's source-editor-load event loop.
executeSoon(checkForCorrectState);
});
});
}