text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; // Shared mozilla-central fixture from the Picture-in-Picture tests: an HTML // page with two looping <video src="gizmo.mp4"> elements (with and without // controls). Looping keeps ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>rowser.tabs.length, initialTabsCount, "No additional tabs were opened."); let pageShownPromise = BrowserTestUtils.waitForContentEvent( tab.linkedBrowser, "pageshow" ); readerButton.click(); await pageShownPromise; // Ensure no new tabs are opened when exiting reader mode in a pinned tab...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_ORIGIN1 = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "http://example.com" ); const TEST_ORIGIN2 = getRootDirectory(gTestPath).replace( "chro...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* eslint-disable @microsoft/sdl/no-insecure-url */ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "http://example.com" ); // This test ver...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "https://example.com" ); add_task(async function test_readerModeURLDrag() { await Browser...
fim
zen-browser/desktop
javascript
<|fim_suffix|>rModeArticle.html", "gURLBar value is about:reader URL" ); is( gURLBar.value, gURLBar.untrimmedValue, "gURLBar is displaying original article URL" ); } ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. http://creativecommons...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* 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/. */ /** * Test that the reader mode button appears and works properly on * reader-able content. */ co...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath).replace( "ch<|fim_suffix|>open("${url}", "_blank");`); }); let newTab = await newTabPromise; let readerButton = doc...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; // This test verifies that the article is properly using the cached data // when switching into reader mode. The article produces a random number // contained within it, so if the art...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* 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/. */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath).replace( "chrome://mochitests/content...
fim
zen-browser/desktop
javascript
<|fim_suffix|>-theme-${aPref}`; await SpecialPowers.spawn( browser, [prefValue, cssProp], (customColor, prop) => { let style = content.window.getComputedStyle(content.document.body); let actualColor = style.getPropertyValue(prop); Assert.equal(customColor, ac...
fim
zen-browser/desktop
javascript
<|fim_suffix|>n test_reader_button() { registerCleanupFunction(function () { // Reset test prefs. TEST_PREFS.forEach(([name]) => { Services.prefs.clearUserPref(name); }); while (gBrowser.tabs.length > 1) { gBrowser.removeCurrentTab(); } }); // Set required test prefs. TEST_PREFS...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Pub<|fim_suffix|>lector(".text-layout-dropdown"); ok(dropdown.classList.contains("open"), "dropdown remains open"); }); } ); }); <|fim_middle|>lic * License, v. 2.0. If a copy of the MPL was not distributed with this * f...
fim
zen-browser/desktop
javascript
<|fim_suffix|>test(readingTimeText), "Reading time should be '~2 hours'"); }); } ); }); /** * Test that the reader mode correctly calculates and displays the * estimated reading time for a very long article where a range * (hours) is displayed. */ add_task(async function () { await BrowserTestUtils.w...
fim
zen-browser/desktop
javascript
<|fim_suffix|>n Reader Mode failed to load an article." ); }); }); } add_task(async function () { // Testing a non-text/plain document await testRefresh(TEST_PATH + "readerModeArticle.html"); // Testing a test/plain document await testRefresh(TEST_PATH + "readerModeArticleTextPlain.txt"); }); <|fi...
fim
zen-browser/desktop
javascript
<|fim_suffix|>tml", async function (browser) { if (SpecialPowers.useRemoteSubframes) { isnot( browser.remoteType, articleRemoteType, "Cross-site article should have different remote type with fission" ); } BrowserTestUtils.startLoadingURIString(browse...
fim
zen-browser/desktop
javascript
<|fim_suffix|> }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_ORIGIN = getRootDirectory(gTestPath).replace( "chrome://mochitests/content", "http://example.com" ); const { HttpServer } = ChromeUtils.importESMod...
fim
zen-browser/desktop
javascript
<|fim_suffix|>edFocuses); reversed.reverse(); ensureFocusOrder(reversed, true); }); } ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https:<|fim_middle|>//creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath)....
fim
zen-browser/desktop
javascript
<|fim_suffix|>pawn( browser, [Object.keys(defaultValues), defaultValues], (props, defaults) => { let resetButton = content.document.querySelector( ".text-layout-reset-button" ); resetButton.click(); let container = content.document.querySelecto...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* 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/. */ "use strict"; const TEST_PATH = getRootDirectory(gTestPath).replace( "chrome://mochitests/content...
fim
zen-browser/desktop
javascript
<|fim_suffix|>owserTestUtils.isHidden(element), msg || "Element should be hidden"); } <|fim_prefix|>/* exported is_element_visible, is_element_hidden */ function is_element_visible(element, msg) { isnot(element, null, "Element should not be null, when checking visibility"); ok(BrowserTestUtils.isVisible(element), ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Check presence of the "Ignore this warning" button */ function checkWarningState() { return SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { return !!content.document.getElementById("ignore_warning_link"); }); } add_task(async function testMalware() { await new Promise(resolve => w...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Check for the correct behaviour of the report web forgery/not a web forgery menu items. Mac makes this astonishingly painful to test since their help menu is special magic, but we can at least test it on the other platforms.*/ const NORMAL_PAGE = "http://example.com"; const PHISH_PAGE = "http://www.i...
fim
zen-browser/desktop
javascript
<|fim_suffix|>cked is successfully loaded!"); } ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ const SECURE_CONTAINER_URL = "https://example.com/browser/browser/components/safebrowsing/content/test/empty_file.html"; add_task(asy...
fim
zen-browser/desktop
javascript
<|fim_suffix|>dLoaded = BrowserTestUtils.waitForContentEvent( tab.linkedBrowser, "AboutBlockedLoaded", true, undefined, true ); BrowserTestUtils.startLoadingURIString(tab.linkedBrowser, TEST_PAGE); await blockedLoaded; testBlockedPage(tab.ownerGlobal); }); <|fim_prefix|>/* Ensure that hostna...
fim
zen-browser/desktop
javascript
<|fim_suffix|>le"); Services.prefs.setCharPref( "urlclassifier.blockedTable", "moztest-block-simple" ); SafeBrowsing.init(); <|fim_prefix|>// This url must sync with the table, url in SafeBrowsing.sys.mjs addMozEntries const PHISH_TABLE = "moztest-phish-simple"; const PHISH_URL = "https://www.itisatrap.org/firefox/...
fim
zen-browser/desktop
javascript
<|fim_prefix|>// Where we save the desktop background to (~/Pictures). const NS_OSX_PICTURE_DOCUMENTS_DIR = "Pct"; // Paths used to run the CLI command (python script) that is used to // 1) check the desktop background image matches what we set it to via // nsIShellService::setDesktopBackground() and // 2) revert t...
fim
zen-browser/desktop
javascript
<|fim_suffix|>EMA, GS_OPTION_KEY), expectedGSettingsPosition, "Wallpaper position GSettings key is correct" ); }; restoreSettings = function () { shell.setGSettingsString(GS_BG_SCHEMA, GS_IMAGE_KEY, prevImage); shell.setGSettingsString(GS_BG_SCHEMA,...
fim
zen-browser/desktop
javascript
<|fim_suffix|>llService.isDefaultBrowser(true, false), "we got here and are the default browser" ); ok( ShellService.isDefaultBrowser(true, true), "we got here and are the default browser" ); } <|fim_prefix|>function test() { ShellService.set<|fim_middle|>DefaultBrowser(false); ok( She<|endoft...
fim
zen-browser/desktop
javascript
<|fim_suffix|>Path}: Shortcut should exist` ); ok( queryShortcutLog(relativePath, logHeader), `${specialFolder}\\${relativePath}: Shortcut log entry was added` ); await shellService.deleteShortcut(specialFolder, relativePath); ok( !shortcutFile.exists(), `${specialFolder}\\${relativePath}: Sho...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ ChromeUtils.defin<|fim_suffix|>wait ShellService.doesAppNeedPin(); Assert.notStrictEqual( defaultValue, undefined, "Got a default app need pin value" ); }); add_task(async functio...
fim
zen-browser/desktop
javascript
<|fim_prefix|>"use strict"; add_task(async function () { // Test all four basic variations of the "screenshot" argument // when a file path is specified. await testFileCreationPositive( [ "-url", "http://mochi.test:8888/browser/browser/components/shell/test/headless.html", "-screenshot", ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>"use strict"; add_task(async function () { const cwdScreenshotPath = PathUtils.join( Services.dirsvc.get("CurWorkD", Ci.nsIFile).path, "screenshot.png" ); // Test variations of the "screenshot" argument when a file path // isn't specified. await testFileCreationPositive( [ "-s...
fim
zen-browser/desktop
javascript
"use strict"; add_task(async function () { const cwdScreenshotPath = PathUtils.join( Services.dirsvc.get("CurWorkD", Ci.nsIFile).path, "screenshot.png" ); // Test invalid URL arguments (either no argument or too many arguments). await testFileCreationNegative(["-screenshot"], cwdScreenshotPath); awa...
fim
zen-browser/desktop
javascript
<|fim_suffix|>8888/browser/browser/components/shell/test/headless.html", "-screenshot", "-window-size", "hello", ], cwdScreenshotPath ); await testFileCreationNegative( [ "-url", "http://mochi.test:8888/browser/browser/components/shell/test/headless.html", "-screensho...
fim
zen-browser/desktop
javascript
<|fim_suffix|>s/shell/test/headless_cross_origin.html", screenshotPath ); }); <|fim_prefix|>"use strict"; add_task(async function () { // Test cross origin iframes work. await testGreen( <|fim_middle|> "http://mochi.test:8888/browser/browser/component<|endoftext|>
fim
zen-browser/desktop
javascript
<|fim_suffix|> }); <|fim_prefix|>"use strict"; <|fim_middle|>add_task(async function () { // Test when the requested URL redirects await testFileCreationPositive( [ "-url", "http://mochi.test:8888/browser/browser/components/shell/test/headless_redirect.html", "-screenshot", screenshotPa...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * https://creativecommons.org/publicdomain/zero/1.0/ */ /** * Bug 1950734 tracks how calling PinCurrentAppToTaskbarWin11 * on MSIX may cause the process AUMID to be unnecessarily changed. * This test verifies that the behaviour will no longer happen...
fim
zen-browser/desktop
javascript
<|fim_suffix|> info("Nothing to test on non-Windows"); return; } let userChoicePromise = Promise.resolve(); userChoiceStub.callsFake(function (...args) { return (userChoicePromise = userChoiceStub.wrappedMethod.apply(this, args)); }); userChoiceStub.resetHistory(); setDefaultStub.resetHistory()...
fim
zen-browser/desktop
javascript
<|fim_suffix|>stGetValue(), undefined, "Did not record user-choice success" ); Assert.equal( Glean.browser.setDefaultPdfHandlerOpenWithResult.Failure.testGetValue(), 1, "Recorded open-with failure" ); Assert.equal( Glean.browser.setDefaultPdfHandlerOpenWithResult.Succ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ /** * Check whether the preview image for setDesktopBackground is rendered * correctly, without stretching */ add_setup(async function () { await SpecialPowers.pushPrefEnv({ set: [["test....
fim
zen-browser/desktop
javascript
<|fim_suffix|> getter_AddRefs(feature)); ASSERT_TRUE(NS_SUCCEEDED(rv)); bool unlocked = false; rv = feature->Unlock(&unlocked); ASSERT_TRUE(NS_SUCCEEDED(rv)); EXPECT_TRUE(unlocked); } } <|fim_prefix|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2....
fim
zen-browser/desktop
cpp
<|fim_suffix|>R, key, mozilla::Nothing(), value)); } // clang-format on } static void UnregisterAsBrowser() { const std::wstring appRegName{sAppRegName.get()}; // clang-format off // HKEY_CURRENT_USER\Software\RegisteredApplications { const std::wstring key{L"Software\\RegisteredAppl...
fim
zen-browser/desktop
cpp
<|fim_prefix|>/* 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/. */ #include "gtest/gtest.h" #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #...
fim
zen-browser/desktop
cpp
<|fim_suffix|>.exists(screenshotPath); ok(saved, "A screenshot should be saved in the tmp directory"); if (!saved) { return; } let data = await IOUtils.read(screenshotPath); await new Promise(resolve => { let blob = new Blob([data], { type: "image/png" }); let reader = new FileReader(); reade...
fim
zen-browser/desktop
javascript
<|fim_suffix|>xisting desktop image realpath: %s" % existingImagePath) # Resolve the path we're going to check checkImagePathReal = os.path.realpath(args.checkBackgroundImagePath) logger.debug("check desktop image: %s" % args.checkBackgroundImagePath) logger.debug("check desktop image r...
fim
zen-browser/desktop
python
<|fim_suffix|> 0o755); } await IOUtils.makeDirectory(PathUtils.join(container, "links")); try { await Promise.all( linkNames.map(async linkName => { let linkPath = PathUtils.join(container, "links", linkName); // There doesn't seem to be a nice way to create symlinks from JavaScript, ...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated t<|fim_suffix|>showSecurityPreferences("Privacy_AllFiles"); equal(killSystemPreferences(), 0, "Ensure System Preferences was started"); }); <|fim_middle|>o the Public Domain. * https://creativecommons.org/publicdomain/zero/1.0/ */ /** * Test the macOS ShowSecurityPrefer...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. * https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; ChromeUtils.defineESModuleGetters(this, { MockRegistrar: "resource://testing-common/MockRegistrar.sys.mjs", ShellService: "moz-src:///browser/components/shell/ShellService.sys.m...
fim
zen-browser/desktop
javascript
<|fim_suffix|>files without just rewriting * writeShortcutIcon inline. * * @param {nsIFile} file - The file containing the image. */ async function verifyOutput(file) { let image = imgTools.decodeImageFromArrayBuffer( (await IOUtils.read(file.path)).buffer, ShellService.shortcutIconType.mimeType ); o...
fim
zen-browser/desktop
javascript
<|fim_prefix|>const EMPTY_PAGE_URL = GetTestWebBasedURL("file_empty.html"); const AUTPLAY_PAGE_URL = GetTestWebBasedURL("file_autoplay_media.html"); const CORS_AUTPLAY_PAGE_URL = GetTestWebBasedURL( "file_autoplay_media.html", true ); /** * When an iframe that has audible media gets destroyed, if there is no othe...
fim
zen-browser/desktop
javascript
<|fim_prefix|>const PAGE = GetTestWebBasedURL("file_mediaPlayback.html"); const FRAME = GetTestWebBasedURL("file_mediaPlaybackFrame.html"); function wait_for_event(browser, event) { return BrowserTestUtils.waitForEvent(browser, event, false, e => { is( e.originalTarget, browser, "Event must be ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>defined, PAGE) ); }); add_task(async function test_frame() { await BrowserTestUtils.withNewTab( { gBrowser, url: "about:blank", }, test_on_browser.bind(undefined, FRAME) ); }); add_task(async function test_frame() { await BrowserTestUtils.withNewTab( { gBrowser,...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/** * When media changes its audible state, the sound indicator should be * updated as well, which should appear only when web audio is audible. */ add_task(async function testUpdateSoundIndicatorWhenMediaPlaybackChanges() { info("create a tab loading media document"); const tab = await createBlank...
fim
zen-browser/desktop
javascript
<|fim_prefix|>const PAGE = "data:text/html,page"; function test_on_browser(browser) { ok(!browser.audioMuted, "Audio should not be muted<|fim_suffix|>E, }, test_on_browser ); }); <|fim_middle|> by default"); browser.mute(); ok(browser.audioMuted, "Audio should be muted now"); browser.unmute(); ok(!...
fim
zen-browser/desktop
javascript
<|fim_suffix|>audioMuted, "Audio should not be muted by default"); browser.mute(); ok(browser.audioMuted, "Audio should be muted now"); await BrowserTestUtils.withNewTab( { gBrowser, url: PAGE, }, test_on_browser2 ); browser.unmute(); ok(!browser.audioMuted, "Audio should be unmute...
fim
zen-browser/desktop
javascript
// The tab closing code leaves an uncaught rejection. This test has been // whitelisted until the issue is fixed. if (!gMultiProcessBrowser) { const { PromiseTestUtils } = ChromeUtils.importESModule( "resource://testing-common/PromiseTestUtils.sys.mjs" ); PromiseTestUtils.expectUncaughtRejection(/is no longer...
fim
zen-browser/desktop
javascript
<|fim_prefix|>const SILENT_PAGE = GetTestWebBasedURL("file_silentAudioTrack.html"); const ALMOST_SILENT_PAGE = GetTestWebBasedURL( "file_almostSilentAudioTrack.html" ); function check_audio_playing_state(isPlaying) { let autoPlay = content.document.getElementById("autoplay"); if (!autoPlay) { ok(false, "Can'...
fim
zen-browser/desktop
javascript
/** * This test is used to ensure the 'sound-playing' icon would not disappear after * sites call AudioContext.resume(). */ "use strict"; function setup_test_preference() { return SpecialPowers.pushPrefEnv({ set: [ ["media.useAudioChannelService.testing", true], ["browser.tabs.delayHidingAudioPlay...
fim
zen-browser/desktop
javascript
<|fim_suffix|>ct(dest); source.start(); }); info(`- check AudioContext's state -`); await SpecialPowers.spawn(browser, [], waitUntilAudioContextStarts); ok(true, `AudioContext is running.`); info(`- should not show sound indicator -`); // If we do the next step too early, then we can't make sure whethe...
fim
zen-browser/desktop
javascript
const EMPTY_PAGE_URL = GetTestWebBasedURL("file_empty.html"); /** * When web audio changes its audible state, the sound indicator should be * updated as well, which should appear only when web audio is audible. */ add_task( async function testWebAudioAudibilityWouldAffectTheAppearenceOfTabSoundIndicator() { i...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/** * Global variables for testing. */ const gEMPTY_PAGE_URL = GetTestWebBasedURL("file_empty.html"); /** * Return a web-based URL for a given file based on the testing directory. * * @param {string} fileName * file that caller wants its web-based url * @param {boolean} cors [optional] * ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>ouldHaveTooltip) { is( textObj.value, expectedTooltipText, "element " + id + " should have the right tooltip text" ); } } checkElement("svg1", "This is a non-root SVG element title"); checkElement("text1", ...
fim
zen-browser/desktop
javascript
<|fim_suffix|> ok( tttp.getNodeText(xulToolbarButton, textObj, {}), "should get tooltiptext" ); is(textObj.value, "XUL tooltiptext"); }); } ); }); <|fim_prefix|>/** * Tests that the tooltiptext attribute is used for XUL elements in an HTML doc. */ add_task(async functi...
fim
zen-browser/desktop
javascript
<|fim_prefix|>add_task(async function () { await BrowserTestUtils.withNewTab( { gBrowser, url: "data:text/html,<!DOCTYPE html><html><body><input id='i'></body></html>", <|fim_suffix|>ok( !tttp.getNodeText(i, {}, {}), "No tooltip should be shown when @title is null" ); ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>["select", false, null], ["output", true, null], ["fieldset", true, null], ["object", true, null], ]; for (let data of testData) { await check(browser, data[0], data[1], data[2]); } let todo_testData = [["keygen", "false"]]; for (let data of...
fim
zen-browser/desktop
javascript
<|fim_suffix|>await BrowserTestUtils.synthesizeMouseAtCenter( "#test_input", {}, tab.linkedBrowser ); info("Waiting for the input to have the requisite files"); await SpecialPowers.spawn(tab.linkedBrowser, [], async function () { let input = content.document.querySelect...
fim
zen-browser/desktop
javascript
<|fim_suffix|>(resolve => { let tooltipId = Services.appinfo.browserTabsRemoteAutostart ? "remoteBrowserTooltip" : "aHTMLTooltip"; let tooltip = document.getElementById(tooltipId); tooltip.addEventListener( "popupshown", function (event) { reso...
fim
zen-browser/desktop
javascript
<|fim_suffix|>); }); info("Initial mouse move"); await EventUtils.synthesizeAndWaitNativeMouseMove(tab.linkedBrowser, 50, 5); info("Waiting"); await new Promise(resolve => setTimeout(resolve, 400)); info("Second mouse move"); await EventUtils.synthesizeAndWaitNativeMouseMove(tab.linkedBrowser, 70, 5); i...
fim
zen-browser/desktop
javascript
<|fim_suffix|>serTestUtils.withNewTab( { gBrowser, url: "https://example.com/", }, async function (browser) { let tab = gBrowser.getTabForBrowser(browser); gZenPinnedTabManager.addToEssentials(tab); ok( tab.hasAttribute("zen-essential"), "The tab should be marke...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_Changed_Pinned() { let resolvePromise; const promise = new Promise(resolve => { resolvePromise = resolve;<|fim_suffix|>mise; } ); }); <|fi...
fim
zen-browser/desktop
javascript
<|fim_suffix|> => { const tab = gBrowser.getTabForBrowser(browser); gBrowser.pinTab(tab); document.getElementById("cmd_close").doCommand(); // eslint-disable-next-line mozilla/no-arbitrary-setTimeout setTimeout(() => { ok(tab.closing, "The tab should be closing after being closed"...
fim
zen-browser/desktop
javascript
<|fim_suffix|>tUtils.openNewForegroundTab( window.gBrowser, "https://example.com/", true ); const newTab = gBrowser.selectedTab; gBrowser.pinTab(newTab); await gBrowser.TabStateFlusher.flush(newTab.linkedBrowser); ok(newTab.pinned, "The tab should be pinned after calling gBrowser.pinTab()"); ...
fim
zen-browser/desktop
javascript
<|fim_suffix|> be selected after being closed" ); resolvePromise(); }, 100); }, 0); await promise; } ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function tes...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; async function pinAndNavigateTab(url, navigateTo) { const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url); gBrowser.pinTab(tab); await gBrowser.TabStateFlushe...
fim
zen-browser/desktop
javascript
<|fim_suffix|> }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_Unload_NoReset_Pinned() { await SpecialPowers.pushPrefEnv({ set: [["zen.pinned-tab-manager.close-shortcut-behavior", "reset"]],...
fim
zen-browser/desktop
javascript
<|fim_suffix|>" ); resolvePromise(); }, 100); }, 0); await promise; } ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_Unload_NoReset_Pinned() { a...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_Pinned_To_Essential() { let resolvePromise; const promise = new Promise(resolve => { resolvePromise = resolve; }); await BrowserTestUtils.o...
fim
zen-browser/desktop
javascript
<|fim_suffix|> let resolvePromise; const promise = new Promise(resolve => { resolvePromise = resolve; }); await BrowserTestUtils.withNewTab( { gBrowser, url: "https://example.com/1" }, async browser => { const tab = gBrowser.getTabForBrowser(browser); gBrowser.pinTab(tab); Brows...
fim
zen-browser/desktop
javascript
<|fim_suffix|> await BrowserTestUtils.withNewTab( { gBrowser, url: "https://example.com/1" }, async browser => { const tab = gBrowser.getTabForBrowser(browser); gBrowser.pinTab(tab); BrowserTestUtils.startLoadingURIString(browser, "https://example.com/2"); await BrowserTestUtils.brows...
fim
zen-browser/desktop
javascript
<|fim_suffix|>lHeight", { value: realAvailHeight, configurable: true, }); Object.defineProperty(window.screen, "availTop", { value: realAvailTop, configurable: true, }); } }); <|fim_prefix|>/* Any copyri<|fim_middle|>ght is dedicated to the Public Domain. https://creativecommons...
fim
zen-browser/desktop
javascript
<|fim_suffix|>ction test_reader_mode_button_disabled_when_unavailable() { const tab = BrowserTestUtils.addTab(gBrowser, HTTPS_PAGE, { skipAnimation: true, }); await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.switchTab(gBrowser, tab); try { await openSiteDataPanel(); ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>.removeTab(addonsTab); } BrowserTestUtils.removeTab(tab); } }); add_task(async function test_get_addons_button_opens_amo() { await SpecialPowers.pushPrefEnv({ set: [["extensions.getAddons.link.url", "https://example.com/"]], }); const tab = BrowserTestUtils.addTab(gBrowser, HTTPS_PAG...
fim
zen-browser/desktop
javascript
<|fim_suffix|>); Assert.ok( renderedIds.includes(extA.id), `addon A (${extA.id}) is rendered` ); Assert.ok( renderedIds.includes(extB.id), `addon B (${extB.id}) is rendered` ); const itemA = siteDataPanel().querySelector( `.unified-extensions-item[data-extensionid="${e...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_clicking_icon_opens_and_prepares_panel() { const tab = BrowserTestUtils.addTab(gBrowser, HTTPS_PAGE, { skipAnimation: true, }); await BrowserT...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const { SitePermissions } = ChromeUtils.importESModule( "resource:///modules/SitePermissions.sys.mjs" ); add_task(async function test_toggling_permission_flips_ui_and_store() { ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>Panel(); BrowserTestUtils.removeTab(tab); } }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; function securityIdentity() { return document .getElementById("zen-site-data-security-info") .getAttrib...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicate<|fim_suffix|>anel.hidePopup(true); await hidden; } <|fim_middle|>d to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const HTTP_PAGE = "https://mochi.test:8888/"; const HTTPS_PAGE = "https://example.com/"; async function loadUrl(...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_setup(async function () { clearAllRoutes(); const savedDefault = gZenSpaceRoutingManager.getDefaultExternalRoute(<|fim_suffix|>unique_ids() { const a = gZenSpaceRoutingMan...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_setup(async function () { clearAllRoutes(); const savedDefault = gZenSpaceRoutingManager.getDefaultExternalRoute(); registerCleanupFunction(() => { clearAllRoutes(); ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>"most-recent-space"); const defaultExternal = gZenSpaceRoutingManager.getDefaultExternalRoute(); allowed.add(defaultExternal); const ITERATIONS = 4000; for (let i = 0; i < ITERATIONS; i++) { const url = randomUrl(rng); const fromExternal = rng() < 0.5; let result; try { res...
fim
zen-browser/desktop
javascript
<|fim_suffix|>s: [TARGET_WS] }); gZenSpaceRoutingManager.onAfterAddTab( "https://github.com/zen", { parentNode: null }, {}, win, { targetRoute: TARGET_WS.uuid } ); await flushEventLoop(); Assert.equal( win.gZenWorkspaces.moveCalls.length, 0, "A detached tab (no parentNode) is n...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; // Exercises nsZenSpaceRoutingManager.shouldRedirectNavigation: an in-place // navigation is only redirected into a new tab when its rule points at a space // that differs from the ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>falls through to no match" ); }); <|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_contains_is_case_insensitive_substring() { const route = { reference: "GitHub", matchType: "contains...
fim
zen-browser/desktop
javascript
<|fim_suffix|>llRoutes(); const savedDefault = gZenSpaceRoutingManager.getDefaultExternalRoute(); registerCleanupFunction(() => { clearAllRoutes(); gZenSpaceRoutingManager.setDefaultExternalRoute(savedDefault); }); }); add_task(async function test_no_match_returns_most_recent_space() { clearAllRoutes()...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; const { gZenSpaceRoutingManager } = ChromeUtils.importESModule( "resource:///modules/zen/spacerouting/ZenSpaceRoutingManager.sys.mjs" ); const SR_DIALOG_URI = "chrome://browser...
fim
zen-browser/desktop
javascript
<|fim_suffix|>cdomain/zero/1.0/ */ "use strict"; add_setup(async function () {}); add_task(async function test_Check_Creation() { const currentWorkspaceUUID = gZenWorkspaces.activeWorkspace; await gZenWorkspaces.createAndSaveWorkspace("Test Workspace 2"); const workspaces = gZenWorkspaces.getWorkspaces(); As...
fim
zen-browser/desktop
javascript
<|fim_prefix|>/* Any copyright is dedicated to the Public Domain. https://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; add_task(async function test_Change_To_Empty() { // eslint-disable-next-line no-unused-vars const currentWorkspaceUUID = gZenWorkspaces.activeWorkspace; await gZenWorkspaces.c...
fim
zen-browser/desktop
javascript
<|fim_suffix|>oubleClick = gZenWorkspaces.activeWorkspaceElement.querySelector( ".zen-workspace-empty-space" ); ok(placeToDoubleClick, "We should have found the place to double click."); EventUtils.sendMouseEvent({ type: "dblclick" }, placeToDoubleClick, window); await TestUtils.waitForCondition( ...
fim
zen-browser/desktop
javascript
<|fim_suffix|>Window.BrowserCommands.closeTabOrWindow(); await unloadEvent; ok(newWindow.closed, "Window should be closing"); await SpecialPowers.popPrefEnv(); }); add_task(async function test_Issue_10455_Dont_Close() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.tabs.closeWindowWithLastTab",...
fim
zen-browser/desktop
javascript