Skip to content

Commit

Permalink
Bug 1816664 Rename addSessionData/removeSessionData methods of RootMe…
Browse files Browse the repository at this point in the history
…ssageHandler to addSessionDataItem/removeSessionDataItem r=webdriver-reviewers,Sasha

Differential Revision: https://phabricator.services.mozilla.com/D172513
  • Loading branch information
frazie committed Mar 21, 2023
1 parent c385272 commit 9ac5475
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions remote/shared/messagehandler/RootMessageHandler.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class RootMessageHandler extends MessageHandler {
* RootMessageHandler and propagates the information via a command to existing
* MessageHandlers.
*/
addSessionData(sessionData = {}) {
addSessionDataItem(sessionData = {}) {
sessionData.method = lazy.SessionDataMethod.Add;
return this.updateSessionData([sessionData]);
}
Expand Down Expand Up @@ -136,7 +136,7 @@ export class RootMessageHandler extends MessageHandler {
* RootMessageHandler and propagates the information via a command to existing
* MessageHandlers.
*/
removeSessionData(sessionData = {}) {
removeSessionDataItem(sessionData = {}) {
sessionData.method = lazy.SessionDataMethod.Remove;
return this.updateSessionData([sessionData]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_task(async function test_windowGlobalHandlerCreated() {
);

info("Add a new session data item to get window global handlers created");
await rootMessageHandler.addSessionData({
await rootMessageHandler.addSessionDataItem({
moduleName: "command",
category: "browser_session_data_browser_element",
contextDescriptor: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ add_task(async function test_sessionDataRootOnlyModule() {
info("Test that adding SessionData items works the root module");
// Updating the session data on the root message handler should not cause
// failures for other message handlers if the module only exists for root.
await rootMessageHandler.addSessionData({
await rootMessageHandler.addSessionDataItem({
moduleName: "rootOnly",
category: "session_data_root_only",
contextDescriptor: {
Expand Down Expand Up @@ -222,7 +222,7 @@ add_task(async function test_sessionDataRootOnlyModule() {
);

info("Now test that removing items also works on the root module");
await rootMessageHandler.removeSessionData({
await rootMessageHandler.removeSessionDataItem({
moduleName: "rootOnly",
category: "session_data_root_only",
contextDescriptor: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_task(async function test_session_data_broadcast() {
root.on("message-handler-event", onRootEvent);

info("Add a new session data item, expect one return value");
await root.addSessionData({
await root.addSessionDataItem({
moduleName: "command",
category: "browser_session_data_browser_element",
contextDescriptor: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ add_task(async function() {
const root = createRootMessageHandler("session-id-event");

info("Add some session data for the command module");
await root.addSessionData({
await root.addSessionDataItem({
moduleName: "command",
category: "testCategory",
contextDescriptor: contextDescriptorAll,
Expand Down
4 changes: 2 additions & 2 deletions remote/webdriver-bidi/modules/root/script.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ScriptModule extends Module {

this.#preloadScriptMap.set(script, preloadScript);

await this.messageHandler.addSessionData({
await this.messageHandler.addSessionDataItem({
category: "preload-script",
moduleName: "script",
values: [
Expand Down Expand Up @@ -526,7 +526,7 @@ class ScriptModule extends Module {

const preloadScript = this.#preloadScriptMap.get(script);

await this.messageHandler.removeSessionData({
await this.messageHandler.removeSessionDataItem({
category: "preload-script",
moduleName: "script",
values: [
Expand Down

0 comments on commit 9ac5475

Please sign in to comment.