WebKit Bugzilla
Attachment 370674 Details for
Bug 196710
: Web Inspector: Audit: there should be a default test for WebInspectorAudit.Resources functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-196710-20190527002634.patch (text/plain), 34.47 KB, created by
Devin Rousso
on 2019-05-27 00:26:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-05-27 00:26:35 PDT
Size:
34.47 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index df5adc4cc725fa461b2ac8974f772558f11a5455..c3e698a8c0763a77df67a3abeccfa4a6a8d95832 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-27 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Audit: there should be a default test for WebInspectorAudit.Resources functionality >+ https://bugs.webkit.org/show_bug.cgi?id=196710 >+ <rdar://problem/49712348> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/protocol/Audit.json: >+ Increment Audit version. >+ > 2019-05-25 Tadeu Zagallo <tzagallo@apple.com> > > JITOperations getByVal should mark negative array indices as out-of-bounds >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 788d30a070f3617f9e68040cc0c4c435e933c316..8db1ddaac7a127d6e5bb6cdf99cce87e1423c35b 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,44 @@ >+2019-05-27 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Audit: there should be a default test for WebInspectorAudit.Resources functionality >+ https://bugs.webkit.org/show_bug.cgi?id=196710 >+ <rdar://problem/49712348> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Previously, there was no way to return data from Audit that wasn't a DOM node, a DOM >+ attribute (which wasn't "shown" anywhere, as it would highlight that attribute on any >+ returned DOM nodes), or an error string. >+ >+ In order for Audits to be more flexible with the types of things they test, there needs to >+ be a way for other types of data to be sent back and displayed in the Audit tab. >+ >+ This patch makes it so that an Audit result can now contain other keys/values that are all >+ expected to be JSON serializable. It will take all of the non-"special" (e.g. "domNodes" or >+ "errors") keys/values and display them as object trees. This way, any JSON serializable data >+ can be sent with the result and be displayed in the Audit tab. >+ >+ * UserInterface/Models/AuditTestBase.js: >+ (WI.AuditTestBase.prototype.async setup): >+ >+ * UserInterface/Models/AuditTestCase.js: >+ (WI.AuditTestCase.prototype.async run.async parseResponse): >+ (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty): >+ (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty.addErrorForValueType): >+ (WI.AuditTestCase.prototype.async run.async parseResponse.async resultArrayForEach): >+ (WI.AuditTestCase.prototype.async run.async parseResponse.inspectedPage_stringify_value): Added. >+ >+ * UserInterface/Models/AuditTestCaseResult.js: >+ (WI.AuditTestCaseResult.async fromPayload): >+ (WI.AuditTestCaseResult.async fromPayload.checkString): Added. >+ (WI.AuditTestCaseResult.async fromPayload.checkBoolean): Added. >+ (WI.AuditTestCaseResult.async fromPayload.checkArray): >+ >+ * UserInterface/Views/AuditTestCaseContentView.js: >+ (WI.AuditTestCaseContentView.prototype.layout): >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-05-24 Devin Rousso <drousso@apple.com> > > Web Inspector: Overlay: don't show setting for showing rulers/guides during element selection if it's not supported >diff --git a/Source/JavaScriptCore/inspector/protocol/Audit.json b/Source/JavaScriptCore/inspector/protocol/Audit.json >index 589d8cc8769191439ec38b6202b8bf7a3285840b..e41e2b8d617c593bd557b489049dcc47bba20935 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Audit.json >+++ b/Source/JavaScriptCore/inspector/protocol/Audit.json >@@ -1,7 +1,7 @@ > { > "domain": "Audit", > "description": "", >- "version": 2, >+ "version": 3, > "commands": [ > { > "name": "setup", >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 910b908329c6f94d9a18d8c449d6176fb7ce3e30..86baa004e55fdd28f272f6c6291b6cb513e3199b 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -1109,6 +1109,7 @@ localizedStrings["Unable to parse as JSON: %s"] = "Unable to parse as JSON: %s"; > localizedStrings["Unable to show certificate for \u201C%s\u201D"] = "Unable to show certificate for \u201C%s\u201D"; > localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions"; > localizedStrings["Undefined custom element"] = "Undefined custom element"; >+localizedStrings["Unexpected value \u0022%s\u0022 for key \u0022%s\u0022"] = "Unexpected value \u0022%s\u0022 for key \u0022%s\u0022"; > localizedStrings["Unique"] = "Unique"; > localizedStrings["Unknown Location"] = "Unknown Location"; > localizedStrings["Unknown error"] = "Unknown error"; >@@ -1170,10 +1171,12 @@ localizedStrings["XPath"] = "XPath"; > localizedStrings["Yes"] = "Yes"; > localizedStrings["Zoom:"] = "Zoom:"; > localizedStrings["\u0022%s\u0022 has a non-array \u0022%s\u0022 value"] = "\u0022%s\u0022 has a non-array \u0022%s\u0022 value"; >+localizedStrings["\u0022%s\u0022 has a non-boolean \u0022%s\u0022 value"] = "\u0022%s\u0022 has a non-boolean \u0022%s\u0022 value"; > localizedStrings["\u0022%s\u0022 has a non-number \u0022%s\u0022 value"] = "\u0022%s\u0022 has a non-number \u0022%s\u0022 value"; > localizedStrings["\u0022%s\u0022 has a non-object \u0022%s\u0022 value"] = "\u0022%s\u0022 has a non-object \u0022%s\u0022 value"; > localizedStrings["\u0022%s\u0022 has a non-string \u0022%s\u0022 value"] = "\u0022%s\u0022 has a non-string \u0022%s\u0022 value"; > localizedStrings["\u0022%s\u0022 has an invalid \u0022%s\u0022 value"] = "\u0022%s\u0022 has an invalid \u0022%s\u0022 value"; >+localizedStrings["\u0022%s\u0022 is not JSON serializable"] = "\u0022%s\u0022 is not JSON serializable"; > localizedStrings["\u0022%s\u0022 is not valid for %s"] = "\u0022%s\u0022 is not valid for %s"; > localizedStrings["\u0022%s\u0022 is too new to run in this Web Inspector"] = "\u0022%s\u0022 is too new to run in this Web Inspector"; > localizedStrings["\u0022%s\u0022 is too new to run on this inspected page"] = "\u0022%s\u0022 is too new to run on this inspected page"; >diff --git a/Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js b/Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js >index 2ad51105149a20897fe3019d6f7b0662089500f1..f594120f131962cb13e4ced9cc415d9f541ef906 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js >+++ b/Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js >@@ -116,7 +116,7 @@ WI.AuditTestBase = class AuditTestBase extends WI.Object > } else { > agentCommandFunction = RuntimeAgent.evaluate; > agentCommandArguments.expression = `(function() { "use strict"; return eval(\`(${this._setup.replace(/`/g, "\\`")})\`)(); })()`; >- agentCommandArguments.objectGroup = "audit"; >+ agentCommandArguments.objectGroup = AuditTestBase.ObjectGroup; > agentCommandArguments.doNotPauseOnExceptionsAndMuteConsole = true; > } > >@@ -228,7 +228,9 @@ WI.AuditTestBase = class AuditTestBase extends WI.Object > }; > > // Keep this in sync with Inspector::Protocol::Audit::VERSION. >-WI.AuditTestBase.Version = 2; >+WI.AuditTestBase.Version = 3; >+ >+WI.AuditTestBase.ObjectGroup = "audit"; > > WI.AuditTestBase.Event = { > Completed: "audit-test-base-completed", >diff --git a/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js b/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js >index 61b0883af1bcd9cfeb0f0300387b87959b501d1e..98b74cc1f0f04f766c6b9d608853b48686e4dc6f 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js >+++ b/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js >@@ -126,125 +126,170 @@ WI.AuditTestCase = class AuditTestCase extends WI.AuditTestBase > > async function parseResponse(response) { > let remoteObject = WI.RemoteObject.fromPayload(response.result, WI.mainTarget); >- if (response.wasThrown || (remoteObject.type === "object" && remoteObject.subtype === "error")) >+ if (response.wasThrown || (remoteObject.type === "object" && remoteObject.subtype === "error")) { > addError(remoteObject.description); >- else if (remoteObject.type === "boolean") >+ return; >+ } >+ >+ if (remoteObject.type === "boolean") { > setLevel(remoteObject.value ? WI.AuditTestCaseResult.Level.Pass : WI.AuditTestCaseResult.Level.Fail); >- else if (remoteObject.type === "string") >+ return; >+ } >+ >+ if (remoteObject.type === "string") { > setLevel(remoteObject.value.trim().toLowerCase()); >- else if (remoteObject.type === "object" && !remoteObject.subtype) { >- const options = { >- ownProperties: true, >- }; >+ return; >+ } > >- let properties = await new Promise((resolve, reject) => remoteObject.getPropertyDescriptorsAsObject(resolve, options)); >- >- function checkResultProperty(key, type, subtype) { >- if (!(key in properties)) >- return null; >- >- let property = properties[key].value; >- if (!property) >- return null; >- >- function addErrorForValueType(valueType) { >- let value = null; >- if (valueType === "object" || valueType === "array") >- value = WI.UIString("\u0022%s\u0022 must be an %s"); >- else >- value = WI.UIString("\u0022%s\u0022 must be a %s"); >- addError(value.format(key, valueType)); >- } >- >- if (property.subtype !== subtype) { >- addErrorForValueType(subtype); >- return null; >- } >- >- if (property.type !== type) { >- addErrorForValueType(type); >- return null; >- } >- >- if (type === "boolean" || type === "string") >- return property.value; >- >- return property; >- } >- >- async function resultArrayForEach(key, callback) { >- let array = checkResultProperty(key, "object", "array"); >- if (!array) >- return; >- >- // `getPropertyDescriptorsAsObject` returns an object, meaning that if we >- // want to iterate over `array` by index, we have to count. >- let asObject = await new Promise((resolve, reject) => array.getPropertyDescriptorsAsObject(resolve, options)); >- for (let i = 0; i < array.size; ++i) { >- if (i in asObject) >- await callback(asObject[i]); >- } >- } >- >- let levelString = checkResultProperty("level", "string"); >- if (levelString) >- setLevel(levelString.trim().toLowerCase()); >- >- if (checkResultProperty("pass", "boolean")) >- setLevel(WI.AuditTestCaseResult.Level.Pass); >- if (checkResultProperty("warn", "boolean")) >- setLevel(WI.AuditTestCaseResult.Level.Warn); >- if (checkResultProperty("fail", "boolean")) >- setLevel(WI.AuditTestCaseResult.Level.Fail); >- if (checkResultProperty("error", "boolean")) >- setLevel(WI.AuditTestCaseResult.Level.Error); >- if (checkResultProperty("unsupported", "boolean")) >- setLevel(WI.AuditTestCaseResult.Level.Unsupported); >- >- await resultArrayForEach("domNodes", async (item) => { >- if (!item || !item.value || item.value.type !== "object" || item.value.subtype !== "node") { >- addError(WI.UIString("All items in \u0022%s\u0022 must be valid DOM nodes").format(WI.unlocalizedString("domNodes"))); >- return; >- } >- >- let domNodeId = await new Promise((resolve, reject) => item.value.pushNodeToFrontend(resolve)); >- let domNode = WI.domManager.nodeForId(domNodeId); >- if (!domNode) >- return; >- >- if (!data.domNodes) >- data.domNodes = []; >- data.domNodes.push(WI.cssPath(domNode, {full: true})); >- >- if (!resolvedDOMNodes) >- resolvedDOMNodes = []; >- resolvedDOMNodes.push(domNode); >- }); >- >- await resultArrayForEach("domAttributes", (item) => { >- if (!item || !item.value || item.value.type !== "string" || !item.value.value.length) { >- addError(WI.UIString("All items in \u0022%s\u0022 must be non-empty strings").format(WI.unlocalizedString("domAttributes"))); >- return; >- } >- >- if (!data.domAttributes) >- data.domAttributes = []; >- data.domAttributes.push(item.value.value); >- }); >- >- await resultArrayForEach("errors", (item) => { >- if (!item || !item.value || item.value.type !== "object" || item.value.subtype !== "error") { >- addError(WI.UIString("All items in \u0022%s\u0022 must be error objects").format(WI.unlocalizedString("errors"))); >- return; >- } >- >- addError(item.value.description); >- }); >- >- if (window.InspectorTest && properties.__test) >- data.__test = properties.__test.value; >- } else >+ if (remoteObject.type !== "object" || remoteObject.subtype) { > addError(WI.UIString("Return value is not an object, string, or boolean")); >+ return; >+ } >+ >+ const options = { >+ ownProperties: true, >+ }; >+ >+ function checkResultProperty(key, value, type, subtype) { >+ function addErrorForValueType(valueType) { >+ let errorString = null; >+ if (valueType === "object" || valueType === "array") >+ errorString = WI.UIString("\u0022%s\u0022 must be an %s"); >+ else >+ errorString = WI.UIString("\u0022%s\u0022 must be a %s"); >+ addError(errorString.format(key, valueType)); >+ } >+ >+ if (value.subtype !== subtype) { >+ addErrorForValueType(subtype); >+ return null; >+ } >+ >+ if (value.type !== type) { >+ addErrorForValueType(type); >+ return null; >+ } >+ >+ if (type === "boolean" || type === "string") >+ return value.value; >+ >+ return value; >+ } >+ >+ async function resultArrayForEach(key, value, callback) { >+ let array = checkResultProperty(key, value, "object", "array"); >+ if (!array) >+ return; >+ >+ // `getPropertyDescriptorsAsObject` returns an object, meaning that if we >+ // want to iterate over `array` by index, we have to count. >+ let asObject = await new Promise((resolve, reject) => array.getPropertyDescriptorsAsObject(resolve, options)); >+ for (let i = 0; i < array.size; ++i) { >+ if (i in asObject) >+ await callback(asObject[i]); >+ } >+ } >+ >+ let properties = await new Promise((resolve, reject) => remoteObject.getPropertyDescriptorsAsObject(resolve, options)); >+ for (let key in properties) { >+ if (!(properties[key] instanceof WI.RemoteObject)) { >+ addError(WI.UIString("Unexpected value \u0022%s\u0022 for key \u0022%s\u0022").format(properties[key], key)); >+ continue; >+ } >+ >+ let value = properties[key].value; >+ >+ switch (key) { >+ case "level": { >+ let levelString = checkResultProperty(key, value, "string"); >+ if (levelString) >+ setLevel(levelString.trim().toLowerCase()); >+ break; >+ } >+ >+ case "pass": >+ if (checkResultProperty(key, value, "boolean")) >+ setLevel(WI.AuditTestCaseResult.Level.Pass); >+ break; >+ >+ case "warn": >+ if (checkResultProperty(key, value, "boolean")) >+ setLevel(WI.AuditTestCaseResult.Level.Warn); >+ break; >+ >+ case "fail": >+ if (checkResultProperty(key, value, "boolean")) >+ setLevel(WI.AuditTestCaseResult.Level.Fail); >+ break; >+ >+ case "error": >+ if (checkResultProperty(key, value, "boolean")) >+ setLevel(WI.AuditTestCaseResult.Level.Error); >+ break; >+ >+ case "unsupported": >+ if (checkResultProperty(key, value, "boolean")) >+ setLevel(WI.AuditTestCaseResult.Level.Unsupported); >+ break; >+ >+ case "domNodes": >+ await resultArrayForEach(key, value, async (item) => { >+ if (!item || !item.value || item.value.type !== "object" || item.value.subtype !== "node") { >+ addError(WI.UIString("All items in \u0022%s\u0022 must be valid DOM nodes").format(WI.unlocalizedString("domNodes"))); >+ return; >+ } >+ >+ let domNodeId = await new Promise((resolve, reject) => item.value.pushNodeToFrontend(resolve)); >+ let domNode = WI.domManager.nodeForId(domNodeId); >+ if (!domNode) >+ return; >+ >+ if (!data.domNodes) >+ data.domNodes = []; >+ data.domNodes.push(WI.cssPath(domNode, {full: true})); >+ >+ if (!resolvedDOMNodes) >+ resolvedDOMNodes = []; >+ resolvedDOMNodes.push(domNode); >+ }); >+ break; >+ >+ case "domAttributes": >+ await resultArrayForEach(key, value, (item) => { >+ if (!item || !item.value || item.value.type !== "string" || !item.value.value.length) { >+ addError(WI.UIString("All items in \u0022%s\u0022 must be non-empty strings").format(WI.unlocalizedString("domAttributes"))); >+ return; >+ } >+ >+ if (!data.domAttributes) >+ data.domAttributes = []; >+ data.domAttributes.push(item.value.value); >+ }); >+ break; >+ >+ case "errors": >+ await resultArrayForEach(key, value, (item) => { >+ if (!item || !item.value || item.value.type !== "object" || item.value.subtype !== "error") { >+ addError(WI.UIString("All items in \u0022%s\u0022 must be error objects").format(WI.unlocalizedString("errors"))); >+ return; >+ } >+ >+ addError(item.value.description); >+ }); >+ break; >+ >+ default: >+ try { >+ function inspectedPage_stringify_value(value) { >+ return JSON.stringify(value); >+ } >+ data[key] = JSON.parse(await value.callFunction(inspectedPage_stringify_value, [value])); >+ } catch (e) { >+ addError(WI.UIString("\u0022%s\u0022 is not JSON serializable").format(key)); >+ } >+ break; >+ } >+ } > } > > let agentCommandFunction = null; >@@ -255,7 +300,7 @@ WI.AuditTestCase = class AuditTestCase extends WI.AuditTestBase > } else { > agentCommandFunction = RuntimeAgent.evaluate; > agentCommandArguments.expression = `(function() { "use strict"; return eval(\`(${this._test.replace(/`/g, "\\`")})\`)(); })()`; >- agentCommandArguments.objectGroup = "audit"; >+ agentCommandArguments.objectGroup = WI.AuditTestCase.ObjectGroup; > agentCommandArguments.doNotPauseOnExceptionsAndMuteConsole = true; > } > >diff --git a/Source/WebInspectorUI/UserInterface/Models/AuditTestCaseResult.js b/Source/WebInspectorUI/UserInterface/Models/AuditTestCaseResult.js >index 47e7b0b32ff2063879eb88267d9f3adefaf995ef..aa09e301f3d35fc55b228bb966bfaea14d49622e 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/AuditTestCaseResult.js >+++ b/Source/WebInspectorUI/UserInterface/Models/AuditTestCaseResult.js >@@ -66,8 +66,36 @@ WI.AuditTestCaseResult = class AuditTestCaseResult extends WI.AuditTestResultBas > WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data"))); > payload.data = {}; > } else { >+ function checkString(key) { >+ if (!(key in payload.data)) >+ return; >+ >+ if (typeof payload.data[key] !== "string") { >+ WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data.%s").format(key))); >+ payload.data[key] = ""; >+ } >+ >+ payload.data[key] = String(payload.data[key]); >+ } >+ checkString("level"); >+ >+ function checkBoolean(key) { >+ if (!(key in payload.data)) >+ return; >+ >+ if (typeof payload.data[key] !== "boolean") >+ WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-boolean \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data.%s").format(key))); >+ >+ payload.data[key] = !!payload.data[key]; >+ } >+ checkBoolean("pass"); >+ checkBoolean("warn"); >+ checkBoolean("fail"); >+ checkBoolean("error"); >+ checkBoolean("unsupported"); >+ > function checkArray(key) { >- if (!payload.data[key]) >+ if (!(key in payload.data)) > return; > > if (!Array.isArray(payload.data[key])) { >diff --git a/Source/WebInspectorUI/UserInterface/Views/AuditTestCaseContentView.js b/Source/WebInspectorUI/UserInterface/Views/AuditTestCaseContentView.js >index d0d5df0706360ab0ef558d564a4498e6fe1f69c6..d6f10f05be75ee6638bab87e39bd87879ae32f15 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/AuditTestCaseContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/AuditTestCaseContentView.js >@@ -204,6 +204,15 @@ WI.AuditTestCaseContentView = class AuditTestCaseContentView extends WI.AuditTes > }); > } > >+ // TODO >+ for (let key of resultData) { >+ if (key === "domNodes" || key === "errors") >+ continue; >+ >+ this.contentView.element.append(JSON.stringify(resultData[key])); >+ } >+ // TODO >+ > if (resultData.errors && resultData.errors.length) { > let errorContainer = this.contentView.element.appendChild(document.createElement("div")); > errorContainer.classList.add("errors"); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 939ec2c512bb47ff62abdbb7d5b660f4c8538bdf..8e870705534885d40f04354f50a142a1ca60bfac 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-27 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Audit: there should be a default test for WebInspectorAudit.Resources functionality >+ https://bugs.webkit.org/show_bug.cgi?id=196710 >+ <rdar://problem/49712348> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/audit/manager-start-setup.html: >+ * inspector/audit/manager-start-setup-expected.txt: >+ * inspector/model/auditTestCase-expected.txt: >+ * inspector/model/auditTestGroup-expected.txt: >+ > 2019-05-25 Youenn Fablet <youenn@apple.com> > > media/video-remote-control-playpause.html is timing out after r245712 >diff --git a/LayoutTests/inspector/audit/manager-start-setup-expected.txt b/LayoutTests/inspector/audit/manager-start-setup-expected.txt >index 0e72cbd9cb0f09628d7bb18c9f327660590cccff..0df6dfd72adf97fc4a2e11b980f1e02240a8a26a 100644 >--- a/LayoutTests/inspector/audit/manager-start-setup-expected.txt >+++ b/LayoutTests/inspector/audit/manager-start-setup-expected.txt >@@ -3,18 +3,18 @@ Tests for the AuditManager.prototype.start functionality. > > == Running test suite: AuditManager.prototype.start > -- Running test case: AuditManager.prototype.start.SyncSetup >-PASS: The setup function should have set __test to 42. >+PASS: The setup function should have set test to 42. > > -- Running test case: AuditManager.prototype.start.AsyncSetup >-PASS: The setup function should have set __test to 42. >+PASS: The setup function should have set test to 42. > > -- Running test case: AuditManager.prototype.start.SubLevelSetup >-PASS: The setup function should have set __test to undefined. >+PASS: The setup function should have set test to undefined. > > -- Running test case: AuditManager.prototype.start.OverriddenSetup >-PASS: The setup function should have set __test to B. >+PASS: The setup function should have set test to B. > > -- Running test case: AuditManager.prototype.start.MultipleTopLevel >-PASS: The setup function should have set __test to A. >-PASS: The setup function should have set __test to B. >+PASS: The setup function should have set test to A. >+PASS: The setup function should have set test to B. > >diff --git a/LayoutTests/inspector/audit/manager-start-setup.html b/LayoutTests/inspector/audit/manager-start-setup.html >index 88c22d13e29df9385596c5d28bb99863ee123fc4..9ed1c3eaba290397097a05d63f71cd3d8005682b 100644 >--- a/LayoutTests/inspector/audit/manager-start-setup.html >+++ b/LayoutTests/inspector/audit/manager-start-setup.html >@@ -7,11 +7,11 @@ > function test() > { > const auditTestString = (function() { >- return { >- level: "pass", >- __test: WebInspectorAudit.__test, >- }; >- }).toString(); >+ return { >+ level: "pass", >+ test: WebInspectorAudit.test, >+ }; >+}).toString(); > > async function wrapTest(audit, expected, {getResultCallback} = {}) { > WI.auditManager._addTest(audit); >@@ -22,7 +22,7 @@ function test() > > InspectorTest.assert(result.didPass, "The test should pass."); > InspectorTest.assert(!result.data.errors, "There should be no errors."); >- InspectorTest.expectEqual(result.data.__test.value, expected, `The setup function should have set __test to ${expected}.`); >+ InspectorTest.expectEqual(result.data.test.value, expected, `The setup function should have set test to ${expected}.`); > > WI.auditManager.removeTest(audit); > } >@@ -34,7 +34,7 @@ function test() > description: "Check that the setup of an audit is actually run.", > async test() { > const setup = (function() { >- WebInspectorAudit.__test = 42; >+ WebInspectorAudit.test = 42; > }).toString(); > > let audit = new WI.AuditTestCase("AuditManager.prototype.start.SyncSetup", auditTestString, {setup}); >@@ -52,7 +52,7 @@ function test() > setTimeout(resolve, 10); > }); > >- WebInspectorAudit.__test = 42; >+ WebInspectorAudit.test = 42; > }).toString(); > > let audit = new WI.AuditTestCase("AuditManager.prototype.start.AsyncSetup", auditTestString, {setup}); >@@ -66,7 +66,7 @@ function test() > description: "Check that the setup of a non-top-level audit is not run.", > async test() { > const setup = (function() { >- WebInspectorAudit.__test = 42; >+ WebInspectorAudit.test = 42; > }).toString(); > > let audit = new WI.AuditTestGroup("AuditManager.prototype.start.SubLevelSetup.Group", [ >@@ -86,15 +86,15 @@ function test() > description: "Check that only the setup of top-level audits is run.", > async test() { > const setupA = (function() { >- if (!WebInspectorAudit.__test) >- WebInspectorAudit.__test = ""; >- WebInspectorAudit.__test += "A"; >+ if (!WebInspectorAudit.test) >+ WebInspectorAudit.test = ""; >+ WebInspectorAudit.test += "A"; > }).toString(); > > const setupB = (function() { >- if (!WebInspectorAudit.__test) >- WebInspectorAudit.__test = ""; >- WebInspectorAudit.__test += "B"; >+ if (!WebInspectorAudit.test) >+ WebInspectorAudit.test = ""; >+ WebInspectorAudit.test += "B"; > }).toString(); > > let audit = new WI.AuditTestGroup("AuditManager.prototype.start.OverriddenLevelSetup.Group", [ >@@ -114,9 +114,9 @@ function test() > description: "Test that a new WebInspectorAudit object is created for each setup call.", > async test() { > const setupA = (function() { >- if (!WebInspectorAudit.__test) >- WebInspectorAudit.__test = ""; >- WebInspectorAudit.__test += "A"; >+ if (!WebInspectorAudit.test) >+ WebInspectorAudit.test = ""; >+ WebInspectorAudit.test += "A"; > }).toString(); > > let auditA = new WI.AuditTestCase("AuditManager.prototype.start.MultipleTopLevel.A", auditTestString, {setup: setupA}); >@@ -124,9 +124,9 @@ function test() > await wrapTest(auditA, "A"); > > const setupB = (function() { >- if (!WebInspectorAudit.__test) >- WebInspectorAudit.__test = ""; >- WebInspectorAudit.__test += "B"; >+ if (!WebInspectorAudit.test) >+ WebInspectorAudit.test = ""; >+ WebInspectorAudit.test += "B"; > }).toString(); > > let auditB = new WI.AuditTestCase("AuditManager.prototype.start.MultipleTopLevel.B", auditTestString, {setup: setupB}); >diff --git a/LayoutTests/inspector/model/auditTestCase-expected.txt b/LayoutTests/inspector/model/auditTestCase-expected.txt >index 984ad20e601bc541bd9588a603eec61794369768..77f7494b315f1d53f0e1129f82527b2727a705f6 100644 >--- a/LayoutTests/inspector/model/auditTestCase-expected.txt >+++ b/LayoutTests/inspector/model/auditTestCase-expected.txt >@@ -28,7 +28,7 @@ WARN: Audit Warning: "validWithInvalidOptionals test name" is too new to run in > { > "type": "test-case", > "name": "validWithInvalidOptionals test name", >- "supports": 3, >+ "supports": 4, > "test": "validWithInvalidOptionals test function" > } > >@@ -37,7 +37,7 @@ WARN: Audit Warning: "validWithInvalidOptionals test name" is too new to run in > "type": "test-case", > "name": "validWithValidOptionals test name", > "description": "validWithValidOptionals test description", >- "supports": 1, >+ "supports": 2, > "setup": "validWithValidOptionals test setup", > "test": "validWithValidOptionals test function" > } >diff --git a/LayoutTests/inspector/model/auditTestGroup-expected.txt b/LayoutTests/inspector/model/auditTestGroup-expected.txt >index bebb554d2826e150570a98bf20b826508c70191f..141a4c04fa146c0354fc7bddaaa2a96a4bd7b097 100644 >--- a/LayoutTests/inspector/model/auditTestGroup-expected.txt >+++ b/LayoutTests/inspector/model/auditTestGroup-expected.txt >@@ -43,12 +43,12 @@ WARN: Audit Warning: "validWithInvalidOptionals group name" is too new to run in > { > "type": "test-group", > "name": "validWithInvalidOptionals group name", >- "supports": 3, >+ "supports": 4, > "tests": [ > { > "type": "test-case", > "name": "validWithInvalidOptionals test name", >- "supports": 4, >+ "supports": 5, > "test": "validWithInvalidOptionals test function" > } > ] >@@ -59,14 +59,14 @@ WARN: Audit Warning: "validWithInvalidOptionals group name" is too new to run in > "type": "test-group", > "name": "validWithValidOptionals group name", > "description": "validWithValidOptionals group description", >- "supports": 1, >+ "supports": 2, > "setup": "validWithValidOptionals group setup", > "tests": [ > { > "type": "test-case", > "name": "validWithValidOptionals test name", > "description": "validWithValidOptionals test description", >- "supports": 0, >+ "supports": 1, > "setup": "validWithValidOptionals test setup", > "test": "validWithValidOptionals test function" > } >@@ -78,21 +78,21 @@ WARN: Audit Warning: "validWithInvalidOptionals group name" is too new to run in > "type": "test-group", > "name": "validNested group name", > "description": "validNested group description", >- "supports": 1, >+ "supports": 2, > "setup": "validNested group setup", > "tests": [ > { > "type": "test-group", > "name": "validNested nested group name", > "description": "validNested nested group description", >- "supports": 0, >+ "supports": 1, > "setup": "validNested nested group setup", > "tests": [ > { > "type": "test-case", > "name": "validNested nested test name", > "description": "validNested nested test description", >- "supports": -1, >+ "supports": 0, > "setup": "validNested nested test setup", > "test": "validNested nested test function" > } >@@ -102,7 +102,7 @@ WARN: Audit Warning: "validWithInvalidOptionals group name" is too new to run in > "type": "test-case", > "name": "validNested test name", > "description": "validNested test description", >- "supports": -2, >+ "supports": -1, > "setup": "validNested test setup", > "test": "validNested test function" > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 196710
:
370671
|
370673
|
370674
|
370679
|
370680
|
370683
|
370688
|
370699
|
370702
|
370703
|
370704
|
370707
|
370948
|
370989