forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge inbound to mozilla-central. a=merge
- Loading branch information
Showing
217 changed files
with
35,503 additions
and
1,165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
browser/components/extensions/test/browser/browser_ext_popup_focus.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ | ||
/* vim: set sts=2 sw=2 et tw=80: */ | ||
"use strict"; | ||
|
||
const DUMMY_PAGE = "http://example.com/browser/browser/components/extensions/test/browser/file_dummy.html"; | ||
|
||
add_task(async function testPageActionFocus() { | ||
let extension = ExtensionTestUtils.loadExtension({ | ||
manifest: { | ||
"page_action": { | ||
"default_popup": "popup.html", | ||
"show_matches": ["<all_urls>"], | ||
}, | ||
}, | ||
files: { | ||
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"> | ||
<script src="popup.js"></script> | ||
</head><body> | ||
</body></html> | ||
`, | ||
"popup.js": function() { | ||
window.addEventListener("focus", (event) => { | ||
browser.test.assertEq(true, document.hasFocus(), "document should be focused"); | ||
browser.test.notifyPass("focused"); | ||
}, {once: true}); | ||
}, | ||
}, | ||
}); | ||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE); | ||
|
||
await extension.startup(); | ||
let finish = extension.awaitFinish("focused"); | ||
await clickPageAction(extension); | ||
await finish; | ||
await closePageAction(extension); | ||
|
||
await BrowserTestUtils.removeTab(tab); | ||
await extension.unload(); | ||
}); | ||
|
||
add_task(async function testBrowserActionFocus() { | ||
let extension = ExtensionTestUtils.loadExtension({ | ||
manifest: { | ||
"browser_action": {"default_popup": "popup.html"}, | ||
}, | ||
files: { | ||
"popup.html": `<!DOCTYPE html><html><head><meta charset="utf-8"> | ||
<script src="popup.js"></script> | ||
</head><body> | ||
</body></html> | ||
`, | ||
"popup.js": function() { | ||
window.addEventListener("focus", (event) => { | ||
browser.test.assertEq(true, document.hasFocus(), "document should be focused"); | ||
browser.test.notifyPass("focused"); | ||
}, {once: true}); | ||
}, | ||
}, | ||
}); | ||
await extension.startup(); | ||
|
||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE); | ||
let finish = extension.awaitFinish("focused"); | ||
await clickBrowserAction(extension); | ||
await finish; | ||
|
||
await closeBrowserAction(extension); | ||
|
||
await BrowserTestUtils.removeTab(tab); | ||
await extension.unload(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
run-if = buildapp == 'browser' | ||
|
||
[test_refresh_firefox.py] | ||
|
||
skip-if = (os == 'win' && !debug) #bug 1425323 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"use strict"; | ||
|
||
var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js"); | ||
|
||
function run_test() { | ||
return Task.spawn(function* () { | ||
do_test_pending(); | ||
|
||
DebuggerServer.registerModule("xpcshell-test/testactors"); | ||
DebuggerServer.init(() => true); | ||
|
||
let global = createTestGlobal("test"); | ||
DebuggerServer.addTestGlobal(global); | ||
|
||
let client = new DebuggerClient(DebuggerServer.connectPipe()); | ||
yield connect(client); | ||
|
||
let { tabs } = yield listTabs(client); | ||
let tab = findTab(tabs, "test"); | ||
let [, tabClient] = yield attachTab(client, tab); | ||
let [, threadClient] = yield attachThread(tabClient); | ||
yield resume(threadClient); | ||
|
||
let promise = waitForNewSource(threadClient, SOURCE_URL); | ||
loadSubScript(SOURCE_URL, global); | ||
let { source } = yield promise; | ||
let sourceClient = threadClient.source(source); | ||
|
||
let location = { line: 4, column: 2 }; | ||
let [packet, breakpointClient] = yield setBreakpoint( | ||
sourceClient, | ||
location | ||
); | ||
|
||
Assert.ok(!packet.isPending); | ||
Assert.equal(false, "actualLocation" in packet); | ||
|
||
packet = yield executeOnNextTickAndWaitForPause(function () { | ||
Cu.evalInSandbox("f()", global); | ||
}, client); | ||
|
||
Assert.equal(packet.type, "paused"); | ||
let why = packet.why; | ||
Assert.equal(why.type, "breakpoint"); | ||
Assert.equal(why.actors.length, 1); | ||
Assert.equal(why.actors[0], breakpointClient.actor); | ||
|
||
let frame = packet.frame; | ||
let where = frame.where; | ||
Assert.equal(where.source.actor, source.actor); | ||
Assert.equal(where.line, location.line); | ||
Assert.equal(where.column, 6); | ||
|
||
let variables = frame.environment.bindings.variables; | ||
Assert.equal(variables.a.value.type, "undefined"); | ||
Assert.equal(variables.b.value.type, "undefined"); | ||
Assert.equal(variables.c.value.type, "undefined"); | ||
|
||
yield resume(threadClient); | ||
yield close(client); | ||
|
||
do_test_finished(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.