зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1441228 - Correct error returned for invalid input to capture.highlight_. r=whimboo
The WebDriver:TakeScreenshot command should return an invalid argument error when the input is malformed. MozReview-Commit-ID: HZFkq6QkWze --HG-- extra : rebase_source : c44f42938df1e818926f38a608f13c94a3f7e2fc
This commit is contained in:
Родитель
a55742105b
Коммит
bb83c96d6e
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {InvalidArgumentError} = ChromeUtils.import("chrome://marionette/content/error.js", {});
|
||||
|
||||
Cu.importGlobalProperties(["crypto"]);
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["capture"];
|
||||
|
@ -140,8 +142,8 @@ capture.canvas = function(win, left, top, width, height,
|
|||
};
|
||||
|
||||
capture.highlight_ = function(context, highlights, top = 0, left = 0) {
|
||||
if (!highlights) {
|
||||
throw new TypeError("Missing highlights");
|
||||
if (typeof highlights == "undefined") {
|
||||
throw new InvalidArgumentError("Missing highlights");
|
||||
}
|
||||
|
||||
context.lineWidth = "2";
|
||||
|
|
Загрузка…
Ссылка в новой задаче