Files
palemoon27/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
T
roytam1 074e62376e import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1198209 - Add a "Total Memory" Histogram. r=vladan (8d1e1e9c27)
- Bug 1245649: Turn on no-extra-semi. r=markh (75bf2688ed)
- Bug 1242975 - Make services/sync eslintable. r=markh (52db54aa21)
- Bug 1227956 - Implement Kinto.js OneCRL client r=rnewman (6405ba31ef)
- Bug 1216749 - Additional kinto client tests (r=rnewman) (9ab581ce9e)
- Bug 1241278 - Record telemetry for notification permission callback usage. r=vladan (a13defaeee)
- Bug 1233714 - check the return value of Init() in order to prevent null pointer dereference on cx if it fails. r=smaug (d3cfd4e37b)
- Bug 1125325 - Follow-up to stop sending over bad values to the child process when a widget is not available. r=smaug (940f7a7bed)
- Bug 1234120 part.1 IMEHandler should request all notifications which are requested by either IMMHander or TSFTextStore when IMM is available in TSF mode r=m_kato (255b15edc7)
- Bug 1234120 part.2 TSFTextStore should ignore unnecessary text and selection changes which are caused by composition r=m_kato (7151f0a4e6)
- Bug 1234120 part.3 IMMHandler should forget caret position specified by IME when IMMHandler doesn't set caret range to eCompositionChange event r=m_kato (c2984cdef4)
- Bug 1198594 The copy constructor of IMENotification should initialize mMessage before calling Assign() r=smaug (7b8acb6f93)
- Bug 1219139 - Fix -Wimplicit-fallthrough warnings in dom/events and widget/IMEData.h. r=masayuki (7e7de8caba)
- Bug 1242331 part.1 Remove unused methods of IMENotification r=smaug (5ee147f357)
- Bug 1233631 - Moz2Dify CanvasBidiProcessor. r=jfkthame. Bug 801176 - part0-v3: Modify Coding Style for 2d Canvas. r=roc (3c5e89d6ef)
- Bug 1242331 part.2 Rename TextChangeDataBase::mCausedByComposition to mCausedOnlyByComposition r=smaug (0656bbb16c)
- Bug 1242331 part.3 Rename TextChangeDataBase::mOccurredDuringComposition to mIncludingChangesDuringComposition r=smaug (80388277e1)
- Bug 1242331 part.4 Add TextChangeDataBase::mIncludingChangesWithoutComposition r=smaug (ac3a1b637f)
- Bug 1242331 part.5 TSFTextStore should ignore text changes not caused by composition but not occurred during current composition r=m_kato (f8581a3ba0)
- Bug 1224605 - also show the OSK when tapping in focused inputs, r=masayuki (b04cbfa2c5)
- Bug 1192248 - Fixed WinIMEHandler.cpp cross compilation. r=masayuki (6fbbedd935)
- Bug 1224454 part.1 IMEHandler should generate NOTIFY_IME_OF_BLUR in e10s mode if the focused widget is being destroyed before receiving NOTIFY_IME_OF_BLUR r=m_kato (501587db56)
- Bug 1224454 part.2 IMMHandler::OnFocusChange() should cancel remaining composition when given nsWindow is being destroyed r=m_kato (0281f46e22)
- Bug 1226148 - reduce flickering and closing when using the OSK tab key, r=masayuki (74d2ec314d)
- Bug 1240208 - use inputmode in XUL to get better hinting for IME and on-screen keyboards, r=masayuki,smaug (8520914e2f)
- Bug 1236058 - recognize bluetooth keyboard devices when determining whether to show an on-screen keyboard, r=masayuki,f=jaws (f04a187fbc)
- Bug 1239744 - no longer automatically show an on-screen keyboard for programmatic focus changes, tidy up osk logic in IMEHandler, r=masayuki (1d9c056e69)
- Bug 1245038 - Show on screen keyboard even if tip window is invisible. r=masayuki (9ebcdaaaa0)
- Bug 1175631 - Make sure TabParent::GetWidget returns a widget even if it's display:none. r=smaug (d0b0bf9738)
- Bug 1143620 - Fix OutWindowOpened flag r=kanru (1ed6fec192)
- remove assertion (6f6620dab5)
- Bug 1236322 - Part 1: Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in parser/. r=hsivonen (c7ba9fee68)
- Bug 1236322 - Part 2: Suppress -Wimplicit-fallthrough warnings in parser/html generated code. r=hsivonen (ff3993a6d9)
- Bug 1236323 - Part 1: Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in gfx/. r=nical (d7e66601c7)
- Bug 1236323 - Part 2: Suppress -Wimplicit-fallthrough warnings in gfx/ from Skia header files. r=nical (873ca12f22)
2023-12-19 14:05:15 +08:00

85 lines
3.0 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function test() {
// initialization
waitForExplicitFinish();
let windowsToClose = [];
let testURI = "https://www.mozilla.org/en-US/";
let initialURL =
"http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
let finalURL =
"http://example.com/tests/toolkit/components/places/tests/browser/final.html";
let observer = null;
let enumerator = null;
let currentObserver = null;
let uri = null;
function doTest(aIsPrivateMode, aWindow, aTestURI, aCallback) {
aWindow.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
if (aWindow.gBrowser.selectedBrowser.contentWindow.location != aTestURI) {
aWindow.gBrowser.selectedBrowser.contentWindow.location = aTestURI;
return;
}
aWindow.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
if (aCallback) {
aCallback();
}
}, true);
observer = {
observe: function(aSubject, aTopic, aData) {
// The uri-visit-saved topic should only work when on normal mode.
if (aTopic == "uri-visit-saved") {
// Remove the observers set on per window private mode and normal
// mode.
enumerator = aWindow.Services.obs.enumerateObservers("uri-visit-saved");
while (enumerator.hasMoreElements()) {
currentObserver = enumerator.getNext();
aWindow.Services.obs.removeObserver(currentObserver, "uri-visit-saved");
}
// The expected visit should be the finalURL because private mode
// should not register a visit with the initialURL.
uri = aSubject.QueryInterface(Ci.nsIURI);
is(uri.spec, finalURL, "Check received expected visit");
}
}
};
aWindow.Services.obs.addObserver(observer, "uri-visit-saved", false);
aWindow.gBrowser.selectedBrowser.loadURI(aTestURI);
}
function testOnWindow(aOptions, aCallback) {
whenNewWindowLoaded(aOptions, function(aWin) {
windowsToClose.push(aWin);
// execute should only be called when need, like when you are opening
// web pages on the test. If calling executeSoon() is not necesary, then
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(() => aCallback(aWin));
});
}
// This function is called after calling finish() on the test.
registerCleanupFunction(function() {
windowsToClose.forEach(function(aWin) {
aWin.close();
});
});
// test first when on private mode
testOnWindow({private: true}, function(aWin) {
doTest(true, aWin, initialURL, function() {
// then test when not on private mode
testOnWindow({}, function(aWin) {
doTest(false, aWin, finalURL, function () {
PlacesTestUtils.clearHistory().then(finish);
});
});
});
});
}