Skip to content
Permalink
Browse files
2011-03-30 Pavel Podivilov <podivilov@chromium.org>
        Reviewed by Pavel Feldman.

        Web Inspector: add test for script formatter worker.
        https://bugs.webkit.org/show_bug.cgi?id=57447

        * inspector/debugger/script-formatter-expected.txt: Added.
        * inspector/debugger/script-formatter.html: Added.
        * platform/chromium/test_expectations.txt:
2011-03-30  Pavel Podivilov  <podivilov@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: add test for script formatter worker.
        https://bugs.webkit.org/show_bug.cgi?id=57447

        Test: inspector/debugger/script-formatter.html

        * GNUmakefile.am:
        * inspector/front-end/DebuggerPresentationModel.js:
        (WebInspector.DebuggerPresentationModel):
        (WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles):

Canonical link: https://commits.webkit.org/72825@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Pavel Podivilov committed Apr 6, 2011
1 parent f079b9e commit 72d8d0bd9e049a40a50dfc6ed9e594e96f806f89
Showing 7 changed files with 82 additions and 3 deletions.
@@ -1,3 +1,14 @@
2011-03-30 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: add test for script formatter worker.
https://bugs.webkit.org/show_bug.cgi?id=57447

* inspector/debugger/script-formatter-expected.txt: Added.
* inspector/debugger/script-formatter.html: Added.
* platform/chromium/test_expectations.txt:

2011-04-06 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Eric Seidel.
@@ -0,0 +1,5 @@
Tests the script formatting functionality.


Running: testScriptFormatterWorker

@@ -0,0 +1,41 @@
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>

<script>

var test = function()
{
InspectorTest.runTestSuite([
function testScriptFormatterWorker(next)
{
var worker = new Worker("ScriptFormatterWorker.js");

worker.onmessage = InspectorTest.safeWrap(function(event)
{
InspectorTest.assertEquals("var x = 0;", event.data.formattedSource);
InspectorTest.completeTest();
});

worker.onerror = function(event)
{
InspectorTest.addResult("Error in worker: " + event.data);
InspectorTest.completeTest();
};

worker.postMessage("var x=0");
}
]);
}

</script>

</head>

<body onload="runTest()">
<p>Tests the script formatting functionality.
</p>

</body>
</html>
@@ -161,6 +161,7 @@ WONTFIX SKIP : http/tests/workers = PASS TIMEOUT FAIL
WONTFIX SKIP : http/tests/xmlhttprequest/workers = PASS TIMEOUT FAIL
WONTFIX SKIP : http/tests/eventsource/workers = PASS TIMEOUT FAIL
WONTFIX SKIP : http/tests/websocket/tests/workers/ = PASS TIMEOUT FAIL
WONTFIX SKIP : inspector/debugger/script-formatter.html = PASS TIMEOUT FAIL

// Page Cache - based tests. Chromium disables page cache because the WebKit page cache keeps previously
// loaded pages alive in memory to be able to quickly substitute them when user clicks History buttons.
@@ -1,3 +1,17 @@
2011-03-30 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: add test for script formatter worker.
https://bugs.webkit.org/show_bug.cgi?id=57447

Test: inspector/debugger/script-formatter.html

* GNUmakefile.am:
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel):
(WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles):

2011-04-06 Martin Robinson <mrobinson@igalia.com>

Reviewed by Xan Lopez.
@@ -5315,6 +5315,7 @@ dist_webinspector_DATA = \
$(WebCore)/English.lproj/localizedStrings.js \
DerivedSources/WebCore/InspectorBackendStub.js \
$(shell ls $(WebCore)/inspector/front-end/*.js) \
$(shell ls $(WebCore)/inspector/front-end/UglifyJS/*.js) \
$(shell ls $(WebCore)/inspector/front-end/*.html) \
$(shell ls $(WebCore)/inspector/front-end/*.css)

@@ -5328,6 +5329,7 @@ dist_webinspectorimages_DATA = \
noinst_DATA = ${GENSOURCES_INSPECTOR}/inspector.html
${GENSOURCES_INSPECTOR}/inspector.html: $(WebCore)/inspector/front-end/*.html \
$(WebCore)/inspector/front-end/*.js \
$(WebCore)/inspector/front-end/UglifyJS/*.js \
$(WebCore)/inspector/front-end/*.css \
$(WebCore)/inspector/front-end/Images/* \
DerivedSources/WebCore/InspectorBackendStub.js \
@@ -105,7 +105,7 @@ WebInspector.DebuggerPresentationModel.prototype = {
if (!this._formatSourceFiles)
sourceFile = new WebInspector.SourceFile(sourceFileId, script, contentChanged.bind(this));
else
sourceFile = new WebInspector.FormattedSourceFile(sourceFileId, script, contentChanged.bind(this), this._formatter);
sourceFile = new WebInspector.FormattedSourceFile(sourceFileId, script, contentChanged.bind(this), this._formatter());
this._sourceFiles[sourceFileId] = sourceFile;
this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.SourceFileAdded, sourceFile);
},
@@ -185,8 +185,6 @@ WebInspector.DebuggerPresentationModel.prototype = {
toggleFormatSourceFiles: function()
{
this._formatSourceFiles = !this._formatSourceFiles;
if (this._formatSourceFiles && !this._formatter)
this._formatter = new WebInspector.ScriptFormatter();

var messages = this._messages;
this._sourceFiles = {};
@@ -206,6 +204,13 @@ WebInspector.DebuggerPresentationModel.prototype = {
this._debuggerPaused();
},

_formatter: function()
{
if (!this._scriptFormatter)
this._scriptFormatter = new WebInspector.ScriptFormatter();
return this._scriptFormatter;
},

addConsoleMessage: function(message)
{
this._messages.push(message);

0 comments on commit 72d8d0b

Please sign in to comment.