Title: [226155] trunk/LayoutTests
- Revision
- 226155
- Author
- [email protected]
- Date
- 2017-12-19 16:06:43 -0800 (Tue, 19 Dec 2017)
Log Message
Web Inspector: add TestPage.debug() to inspect evaluations being sent to Inspector page
https://bugs.webkit.org/show_bug.cgi?id=181005
Reviewed by Joseph Pecoraro.
When TestPage.debug() is called, dump out all code that is sent to be evaluated in
the inspector page. This is useful for debugging initialization and InspectorTest.awaitEvent.
* http/tests/inspector/resources/inspector-test.js:
(runTest):
(TestPage.debug):
(TestPage.evaluateInWebInspector):
(TestPage.dispatchEventToFrontend):
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (226154 => 226155)
--- trunk/LayoutTests/ChangeLog 2017-12-20 00:03:55 UTC (rev 226154)
+++ trunk/LayoutTests/ChangeLog 2017-12-20 00:06:43 UTC (rev 226155)
@@ -1,3 +1,19 @@
+2017-12-19 Brian Burg <[email protected]>
+
+ Web Inspector: add TestPage.debug() to inspect evaluations being sent to Inspector page
+ https://bugs.webkit.org/show_bug.cgi?id=181005
+
+ Reviewed by Joseph Pecoraro.
+
+ When TestPage.debug() is called, dump out all code that is sent to be evaluated in
+ the inspector page. This is useful for debugging initialization and InspectorTest.awaitEvent.
+
+ * http/tests/inspector/resources/inspector-test.js:
+ (runTest):
+ (TestPage.debug):
+ (TestPage.evaluateInWebInspector):
+ (TestPage.dispatchEventToFrontend):
+
2017-12-19 Youenn Fablet <[email protected]>
Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/getregistrations.https.html is flaky
Modified: trunk/LayoutTests/http/tests/inspector/resources/inspector-test.js (226154 => 226155)
--- trunk/LayoutTests/http/tests/inspector/resources/inspector-test.js 2017-12-20 00:03:55 UTC (rev 226154)
+++ trunk/LayoutTests/http/tests/inspector/resources/inspector-test.js 2017-12-20 00:06:43 UTC (rev 226155)
@@ -97,8 +97,8 @@
let initializationCodeString = `(${runInitializationMethodsInFrontend.toString()})([${TestPage._initializers}]);`;
let testFunctionCodeString = `(${runTestMethodInFrontend.toString()})(${testFunction.toString()});`;
- testRunner.evaluateInWebInspector(initializationCodeString);
- testRunner.evaluateInWebInspector(testFunctionCodeString);
+ TestPage.evaluateInWebInspector(initializationCodeString);
+ TestPage.evaluateInWebInspector(testFunctionCodeString);
}
function runTestHTTPS()
@@ -139,6 +139,20 @@
window.alert(message);
}
+// Use this to dump evaluations that are sent from the TestPage to the InspectorTest page.
+TestPage.debug = function()
+{
+ this.dumpInspectorPageEvaluations = true;
+}
+
+TestPage.evaluateInWebInspector = function(code)
+{
+ if (this.dumpInspectorPageEvaluations)
+ this.debugLog(code);
+
+ testRunner.evaluateInWebInspector(code);
+}
+
// Add and clear test output from the results window.
TestPage.addResult = function(text)
{
@@ -162,7 +176,7 @@
TestPage.dispatchEventToFrontend = function(eventName, data)
{
let dispatchEventCodeString = `InspectorTest.dispatchEventToListeners(${JSON.stringify(eventName)}, ${JSON.stringify(data)});`;
- testRunner.evaluateInWebInspector(dispatchEventCodeString);
+ this.evaluateInWebInspector(dispatchEventCodeString);
};
TestPage.allowUncaughtExceptions = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes