Merge mozilla-central to autoland. r=merge a=merge on a CLOSED TREE

This commit is contained in:
Cosmin Sabou 2017-11-25 23:22:14 +02:00
commit 86ba8150af
32 changed files with 445 additions and 236 deletions

View File

@ -153,9 +153,7 @@ function delayedStartupFinished(aWindow) {
* @resolves With the tab once it's loaded.
*/
function someTabLoaded(aWindow) {
return BrowserTestUtils.waitForNewTab(gTestWindow.gBrowser).then((tab) => {
return BrowserTestUtils.browserStopped(tab.linkedBrowser).then(() => tab);
});
return BrowserTestUtils.waitForNewTab(gTestWindow.gBrowser, null, true);
}
/**

View File

@ -131,20 +131,27 @@ add_task(async function test_mixedcontent() {
* Checks that insecure window.opener does not trigger a warning.
*/
add_task(async function test_ignoring_window_opener() {
let newTabURL = "https://example.com" + TEST_URL_PATH + "form_basic.html";
let path = getRootDirectory(gTestPath)
.replace("chrome://mochitests/content", "http://example.com");
let url = path + "insecure_opener.html";
await BrowserTestUtils.withNewTab(url, async function(browser) {
// Clicking the link will spawn a new tab.
let loaded = BrowserTestUtils.waitForNewTab(gBrowser, newTabURL);
let stateChangePromise;
let tabOpenPromise = new Promise(resolve => {
gBrowser.tabContainer.addEventListener("TabOpen", event => {
let tab = event.target;
let newTabBrowser = tab.linkedBrowser;
stateChangePromise = waitForInsecureLoginFormsStateChange(newTabBrowser, 2);
resolve(tab);
}, { once: true });
});
await ContentTask.spawn(browser, {}, function() {
content.document.getElementById("link").click();
});
let tab = await loaded;
browser = tab.linkedBrowser;
await waitForInsecureLoginFormsStateChange(browser, 2);
let tab = await tabOpenPromise;
await stateChangePromise;
// Open the identity popup.
let { gIdentityHandler } = gBrowser.ownerGlobal;

View File

@ -22,7 +22,7 @@ add_task(async function() {
});
// Open new file:// tab from JavaScript in first file:// page.
let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, openedUriString);
let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, openedUriString, true);
await ContentTask.spawn(tab.linkedBrowser, openedUriString, uri => {
content.open(uri, "_blank");
});
@ -33,7 +33,6 @@ add_task(async function() {
});
let openedBrowser = openedTab.linkedBrowser;
await BrowserTestUtils.browserLoaded(openedBrowser);
// Ensure that new file:// tab can be navigated to web content.
openedBrowser.loadURI("http://example.org/");

View File

@ -102,11 +102,18 @@ add_task(async function() {
Assert.equal(messageEl.textContent, "test", "Message is correct");
// Check that when clicking the learn more link, a tab opens with the right URL
const tabOpenPromise = BrowserTestUtils.waitForNewTab(targetWindow.gBrowser);
let loadedPromise;
const tabOpenPromise = new Promise(resolve => {
gBrowser.tabContainer.addEventListener("TabOpen", event => {
let tab = event.target;
loadedPromise = BrowserTestUtils.browserLoaded(
tab.linkedBrowser, true, url => url && url !== "about:blank");
resolve(tab);
}, { once: true });
});
learnMoreEl.click();
const tab = await tabOpenPromise;
const tabUrl = await BrowserTestUtils.browserLoaded(
tab.linkedBrowser, true, url => url && url !== "about:blank");
const tabUrl = await loadedPromise;
Assert.equal(tabUrl, "https://example.org/learnmore", "Learn more link opened the right url");
@ -138,11 +145,18 @@ add_task(async function() {
Assert.equal(engagementButton.label, "Click me!", "Engagement button has correct label");
const engagementEl = hb.notice.querySelector(".notification-button");
const tabOpenPromise = BrowserTestUtils.waitForNewTab(targetWindow.gBrowser);
let loadedPromise;
const tabOpenPromise = new Promise(resolve => {
gBrowser.tabContainer.addEventListener("TabOpen", event => {
let tab = event.target;
loadedPromise = BrowserTestUtils.browserLoaded(
tab.linkedBrowser, true, url => url && url !== "about:blank");
resolve(tab);
}, { once: true });
});
engagementEl.click();
const tab = await tabOpenPromise;
const tabUrl = await BrowserTestUtils.browserLoaded(
tab.linkedBrowser, true, url => url && url !== "about:blank");
const tabUrl = await loadedPromise;
// the postAnswer url gets query parameters appended onto the end, so use Assert.startsWith instead of Assert.equal
Assert.ok(tabUrl.startsWith("https://example.org/postAnswer"), "Engagement button opened the right url");

View File

@ -11,12 +11,19 @@ add_task(async function test_screenshot() {
let webcompatButton = document.getElementById(WC_PAGE_ACTION_ID);
ok(webcompatButton, "Report Site Issue button exists.");
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
let screenshotPromise;
let newTabPromise = new Promise(resolve => {
gBrowser.tabContainer.addEventListener("TabOpen", event => {
let tab = event.target;
screenshotPromise = BrowserTestUtils.waitForContentEvent(
tab.linkedBrowser, "ScreenshotReceived", false, null, true);
resolve(tab);
}, { once: true });
});
openPageActions();
webcompatButton.click();
let tab2 = await newTabPromise;
await BrowserTestUtils.waitForContentEvent(tab2.linkedBrowser, "ScreenshotReceived", false, null, true);
await screenshotPromise;
await ContentTask.spawn(tab2.linkedBrowser, {TEST_PAGE}, function(args) {
let doc = content.document;

View File

@ -8,6 +8,8 @@
// For sorting values with limited range; uint8 and int8.
function CountingSort(array, len, signed, comparefn) {
assert(IsPossiblyWrappedTypedArray(array), "CountingSort works only with typed arrays.");
// Determined by performance testing.
if (len < 128) {
QuickSort(array, len, comparefn);
@ -109,6 +111,8 @@ function SortByColumn(array, len, aux, col, counts) {
// Sorts integers and float32. |signed| is true for int16 and int32, |floating|
// is true for float32.
function RadixSort(array, len, buffer, nbytes, signed, floating, comparefn) {
assert(IsPossiblyWrappedTypedArray(array), "RadixSort works only with typed arrays.");
// Determined by performance testing.
if (len < 512) {
QuickSort(array, len, comparefn);
@ -131,13 +135,21 @@ function RadixSort(array, len, buffer, nbytes, signed, floating, comparefn) {
assert(buffer !== null, "Attached data buffer should be reified");
}
view = new Int32Array(buffer);
// |array| is a possibly cross-compartment wrapped typed array.
let offset = IsTypedArray(array)
? TypedArrayByteOffset(array)
: callFunction(CallTypedArrayMethodIfWrapped, array, array,
"TypedArrayByteOffset");
view = new Int32Array(buffer, offset, len);
// Flip sign bit for positive numbers; flip all bits for negative
// numbers
// numbers, except negative NaNs.
for (let i = 0; i < len; i++) {
if (view[i] & signMask) {
view[i] ^= 0xFFFFFFFF;
if ((view[i] & 0x7F800000) !== 0x7F800000 || (view[i] & 0x007FFFFF) === 0) {
view[i] ^= 0xFFFFFFFF;
}
} else {
view[i] ^= signMask;
}

View File

@ -68,6 +68,10 @@ RootsRemovedGCSliceCallback(JSContext* cx, JS::GCProgress progress, const JS::GC
BEGIN_TEST(testGCRootsRemoved)
{
#ifdef JS_GC_ZEAL
AutoLeaveZeal nozeal(cx);
#endif /* JS_GC_ZEAL */
JS_SetGCParameter(cx, JSGC_MODE, JSGC_MODE_INCREMENTAL);
gSliceCallbackCount = 0;

View File

@ -0,0 +1,106 @@
// Test with all floating point typed arrays.
const floatConstructors = anyTypedArrayConstructors.filter(isFloatConstructor);
// Also test with cross-compartment wrapped typed arrays.
if (typeof newGlobal === "function") {
const otherGlobal = newGlobal();
floatConstructors.push(otherGlobal.Float32Array);
floatConstructors.push(otherGlobal.Float64Array);
}
function* prod(xs, ys) {
for (let x of xs) {
for (let y of ys) {
yield [x, y];
}
}
}
const isLittleEndian = new Uint8Array(new Uint16Array([1]).buffer)[0] !== 0;
function seti32(i32, i, v) {
i32[i] = v;
}
function seti64(i32, i, [hi, lo]) {
i32[i * 2 + isLittleEndian] = hi;
i32[i * 2 + !isLittleEndian] = lo;
}
const setInt = {
Float32: seti32,
Float64: seti64,
};
const NaNs = {
Float32: [
0x7F800001|0, // smallest SNaN
0x7FBFFFFF|0, // largest SNaN
0x7FC00000|0, // smallest QNaN
0x7FFFFFFF|0, // largest QNaN
0xFF800001|0, // smallest SNaN, sign-bit set
0xFFBFFFFF|0, // largest SNaN, sign-bit set
0xFFC00000|0, // smallest QNaN, sign-bit set
0xFFFFFFFF|0, // largest QNaN, sign-bit set
],
Float64: [
[0x7FF00000|0, 0x00000001|0], // smallest SNaN
[0x7FF7FFFF|0, 0xFFFFFFFF|0], // largest SNaN
[0x7FF80000|0, 0x00000000|0], // smallest QNaN
[0x7FFFFFFF|0, 0xFFFFFFFF|0], // largest QNaN
[0xFFF00000|0, 0x00000001|0], // smallest SNaN, sign-bit set
[0xFFF7FFFF|0, 0xFFFFFFFF|0], // largest SNaN, sign-bit set
[0xFFF80000|0, 0x00000000|0], // smallest QNaN, sign-bit set
[0xFFFFFFFF|0, 0xFFFFFFFF|0], // largest QNaN, sign-bit set
],
};
// %TypedArray%.prototype.sort
const TypedArraySort = Int32Array.prototype.sort;
// Test with small and large typed arrays.
const typedArrayLengths = [16, 4096];
for (const [TA, taLength] of prod(floatConstructors, typedArrayLengths)) {
let type = TA.name.slice(0, -"Array".length);
let nansLength = NaNs[type].length;
let fta = new TA(taLength);
let i32 = new Int32Array(fta.buffer);
// Add NaNs in various representations at the start of the typed array.
for (let i = 0; i < nansLength; ++i) {
setInt[type](i32, i, NaNs[type][i]);
}
// Also add two non-NaN values for testing.
fta[nansLength] = 123;
fta[nansLength + 1] = -456;
// Sort the array and validate sort() sorted all elements correctly.
TypedArraySort.call(fta);
// |-456| should be sorted to the start.
assertEq(fta[0], -456);
// Followed by a bunch of zeros,
const zeroOffset = 1;
const zeroCount = taLength - nansLength - 2;
for (let i = 0; i < zeroCount; ++i) {
assertEq(fta[zeroOffset + i], 0, `At offset: ${zeroOffset + i}`);
}
// and then |123|.
assertEq(fta[zeroOffset + zeroCount], 123);
// And finally the NaNs.
const nanOffset = zeroCount + 2;
for (let i = 0; i < nansLength; ++i) {
// We don't assert a specific NaN value is present, because this is
// not required by the spec and we don't provide any guarantees NaN
// values are either unchanged or canonicalized in sort().
assertEq(fta[nanOffset + i], NaN, `At offset: ${nanOffset + i}`);
}
}
if (typeof reportCompare === "function")
reportCompare(true, true);

View File

@ -0,0 +1,30 @@
// Ensure that when sorting TypedArrays we don't
// ignore byte offsets (bug 1290579).
var sortFunctions = [Int32Array.prototype.sort];
// Also test with cross-compartment wrapped typed arrays.
if (typeof newGlobal === "function") {
var otherGlobal = newGlobal();
sortFunctions.push(newGlobal().Int32Array.prototype.sort);
}
// The bug manifests itself only with Float arrays,
// but checking everything here just for sanity.
for (var ctor of anyTypedArrayConstructors) {
var ab = new ArrayBuffer(1025 * ctor.BYTES_PER_ELEMENT);
var ta = new ctor(ab, ctor.BYTES_PER_ELEMENT, 1024);
// |testArray[0]| shouldn't be modified when sort() is called below.
var testArray = new ctor(ab, 0, 1);
testArray[0] = 1;
for (var sortFn of sortFunctions) {
sortFn.call(ta);
assertEq(testArray[0], 1);
}
}
if (typeof reportCompare === "function")
reportCompare(true, true);

View File

@ -60,11 +60,11 @@ public final class IntentHelper implements BundleEventListener {
};
// via http://developer.android.com/distribute/tools/promote/linking.html
private static String MARKET_INTENT_URI_PACKAGE_PREFIX = "market://details?id=";
private static String EXTRA_BROWSER_FALLBACK_URL = "browser_fallback_url";
private static final String MARKET_INTENT_URI_PACKAGE_PREFIX = "market://details?id=";
private static final String EXTRA_BROWSER_FALLBACK_URL = "browser_fallback_url";
/** A partial URI to an error page - the encoded error URI should be appended before loading. */
private static String UNKNOWN_PROTOCOL_URI_PREFIX = "about:neterror?e=unknownProtocolFound&u=";
private static final String UNKNOWN_PROTOCOL_URI_PREFIX = "about:neterror?e=unknownProtocolFound&u=";
private static IntentHelper instance;

View File

@ -51,7 +51,7 @@ import java.util.concurrent.TimeUnit;
*/
public class PocketStoriesLoader extends AsyncTaskLoader<List<TopStory>> {
public static String LOGTAG = "PocketStoriesLoader";
public static final String LOGTAG = "PocketStoriesLoader";
public static final String POCKET_REFERRER_URI = "https://getpocket.com/recommendations";

View File

@ -106,8 +106,8 @@ public class DBUtils {
}
}
private static String HISTOGRAM_DATABASE_LOCKED = "DATABASE_LOCKED_EXCEPTION";
private static String HISTOGRAM_DATABASE_UNLOCKED = "DATABASE_SUCCESSFUL_UNLOCK";
private static final String HISTOGRAM_DATABASE_LOCKED = "DATABASE_LOCKED_EXCEPTION";
private static final String HISTOGRAM_DATABASE_UNLOCKED = "DATABASE_SUCCESSFUL_UNLOCK";
public static void ensureDatabaseIsNotLocked(SQLiteOpenHelper dbHelper, String databasePath) {
final int maxAttempts = 5;
int attempt = 0;

View File

@ -25,7 +25,7 @@ import static org.mozilla.gecko.home.CombinedHistoryPanel.OnPanelLevelChangeList
public class CombinedHistoryRecyclerView extends RecyclerView
implements RecyclerViewClickSupport.OnItemClickListener, RecyclerViewClickSupport.OnItemLongClickListener {
public static String LOGTAG = "CombinedHistoryRecycView";
public static final String LOGTAG = "CombinedHistoryRecycView";
protected interface AdapterContextMenuBuilder {
HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position);

View File

@ -65,7 +65,7 @@ public class MmaDelegate {
public static final String KEY_ANDROID_PREF_STRING_LEANPLUM_DEVICE_ID = "android.not_a_preference.leanplum.device_id";
private static final String DEBUG_LEANPLUM_DEVICE_ID = "8effda84-99df-11e7-abc4-cec278b6b50a";
private static MmaInterface mmaHelper = MmaConstants.getMma();
private static final MmaInterface mmaHelper = MmaConstants.getMma();
private static WeakReference<Context> applicationContext;
public static void init(Activity activity) {

View File

@ -14,7 +14,7 @@ import java.util.List;
* RestrictionConfiguration implementation for guest profiles.
*/
public class GuestProfileConfiguration implements RestrictionConfiguration {
static List<Restrictable> DISABLED_FEATURES = Arrays.asList(
static final List<Restrictable> DISABLED_FEATURES = Arrays.asList(
Restrictable.DOWNLOAD,
Restrictable.INSTALL_EXTENSION,
Restrictable.INSTALL_APPS,

View File

@ -25,7 +25,7 @@ import java.util.Map;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public class RestrictedProfileConfiguration implements RestrictionConfiguration {
// Mapping from restrictable feature to default state (on/off)
private static Map<Restrictable, Boolean> configuration = new LinkedHashMap<>();
private static final Map<Restrictable, Boolean> configuration = new LinkedHashMap<>();
static {
configuration.put(Restrictable.INSTALL_EXTENSION, false);
configuration.put(Restrictable.PRIVATE_BROWSING, false);
@ -44,7 +44,7 @@ public class RestrictedProfileConfiguration implements RestrictionConfiguration
/**
* These restrictions are hidden from the admin configuration UI.
*/
private static List<Restrictable> hiddenRestrictions = new ArrayList<>();
private static final List<Restrictable> hiddenRestrictions = new ArrayList<>();
static {
hiddenRestrictions.add(Restrictable.MASTER_PASSWORD);
hiddenRestrictions.add(Restrictable.GUEST_BROWSING);

View File

@ -8,8 +8,8 @@ import android.widget.RelativeLayout;
public class SplashScreen extends RelativeLayout {
private static long MIN_DISPLAY_TIME = 0;
private static long MAX_DISPLAY_TIME = 2000;
private static final long MIN_DISPLAY_TIME = 0;
private static final long MAX_DISPLAY_TIME = 2000;
private boolean hasReachedThreshold = false;
private boolean shouldHideAsap = false;

View File

@ -19,7 +19,7 @@ import org.mozilla.gecko.annotation.WrapForJNI;
public final class GeckoSurface extends Surface {
private static final String LOGTAG = "GeckoSurface";
private static HashMap<Integer, GeckoSurfaceTexture> sSurfaceTextures = new HashMap<Integer, GeckoSurfaceTexture>();
private static final HashMap<Integer, GeckoSurfaceTexture> sSurfaceTextures = new HashMap<Integer, GeckoSurfaceTexture>();
private int mHandle;
private boolean mIsSingleBuffer;

View File

@ -18,7 +18,7 @@ import org.mozilla.gecko.annotation.WrapForJNI;
public final class GeckoSurfaceTexture extends SurfaceTexture {
private static final String LOGTAG = "GeckoSurfaceTexture";
private static volatile int sNextHandle = 1;
private static HashMap<Integer, GeckoSurfaceTexture> sSurfaceTextures = new HashMap<Integer, GeckoSurfaceTexture>();
private static final HashMap<Integer, GeckoSurfaceTexture> sSurfaceTextures = new HashMap<Integer, GeckoSurfaceTexture>();
private static HashMap<Long, LinkedList<GeckoSurfaceTexture>> sUnusedTextures =

View File

@ -14,7 +14,7 @@ import android.util.Log;
public class SurfaceAllocatorService extends Service {
static private String LOGTAG = "SurfaceAllocatorService";
private static final String LOGTAG = "SurfaceAllocatorService";
public int onStartCommand(final Intent intent, final int flags, final int startId) {
return Service.START_STICKY;

View File

@ -50,7 +50,7 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
private static final int MAX_TIMELINE_ITEM_LINES = 3;
private static final boolean DEBUG = BuildConfig.NIGHTLY_BUILD || BuildConfig.DEBUG_BUILD;
private static AtomicInteger sPlayerId = new AtomicInteger(0);
private static final AtomicInteger sPlayerId = new AtomicInteger(0);
/*
* Because we treat GeckoHlsPlayer as a source data provider.
* It will be created and initialized with a URL by HLSResource in

View File

@ -28,7 +28,7 @@ final class RemoteMediaDrmBridgeStub extends IMediaDrmBridge.Stub implements IBi
// from MediaDrmProxy -> MediaDrmCDMProxy -> RemoteDataDecoder => IPC => Codec.
private String mStubId = "";
public static ArrayList<RemoteMediaDrmBridgeStub> mBridgeStubs =
public static final ArrayList<RemoteMediaDrmBridgeStub> mBridgeStubs =
new ArrayList<RemoteMediaDrmBridgeStub>();
private String getId() {

View File

@ -16,7 +16,7 @@ import java.lang.reflect.Method;
public class SharedMemory implements Parcelable {
private static final String LOGTAG = "GeckoShmem";
private static Method sGetFDMethod = null; // MemoryFile.getFileDescriptor() is hidden. :(
private static final Method sGetFDMethod;
private ParcelFileDescriptor mDescriptor;
private int mSize;
private int mId;
@ -24,12 +24,15 @@ public class SharedMemory implements Parcelable {
private boolean mIsMapped;
private MemoryFile mBackedFile;
// MemoryFile.getFileDescriptor() is hidden. :(
static {
Method method = null;
try {
sGetFDMethod = MemoryFile.class.getDeclaredMethod("getFileDescriptor");
method = MemoryFile.class.getDeclaredMethod("getFileDescriptor");
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
sGetFDMethod = method;
}
private SharedMemory(Parcel in) {

View File

@ -24,7 +24,7 @@ import android.util.Log;
public class GeckoServiceChildProcess extends Service {
static private String LOGTAG = "GeckoServiceChildProcess";
private static final String LOGTAG = "GeckoServiceChildProcess";
private static IProcessManager sProcessManager;

View File

@ -1159,4 +1159,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1520019278178000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1520105295314000);

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
/*****************************************************************************/
#include <stdint.h>
const PRTime gPreloadListExpirationTime = INT64_C(1522438465145000);
const PRTime gPreloadListExpirationTime = INT64_C(1522524482431000);
%%
0-1.party, 1
0.me.uk, 1
@ -265,7 +265,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1522438465145000);
33-km.ru, 1
330.net, 1
33445.com, 1
33836.com, 1
33scc.com, 1
3473-wiki.de, 1
360ds.co.in, 1
@ -439,7 +438,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1522438465145000);
8ackprotect.com, 1
8azino777.ru, 1
8ballbombom.uk, 1
8mpay.com, 1
8ox.ru, 0
8pecxstudios.com, 1
8svn.com, 1
@ -1123,7 +1121,6 @@ akr.io, 1
akritikos.info, 1
akropolis-ravensburg.de, 1
akselinurmio.fi, 1
akstudentsfirst.org, 1
aktiv-naturheilmittel.at, 1
aktiv-naturheilmittel.ch, 1
aktiv-naturheilmittel.de, 1
@ -1207,7 +1204,6 @@ alexismeza.com.mx, 1
alexismeza.dk, 1
alexismeza.es, 1
alexismeza.nl, 1
alexkidd.de, 1
alexkott.com, 1
alexmak.net, 1
alexmerkel.com, 1
@ -1506,7 +1502,6 @@ amyrussellhair.com, 1
amyyeung.com, 1
amzn.rocks, 1
anacreon.de, 1
anacruz.es, 1
anadoluefessk.org, 1
anaethelion.fr, 1
anaiscoachpersonal.es, 1
@ -4357,6 +4352,7 @@ buddhistische-weisheiten.org, 1
buddie5.com, 1
buddlycrafts.com, 1
buddyworks.net, 1
budeanu.com, 1
buderus-family.be, 1
budger.nl, 1
budgetalk.com, 1
@ -4460,7 +4456,6 @@ bushcraftfriends.com, 1
busindre.com, 1
business-garden.com, 1
business.facebook.com, 0
business.medbank.com.mt, 1
businessadviceperth.com.au, 1
businessamongus.com, 1
businesscentermarin.ch, 1
@ -5011,7 +5006,6 @@ cdnjs.com, 1
cdnk39.com, 1
cdns.cloud, 1
cdu-wilgersdorf.de, 1
ce-agentur.de, 1
ce-pimkie.fr, 1
cebz.org, 1
ceciliacolombara.com, 1
@ -5488,7 +5482,6 @@ chronology.no, 1
chronoproject.com, 1
chronoshop.cz, 1
chrpaul.de, 1
chrstn.eu, 1
chs.us, 1
chsh.moe, 1
chsterz.de, 1
@ -6622,7 +6615,6 @@ cspeti.hu, 1
cspvalidator.org, 1
csru.net, 1
css.net, 1
cssai.eu, 1
cssaunion.com, 1
cstb.ch, 1
cstp-marketing.com, 1
@ -7520,7 +7512,6 @@ dev-brandywineglobal.com, 1
dev-pulse-mtn.pantheonsite.io, 1
dev-talk.eu, 1
dev-talk.net, 1
dev-tek.de, 1
devafterdark.com, 1
devalps.eu, 1
devb.nl, 1
@ -7626,7 +7617,6 @@ diamondyze.nl, 1
diamorphine.com, 1
diamsmedia.ch, 1
dianefriedli.ch, 1
diannaobos.com, 1
dianurse.com, 1
diare-na-miru.cz, 1
diario-egipto.com, 1
@ -7652,6 +7642,7 @@ dicionarioetimologico.com.br, 1
dick.red, 1
dickieslife.com, 1
dickpics.ru, 1
dicoding.com, 1
didacte.com, 1
didche.net, 1
diddens.de, 1
@ -7895,7 +7886,6 @@ djangosnippets.org, 1
djbbouncycastles.co.uk, 1
djc.me, 1
djdavid98.hu, 1
djieno.com, 1
djipanov.com, 1
djlive.pl, 1
djlnetworks.co.uk, 1
@ -9383,7 +9373,7 @@ espanol.search.yahoo.com, 0
espanova.com, 1
espci.fr, 1
especificosba.com.ar, 1
espenandersen.no, 0
espenandersen.no, 1
espgg.org, 1
esphigmenou.gr, 1
espigol.org, 1
@ -10125,7 +10115,6 @@ ficlab.com, 1
ficus.io, 1
fid-elite.ch, 1
fid.to, 1
fidanza.eu, 1
fidel.uk, 1
fidelapp.com, 1
fidelis-it.ch, 1
@ -10841,6 +10830,7 @@ frolov.net, 1
frolova.org, 1
fromlemaytoz.com, 1
fromscratch.rocks, 1
fromthesoutherncross.com, 1
front-end.dog, 1
fronteers.nl, 0
frontline.cloud, 1
@ -11892,6 +11882,7 @@ grapholio.net, 1
grasmark.com, 1
grassenberg.de, 1
grasshoppervape.com, 1
gratis-lovecheck.de, 1
gratisonlinesex.com, 1
gratitudeabundancepassion.com, 1
graumeier.de, 1
@ -12621,7 +12612,6 @@ hematoonkologia.pl, 1
hemdal.se, 1
hemnet.se, 1
hen.ne.ke, 1
hendersonrealestatepros.com, 1
hendric.us, 1
hendrinortier.nl, 1
hendyisaac.com, 1
@ -13283,7 +13273,6 @@ hwinfo.com, 1
hwpkasse.de, 1
hx53.de, 1
hxying.com, 1
hyakumachi.com, 1
hybridiyhdistys.fi, 1
hybridklubben.fi, 1
hybridworx.com, 1
@ -13879,7 +13868,6 @@ innolabfribourg.ch, 1
innoloop.com, 1
innophate-security.com, 1
innoteil.com, 1
innovamag.ca, 1
innovaptor.at, 1
innovaptor.com, 1
innovation-workshop.ro, 1
@ -14039,6 +14027,7 @@ intraobes.com, 1
intrasoft.com.au, 1
intraxia.com, 1
introvertedtravel.space, 1
intune.life, 1
intux.be, 0
intvonline.com, 1
intxt.net, 1
@ -14328,7 +14317,6 @@ itooky.com, 1
itpro-mg.de, 1
itpro.ua, 1
itproject.guru, 1
itrack.in.th, 1
itraveille.fr, 1
itring.pl, 1
itruss.com.tw, 1
@ -17167,7 +17155,6 @@ logbot.info, 1
logcat.info, 1
logement-saisonnier.com, 1
logement.com, 1
logentries.com, 0
logfile.at, 1
logfile.ch, 1
logic8.ml, 1
@ -17521,7 +17508,6 @@ lysergion.com, 1
lyst.co.uk, 1
lyx.dk, 1
lz.sb, 1
lzahq.tech, 1
lzh.one, 1
m-22.com, 1
m-edmondson.co.uk, 1
@ -18252,7 +18238,6 @@ mdek.at, 1
mdewendt.de, 1
mdf-bis.com, 1
mdiv.pl, 1
mdkr.nl, 1
mdma.net, 1
mdmed.clinic, 1
mdoering.de, 1
@ -18568,7 +18553,6 @@ mf-fischer.de, 1
mfgod.com, 1
mfiles.pl, 1
mflodin.se, 1
mfrsgb45.org, 1
mft.global, 1
mfxbe.de, 1
mghiorzi.com.ar, 0
@ -19236,6 +19220,7 @@ moveek.com, 1
moveisfit.com.br, 1
moveltix.net, 1
movember.com, 0
movepin.com, 1
movie-cross.net, 1
movie4k.fyi, 1
movie4k.life, 1
@ -19863,6 +19848,7 @@ nasarawanewsonline.com, 1
nasbi.pl, 1
nasbnation.com, 1
nascher.org, 0
nasmocopati.com, 1
nasrsolar.com, 1
nassi.me, 1
nastoletni.pl, 1
@ -20421,7 +20407,6 @@ ninetaillabs.xyz, 1
ning.so, 1
ninja-galerie.de, 1
ninjan.co, 1
ninofink.com, 1
nintendoforum.no, 1
ninthfloor.org, 1
ninux.ch, 0
@ -20543,7 +20528,6 @@ noop.ch, 1
noordsee.de, 1
noorsolidarity.com, 1
nootropic.com, 1
nootropicsource.com, 1
nopaste.xyz, 1
nopaynocure.com, 1
norad.sytes.net, 1
@ -20552,6 +20536,7 @@ nordakademie.de, 1
nordic-survival.de, 1
nordiccasinocommunity.com, 1
nordinfo.fi, 1
nordmoregatebilklubb.com, 1
nordnetz-hamburg.de, 1
nordor.homeip.net, 1
nordseeblicke.de, 1
@ -20838,7 +20823,6 @@ ocolere.ch, 1
ocotg.com, 1
ocrn.nl, 1
ocsigroup.fr, 1
ocsr.nl, 1
octal.es, 1
octanio.com, 1
octav.name, 0
@ -21146,7 +21130,6 @@ open.gl, 1
openacademies.com, 1
openacte.ch, 1
openblox.org, 1
openbsd.id, 1
opencad.io, 0
opencluster.at, 1
openconcept.no, 1
@ -21173,6 +21156,7 @@ openrainbow.net, 1
openrainbow.org, 1
openrealestate.co, 1
openresty.com, 1
openrtv.com, 1
opensource-cms.nl, 1
opensourcedmind.eu, 1
openspa.webhop.info, 1
@ -21369,7 +21353,6 @@ outlookonthedesktop.com, 1
outofcontrol.ca, 1
outpostinfo.com, 1
outsideconnections.com, 1
over25tips.com, 1
overalglas.nl, 1
overclockers.ge, 1
overdrive-usedcars.be, 1
@ -22136,6 +22119,7 @@ phuket-idc.de, 1
phunehehe.net, 1
phuong.faith, 1
phurl.de, 1
phurl.io, 1
phus.lu, 1
physicalism.com, 1
physicalist.com, 1
@ -23174,7 +23158,6 @@ purrfectmembersclub.com, 1
purrfectswingers.com, 1
puryearlaw.com, 1
pusatinkubatorbayi.com, 1
pushstar.com, 1
put.moe, 1
put.re, 1
putatara.net, 1
@ -23251,7 +23234,6 @@ qforum.org, 1
qgustavor.tk, 1
qhse-professionals.nl, 1
qianalysis.com, 1
qiannews.net, 1
qifu.me, 1
qifu.org.cn, 1
qikan.net, 1
@ -23681,7 +23663,7 @@ recruitsecuritytraining.co.uk, 1
recruitsecuritytraining.com, 1
rectoraudiparts.com, 1
recuerdafilms.com, 1
recurly.com, 0
recurly.com, 1
recyclingpromotions.us, 1
red-t-shirt.ru, 1
redable.hosting, 1
@ -24177,6 +24159,7 @@ robert-flynn.de, 1
robertabittle.com, 1
robertattfield.com, 1
robertg.me, 1
roberthurlbut.com, 1
robertkrueger.de, 1
robertlysik.com, 1
roberto-webhosting.nl, 1
@ -24304,7 +24287,6 @@ ronomon.com, 1
roo.ie, 1
roofingomaha.com, 1
roofsandbasements.com, 1
rool.me, 1
roolevoi.ru, 1
room-checkin24.de, 1
room208.org, 1
@ -24364,6 +24346,7 @@ rotex1840.de, 1
rothkranz.net, 1
rothnater.ch, 1
rotol.me, 1
rotozen.com, 1
rotterdamjazz.info, 1
rottweil-hilft.de, 1
rotunneling.net, 1
@ -24869,7 +24852,6 @@ satrent.se, 1
saturn.pl, 1
saudavel.com.vc, 1
saudeealimentos.com, 1
saudeeconforto.com.br, 1
saudeintimadamulher.com.br, 1
saudenoclique.com.br, 1
sauer-systems.net, 1
@ -25511,6 +25493,7 @@ sexgarage.de, 1
sexmobil.de, 1
sexocomgravidas.com, 1
sexpay.net, 1
sexplicit.co.uk, 1
sexservice.io, 1
sexshopfacil.com.br, 1
sexshopnet.com.br, 1
@ -26191,7 +26174,6 @@ slingoweb.com, 1
slink.hr, 1
slip-gaming.tk, 1
slneighbors.org, 1
slo-net.net, 1
slo-tech.com, 1
sloancom.com, 1
slopeedge.com, 1
@ -26733,6 +26715,7 @@ spornkuller.de, 1
sport-in-sundern.de, 1
sport-potreby.cz, 1
sport-potreby.sk, 1
sport-socken.net, 1
sporter.com, 1
sportflash.info, 1
sportnesia.com, 1
@ -27141,7 +27124,6 @@ stonemanbrasil.com.br, 1
stony.com, 1
stonystratford.org, 1
stopakwardhandshakes.org, 1
stopbreakupnow.org, 1
stopbullying.gov, 1
stopfraud.gov, 1
stopthethyroidmadness.com, 1
@ -27707,7 +27689,6 @@ talkwithyourbaby.org, 1
tallcraft.com, 1
talldude.net, 1
talltreeskv.com.au, 1
talon.rip, 1
talsi.eu, 1
talun.de, 1
tam7t.com, 1
@ -28305,6 +28286,7 @@ themostexpensiveworkofart.com, 1
themusecollaborative.org, 1
themusicinnoise.net, 1
themusthaves.nl, 1
thenanfang.com, 1
thenexwork.com, 1
thenib.com, 1
thenichecast.com, 1
@ -28684,10 +28666,11 @@ tkn.tokyo, 1
tkts.cl, 1
tkusano.jp, 1
tkw01536.de, 1
tlach.cz, 1
tlca.org, 1
tlcnet.info, 1
tlehseasyads.com, 1
tlo.xyz, 1
tloxygen.com, 1
tls.builders, 1
tls.care, 1
tls1914.org, 1
@ -28924,7 +28907,6 @@ toptenthebest.com, 1
toptexture.com, 1
toptheto.com, 1
topwin.la, 1
topyx.com, 1
tor2web.org, 1
toracon.org, 1
torbay.ga, 1
@ -30381,7 +30363,6 @@ vjeff.com, 1
vjeff.net, 1
vk4wip.org.au, 1
vkino.com, 1
vkirichenko.name, 0
vkox.com, 1
vksportphoto.com, 1
vladimiroff.org, 1
@ -30400,6 +30381,7 @@ vm-co.ch, 1
vmc.co.id, 1
vmem.jp, 0
vmgirls.com, 1
vmhydro.ru, 1
vmis.nl, 1
vmoagents.com, 0
vmug.pl, 1
@ -30779,7 +30761,6 @@ webfilings-eu-mirror.appspot.com, 1
webfilings-eu.appspot.com, 1
webfilings-mirror-hrd.appspot.com, 1
webfilings.appspot.com, 1
webfox.com.br, 1
webgarten.ch, 1
webgears.com, 1
webhackspro.com, 1
@ -32324,7 +32305,6 @@ zappbuildapps.com, 1
zaratan.fr, 1
zarmarket.org, 1
zarpo.com.br, 1
zary.me, 1
zaufanatrzeciastrona.pl, 1
zavec.com.ec, 1
zavetaji.lv, 1
@ -32349,6 +32329,7 @@ zdorovayasimya.com, 1
zdravesteny.cz, 1
zdrojak.cz, 1
zdx.ch, 1
ze3kr.com, 1
zebedeescastles.co.uk, 1
zeds-official.com, 1
zeebrieshoekvanholland.nl, 1
@ -32496,7 +32477,6 @@ zolokar.xyz, 1
zombiesecured.com, 1
zomerschoen.nl, 1
zonadebolsa.es, 1
zone-produkte.de, 0
zone39.com, 1
zonecb.com, 1
zonemaster.fr, 1
@ -32537,7 +32517,6 @@ zsoltsandor.me, 1
zsrbcs.com, 1
zten.org, 1
ztjuh.tk, 1
ztytian.com, 1
zuan-in.net, 1
zuckerfloh.de, 1
zudomc.me, 1

View File

@ -427,7 +427,7 @@ this.BrowserTestUtils = {
tabbrowser.tabContainer.removeEventListener("TabOpen", tabOpenListener);
}
tabbrowser.removeTabsProgressListener(progressListener);
resolve(result);
TestUtils.executeSoon(() => resolve(result));
},
};
tabbrowser.addTabsProgressListener(progressListener);

View File

@ -30,7 +30,6 @@ add_task(async function test_view_source_in_tab() {
}, async function(browser) {
let sourceTab = await openViewSource(browser);
let sourceBrowser = sourceTab.linkedBrowser;
await waitForSourceLoaded(sourceBrowser);
await ContentTask.spawn(sourceBrowser, null, async function() {
Assert.equal(content.document.body.id, "viewsource",
@ -58,7 +57,6 @@ add_task(async function test_view_source_in_window() {
url: "http://example.com",
}, async function(browser) {
let sourceWin = await openViewSource(browser);
await waitForSourceLoaded(sourceWin);
await ContentTask.spawn(sourceWin.gBrowser, null, async function() {
Assert.equal(content.document.body.id, "viewsource",
"View source mode enabled");

View File

@ -16,8 +16,6 @@ async function checkFrameSource() {
gBrowser.removeTab(sourceTab);
});
await waitForSourceLoaded(sourceTab);
let browser = gBrowser.selectedBrowser;
let textContent = await ContentTask.spawn(browser, {}, async function() {
return content.document.body.textContent;

View File

@ -47,27 +47,53 @@ function testViewSourceWindow(aURI, aTestCallback, aCloseCallback) {
});
}
function waitForViewSourceWindow() {
return new Promise(resolve => {
let windowListener = {
onOpenWindow(xulWindow) {
let win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
win.addEventListener("load", function() {
if (win.document.documentElement.getAttribute("windowtype") !=
WINDOW_TYPE) {
return;
}
// Found the window
resolve(win);
Services.wm.removeListener(windowListener);
}, {once: true});
},
onCloseWindow() {},
onWindowTitleChange() {}
};
Services.wm.addListener(windowListener);
});
/**
* Wait for view source tab or window after calling given function to open it.
*
* @param open - a function to open view source.
* @returns the new tab or window which shows the source.
*/
async function waitForViewSourceTabOrWindow(open) {
let sourceLoadedPromise;
let tabOrWindowPromise;
if (Services.prefs.getBoolPref("view_source.tab")) {
tabOrWindowPromise = new Promise(resolve => {
gBrowser.tabContainer.addEventListener("TabOpen", event => {
let tab = event.target;
sourceLoadedPromise = waitForSourceLoaded(tab);
resolve(tab);
}, { once: true });
});
} else {
tabOrWindowPromise = new Promise(resolve => {
let windowListener = {
onOpenWindow(xulWindow) {
let win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
win.addEventListener("load", function() {
if (win.document.documentElement.getAttribute("windowtype") !=
WINDOW_TYPE) {
return;
}
// Found the window
sourceLoadedPromise = waitForSourceLoaded(win);
resolve(win);
Services.wm.removeListener(windowListener);
}, {once: true});
},
onCloseWindow() {},
onWindowTitleChange() {}
};
Services.wm.addListener(windowListener);
});
}
await open();
let tabOrWindow = await tabOrWindowPromise;
await sourceLoadedPromise;
return tabOrWindow;
}
/**
@ -77,16 +103,9 @@ function waitForViewSourceWindow() {
* @returns the new tab or window which shows the source.
*/
function openViewSource(browser) {
let openPromise;
if (Services.prefs.getBoolPref("view_source.tab")) {
openPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
} else {
openPromise = waitForViewSourceWindow();
}
window.BrowserViewSource(browser);
return openPromise;
return waitForViewSourceTabOrWindow(() => {
window.BrowserViewSource(browser);
});
}
/**
@ -107,20 +126,13 @@ async function openViewPartialSource(aCSSSelector) {
{ type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
await popupShownPromise;
let openPromise;
if (Services.prefs.getBoolPref("view_source.tab")) {
openPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
} else {
openPromise = waitForViewSourceWindow();
}
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popuphidden");
let item = document.getElementById("context-viewpartialsource-selection");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
return openPromise;
return waitForViewSourceTabOrWindow(async () => {
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popuphidden");
let item = document.getElementById("context-viewpartialsource-selection");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
});
}
/**
@ -145,15 +157,13 @@ async function openViewFrameSourceTab(aCSSSelector) {
EventUtils.synthesizeMouseAtCenter(frameContextMenu, {});
await popupShownPromise;
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(frameContextMenu, "popuphidden");
let item = document.getElementById("context-viewframesource");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
return newTabPromise;
return waitForViewSourceTabOrWindow(async () => {
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(frameContextMenu, "popuphidden");
let item = document.getElementById("context-viewframesource");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
});
}
registerCleanupFunction(function() {
@ -198,12 +208,7 @@ async function openDocumentSelect(aURI, aCSSSelector) {
content.getSelection().selectAllChildren(element);
});
let tabOrWindow = await openViewPartialSource(aCSSSelector);
// Wait until the source has been loaded.
await waitForSourceLoaded(tabOrWindow);
return tabOrWindow;
return openViewPartialSource(aCSSSelector);
}
function pushPrefs(...aPrefs) {

View File

@ -6,14 +6,12 @@ add_task(async function() {
async function verify(link, button) {
info("Clicking " + link);
let waitForNewTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
let loadedPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
await BrowserTestUtils.synthesizeMouseAtCenter("#" + link, { button },
gBrowser.selectedBrowser);
let newtab = await waitForNewTabPromise;
await BrowserTestUtils.browserLoaded(newtab.linkedBrowser);
let newtab = await loadedPromise;
let result = await ContentTask.spawn(newtab.linkedBrowser, { }, async function() {
return (content.document.getElementById("enabled").textContent == "true");