This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt #1 at fixing Bug 617499 - Add an e10s test to verify behavior…
… of async messages sent by Firefox while the addon process is making a synchronous call
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/api-utils/tests/e10s-samples/bug-617499-e10s-adapter.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,17 @@ | ||
if (this.sendMessage) { | ||
// TODO: register receiver for async msg. | ||
registerReceiver("asyncy", function() { | ||
console.log("i am an async message from firefox"); | ||
}); | ||
exports.go = function() { | ||
console.log("about to send sync message to firefox"); | ||
callMessage("superpower"); | ||
console.log("returned from sync message to firefox"); | ||
}; | ||
} else { | ||
exports.register = function(process) { | ||
process.registerReceiver("superpower", function(name) { | ||
process.sendMessage("asyncy"); | ||
}); | ||
}; | ||
} |
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,4 @@ | ||
exports.main = function(options, callbacks) { | ||
require("e10s-samples/bug-617499").go(); | ||
callbacks.quit(); | ||
} |
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 @@ | ||
throw new Error("This code should never be loaded in the Firefox process!"); |
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