2011-04-07 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-07  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:
        * WebCore.xcodeproj/project.pbxproj:
        * gyp/streamline-inspector-source.sh:
        * inspector/front-end/DebuggerPresentationModel.js:
        (WebInspector.DebuggerPresentationModel.prototype._addScript):
        (WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles):
        (WebInspector.DebuggerPresentationModel.prototype._formatter):
        * inspector/front-end/ScriptFormatterWorker.js:
2011-04-07  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

        * WebKit.gyp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 051d41fb
2011-04-07 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-08 Kent Tamura <tkent@chromium.org>
[Chromium] Note some flaky tests.
Tests the script formatting functionality.
Running: testScriptFormatterWorker
<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.
......
2011-04-07 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:
* WebCore.xcodeproj/project.pbxproj:
* gyp/streamline-inspector-source.sh:
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype._addScript):
(WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles):
(WebInspector.DebuggerPresentationModel.prototype._formatter):
* inspector/front-end/ScriptFormatterWorker.js:
2011-04-08 Andrey Adaikin <aandrey@google.com>
Reviewed by Pavel Feldman.
......@@ -821,6 +821,10 @@ dist_webinspector_DATA = \
$(shell ls $(WebCore)/inspector/front-end/*.html) \
$(shell ls $(WebCore)/inspector/front-end/*.css)
webinspectoruglifyjsdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector/UglifyJS
dist_webinspectoruglifyjs_DATA = \
$(shell ls $(WebCore)/inspector/front-end/UglifyJS/*.js)
webinspectorimagesdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector/Images
dist_webinspectorimages_DATA = \
$(shell ls $(WebCore)/inspector/front-end/Images/*.gif) \
......@@ -831,12 +835,15 @@ 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 \
$(WebCore)/English.lproj/localizedStrings.js
$(AM_V_GEN)mkdir -p ${GENSOURCES_INSPECTOR}/UglifyJS
$(AM_V_GEN)mkdir -p ${GENSOURCES_INSPECTOR}/images
$(AM_V_at)cp ${dist_webinspector_DATA} ${GENSOURCES_INSPECTOR}
$(AM_V_at)cp ${dist_webinspectoruglifyjs_DATA} ${GENSOURCES_INSPECTOR}/UglifyJS
$(AM_V_at)cp ${dist_webinspectorimages_DATA} ${GENSOURCES_INSPECTOR}/images
webresourcesdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/images
......
......@@ -22999,7 +22999,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir ${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end/UglifyJS\" \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined scripts.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n cp \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\" scriptFormatterWorker.js\nfi\n";
shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir ${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined scripts.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n cp \"${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js\" scriptFormatterWorker.js\nfi\n";
};
1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = {
isa = PBXShellScriptBuildPhase;
......@@ -9,7 +9,7 @@ fi
"$SRCROOT/../inspector/combine-javascript-resources.pl" --input-html "${SRCROOT}/../inspector/front-end/inspector.html" --generated-scripts-dir ${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore --output-dir "${DERIVED_FILE_DIR}/WebCore" --output-script-name inspector.js
# Inline script imports in ScriptFormatterWorker.js file.
"$SRCROOT/../inspector/inline-javascript-imports.py" "${SRCROOT}/../inspector/front-end/ScriptFormatterWorker.js" "${SRCROOT}/../inspector/front-end/UglifyJS" "${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js"
"$SRCROOT/../inspector/inline-javascript-imports.py" "${SRCROOT}/../inspector/front-end/ScriptFormatterWorker.js" "${SRCROOT}/../inspector/front-end" "${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js"
if [ -d "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector" ]; then
# Remove any JavaScript files, since they will be replaced with the combined files.
......
......@@ -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._restoreBreakpoints(sourceFile);
......@@ -195,8 +195,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._reset();
......@@ -212,6 +210,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);
......
......@@ -70,9 +70,9 @@ function require()
}
var exports = {};
importScripts("parse-js.js");
importScripts("UglifyJS/parse-js.js");
var parse = exports;
var exports = {};
importScripts("process.js");
importScripts("UglifyJS/process.js");
var process = exports;
2011-04-07 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
* WebKit.gyp:
2011-04-08 Kent Tamura <tkent@chromium.org>
[Chromium] The second attempt of fixing for Windows (dbg)(shared) build.
......
......@@ -1189,7 +1189,7 @@
'<@(_script_name)',
'<@(webinspector_files)'
],
'search_path': '../../WebCore/inspector/front-end/UglifyJS',
'search_path': '../../WebCore/inspector/front-end',
'outputs': ['<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js'],
'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
}],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment