зеркало из https://github.com/mozilla/pjs.git
Bug 522416 - Tab Previews must not do synchronous HTTP requests.
Fixes a startup crash and unit tests. r=vlad --HG-- extra : rebase_source : 003b29893d97b13820648cd5a1a3277e5d8b3946
This commit is contained in:
Родитель
f0859a8125
Коммит
30800af665
|
@ -11,13 +11,15 @@ function test() {
|
|||
if (!isWin7OrHigher)
|
||||
return;
|
||||
|
||||
const ENABLE_PREF_NAME = "browser.taskbar.previews.enable";
|
||||
|
||||
let temp = {};
|
||||
Cu.import("resource://gre/modules/WindowsPreviewPerTab.jsm", temp);
|
||||
let AeroPeek = temp.AeroPeek;
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
gPrefService.setBoolPref("aeropeek.enable", true);
|
||||
gPrefService.setBoolPref(ENABLE_PREF_NAME, true);
|
||||
|
||||
is(1, AeroPeek.windows.length, "Got the expected number of windows");
|
||||
|
||||
|
@ -32,13 +34,13 @@ function test() {
|
|||
for each (let preview in AeroPeek.previews)
|
||||
ok(preview.visible, "Preview is shown as expected");
|
||||
|
||||
gPrefService.setBoolPref("aeropeek.enable", false);
|
||||
gPrefService.setBoolPref(ENABLE_PREF_NAME, false);
|
||||
checkPreviews(4, "Previews are unchanged when disabling");
|
||||
|
||||
for each (let preview in AeroPeek.previews)
|
||||
ok(!preview.visible, "Preview is not shown as expected after disabling");
|
||||
|
||||
gPrefService.setBoolPref("aeropeek.enable", true);
|
||||
gPrefService.setBoolPref(ENABLE_PREF_NAME, true);
|
||||
checkPreviews(4, "Previews are unchanged when re-enabling");
|
||||
for each (let preview in AeroPeek.previews)
|
||||
ok(preview.visible, "Preview is shown as expected after re-enabling");
|
||||
|
@ -92,7 +94,7 @@ function test() {
|
|||
getPreviewForTab(gBrowser.mTabs[1]).controller.onClose();
|
||||
checkPreviews(1);
|
||||
|
||||
gPrefService.clearUserPref("aeropeek.enable");
|
||||
gPrefService.clearUserPref(ENABLE_PREF_NAME);
|
||||
|
||||
finish();
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ TaskbarTabPreview::SetIcon(imgIContainer *icon) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
TaskbarTabPreview::GetIcon(imgIContainer **icon) {
|
||||
NS_ADDREF(*icon = mIconImage);
|
||||
NS_IF_ADDREF(*icon = mIconImage);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
let tabP = taskbar.createTaskbarTabPreview(docShell, controller);
|
||||
isnot(tabP, null, "Tab preview is not null");
|
||||
is(tabP.controller.wrappedJSObject, controller, "Controllers match");
|
||||
is(tabP.icon, null, "Default icon is null (windows default)");
|
||||
tabP.icon = null;
|
||||
tabP.move(null);
|
||||
try {
|
||||
|
|
Загрузка…
Ссылка в новой задаче