Title: [98343] trunk
Revision
98343
Author
podivi...@chromium.org
Date
2011-10-25 07:22:44 -0700 (Tue, 25 Oct 2011)

Log Message

Web Inspector: keep old source mapping when new one could not be loaded.
https://bugs.webkit.org/show_bug.cgi?id=70729

Reviewed by Yury Semikhatsky.

Source/WebCore:

* inspector/front-end/RawSourceCode.js:
(WebInspector.RawSourceCode.prototype._updateSourceMapping.didCreateSourceMapping):
(WebInspector.RawSourceCode.prototype._updateSourceMapping):
(WebInspector.RawSourceCode.prototype._createSourceMapping.didLoadSourceMapping):

LayoutTests:

* inspector/debugger/raw-source-code-expected.txt:
* inspector/debugger/raw-source-code.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98342 => 98343)


--- trunk/LayoutTests/ChangeLog	2011-10-25 14:04:45 UTC (rev 98342)
+++ trunk/LayoutTests/ChangeLog	2011-10-25 14:22:44 UTC (rev 98343)
@@ -1,3 +1,13 @@
+2011-10-24  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: keep old source mapping when new one could not be loaded.
+        https://bugs.webkit.org/show_bug.cgi?id=70729
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/debugger/raw-source-code-expected.txt:
+        * inspector/debugger/raw-source-code.html:
+
 2011-10-25  Sachin Puranik  <sachin.pura...@motorola.com>
 
         Double number step=.5 should be considered valid in <input type="number" step=".5">

Modified: trunk/LayoutTests/inspector/debugger/raw-source-code-expected.txt (98342 => 98343)


--- trunk/LayoutTests/inspector/debugger/raw-source-code-expected.txt	2011-10-25 14:04:45 UTC (rev 98342)
+++ trunk/LayoutTests/inspector/debugger/raw-source-code-expected.txt	2011-10-25 14:22:44 UTC (rev 98343)
@@ -15,3 +15,5 @@
 
 Running: testCompilerSourceMapping
 
+Running: testCompilerSourceMappingCouldNotBeLoaded
+

Modified: trunk/LayoutTests/inspector/debugger/raw-source-code.html (98342 => 98343)


--- trunk/LayoutTests/inspector/debugger/raw-source-code.html	2011-10-25 14:04:45 UTC (rev 98342)
+++ trunk/LayoutTests/inspector/debugger/raw-source-code.html	2011-10-25 14:22:44 UTC (rev 98343)
@@ -400,6 +400,25 @@
                 InspectorTest.assertEquals("<content of source2.js>", content);
                 next();
             }
+        },
+
+        function testCompilerSourceMappingCouldNotBeLoaded(next)
+        {
+            var compilerSourceMappingProviderMock = { loadSourceMapping: function(callback) { callback(null); } };
+
+            var script = createScriptMock("compiled.js", 0, 0, true, "<script source>");
+            var rawSourceCode = createRawSourceCode(script, null);
+            var uiSourceCodeList;
+
+            waitForSourceMappingEvent(rawSourceCode, checkMapping);
+            rawSourceCode.setCompilerSourceMappingProvider(compilerSourceMappingProviderMock);
+
+            function checkMapping()
+            {
+                InspectorTest.assertTrue(false, "Should not be reached.");
+            }
+
+            next();
         }
     ]);
 };

Modified: trunk/Source/WebCore/ChangeLog (98342 => 98343)


--- trunk/Source/WebCore/ChangeLog	2011-10-25 14:04:45 UTC (rev 98342)
+++ trunk/Source/WebCore/ChangeLog	2011-10-25 14:22:44 UTC (rev 98343)
@@ -1,3 +1,15 @@
+2011-10-24  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: keep old source mapping when new one could not be loaded.
+        https://bugs.webkit.org/show_bug.cgi?id=70729
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/RawSourceCode.js:
+        (WebInspector.RawSourceCode.prototype._updateSourceMapping.didCreateSourceMapping):
+        (WebInspector.RawSourceCode.prototype._updateSourceMapping):
+        (WebInspector.RawSourceCode.prototype._createSourceMapping.didLoadSourceMapping):
+
 2011-10-25  Sachin Puranik  <sachin.pura...@motorola.com>
 
         Double number step=.5 should be considered valid in <input type="number" step=".5">

Modified: trunk/Source/WebCore/inspector/front-end/RawSourceCode.js (98342 => 98343)


--- trunk/Source/WebCore/inspector/front-end/RawSourceCode.js	2011-10-25 14:04:45 UTC (rev 98342)
+++ trunk/Source/WebCore/inspector/front-end/RawSourceCode.js	2011-10-25 14:22:44 UTC (rev 98343)
@@ -159,6 +159,8 @@
         function didCreateSourceMapping(sourceMapping)
         {
             this._updatingSourceMapping = false;
+            if (!sourceMapping)
+                return;
             if (!this._updateNeeded)
                 this._saveSourceMapping(sourceMapping);
             else
@@ -187,6 +189,11 @@
              */
             function didLoadSourceMapping(compilerSourceMapping)
             {
+                if (!compilerSourceMapping) {
+                    delete this._compilerSourceMappingProvider;
+                    callback(null);
+                    return;
+                }
                 var uiSourceCodeList = [];
                 var sourceURLs = compilerSourceMapping.sources();
                 for (var i = 0; i < sourceURLs.length; ++i) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to