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.
Bug 1731790 - [cdp] Add blank implementation of Fetch.disable to prev…
…ent unknown method errors. r=webdriver-reviewers,jdescottes Differential Revision: https://phabricator.services.mozilla.com/D126317
- Loading branch information
Showing
7 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* 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"; | ||
|
||
var EXPORTED_SYMBOLS = ["Fetch"]; | ||
|
||
const { XPCOMUtils } = ChromeUtils.import( | ||
"resource://gre/modules/XPCOMUtils.jsm" | ||
); | ||
|
||
XPCOMUtils.defineLazyModuleGetters(this, { | ||
Domain: "chrome://remote/content/cdp/domains/Domain.jsm", | ||
}); | ||
|
||
// Note: For now this domain has only been added so that clients using CDP | ||
// (like Selenium) don't break when trying to disable Fetch events. | ||
|
||
class Fetch extends Domain { | ||
constructor(session) { | ||
super(session); | ||
|
||
this.enabled = false; | ||
} | ||
|
||
destructor() { | ||
this.disable(); | ||
|
||
super.destructor(); | ||
} | ||
|
||
disable() { | ||
if (!this.enabled) { | ||
return; | ||
} | ||
|
||
this.enabled = false; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[DEFAULT] | ||
tags = remote | ||
subsuite = remote | ||
skip-if = fission # Bug 1600054: Make cdp Fission compatible | ||
support-files = | ||
!/remote/cdp/test/browser/chrome-remote-interface.js | ||
!/remote/cdp/test/browser/head.js | ||
head.js | ||
|
||
[browser_disable.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,11 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
add_task(async function fetchDomainDisabled({ client }) { | ||
const { Fetch } = client; | ||
|
||
await Fetch.disable(); | ||
ok("Disabling Fetch domain successful"); | ||
}); |
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,11 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
/* import-globals-from ../head.js */ | ||
|
||
Services.scriptloader.loadSubScript( | ||
"chrome://mochitests/content/browser/remote/cdp/test/browser/head.js", | ||
this | ||
); |