X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=LayoutTests%2Finspector%2Fdebugger%2Fscripts-panel.html;h=c74b18492b349c693abd290b5fb0d3d2c1cdc69f;hb=b96e33af77ac7d81a666d5aa202235b793aeeb21;hp=ab5dc37f7aaf124974d0dcc910857d1912cd068f;hpb=2632619e54bc9f41ccea7c574710fe213e49212d;p=framework%2Fweb%2Fwebkit-efl.git diff --git a/LayoutTests/inspector/debugger/scripts-panel.html b/LayoutTests/inspector/debugger/scripts-panel.html index ab5dc37..c74b184 100755 --- a/LayoutTests/inspector/debugger/scripts-panel.html +++ b/LayoutTests/inspector/debugger/scripts-panel.html @@ -17,7 +17,7 @@ function test() model.canEditScriptSource = function() { return true; }; return model; } - function addUISouceCode(model, url) + function createUISouceCode(url) { var uiSourceCode = { url: url, @@ -29,7 +29,6 @@ function test() messages: [] }; uiSourceCode.__proto__ = WebInspector.Object.prototype; - model.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeAdded, uiSourceCode); return uiSourceCode; } @@ -50,10 +49,11 @@ function test() { var model = createDebuggerPresentationModelMock(); var panel = new WebInspector.ScriptsPanel(model); + panel.show(); - addUISouceCode(model, "foo.js"); - addUISouceCode(model, "bar.js"); - addUISouceCode(model, "baz.js"); + panel._uiSourceCodeAdded({ data: createUISouceCode("foo.js") }); + panel._uiSourceCodeAdded({ data: createUISouceCode("bar.js") }); + panel._uiSourceCodeAdded({ data: createUISouceCode("baz.js") }); InspectorTest.addResult("Dump files select:"); var select = panel._filesSelectElement; @@ -67,6 +67,7 @@ function test() // Select "baz.js". select.selectedIndex = 1; panel._filesSelectChanged(); + panel.detach(); next(); }, @@ -75,10 +76,11 @@ function test() { var model = createDebuggerPresentationModelMock(); var panel = new WebInspector.ScriptsPanel(model); + panel.show(); var files = ["index.html", "script1.js", "script2.js", "script3.js"]; for (var i = 0; i < files.length; ++i) - addUISouceCode(model, files[i]); + panel._uiSourceCodeAdded({ data: createUISouceCode(files[i]) }); function checkCurrentlySelectedFileName(fileName) { @@ -124,6 +126,7 @@ function test() panel.backButton.click(); checkCurrentlySelectedFileName("index.html"); + panel.detach(); next(); }, @@ -131,6 +134,7 @@ function test() { var model = createDebuggerPresentationModelMock(); var panel = new WebInspector.ScriptsPanel(model); + panel.show(); var rootURL = "http://localhost:8080/LayoutTests/inspector/debugger/"; var nextId = 0; @@ -157,6 +161,8 @@ function test() var tooltip = option.title.replace(rootURL, "/"); InspectorTest.addResult(text + (tooltip ? "(" + tooltip + ")" : "")); } + + panel.detach(); next(); }, @@ -164,11 +170,28 @@ function test() { var model = createDebuggerPresentationModelMock(); var panel = new WebInspector.ScriptsPanel(model); + panel.show(); + + panel._uiSourceCodeAdded({ data: createUISouceCode("foo.js") }); + var compiledSourceCode = createUISouceCode("compiled.js"); + panel._uiSourceCodeAdded({ data: compiledSourceCode }); + + InspectorTest.assertEquals(2, panel._filesSelectElement.length); + + // Plug compiler source mapping. + var source1SourceCode = createUISouceCode("source1.js"); + var source2SourceCode = createUISouceCode("source2.js"); + panel._uiSourceCodeReplaced({ data: { oldUISourceCodeList: [compiledSourceCode], uiSourceCodeList: [source1SourceCode, source2SourceCode] }}); + + InspectorTest.assertEquals(3, panel._filesSelectElement.length); + showSourceFrame(panel, "source2.js"); + showSourceFrame(panel, "source1.js"); + + // Unplug compiler source mapping. + panel._uiSourceCodeReplaced({ data: { oldUISourceCodeList: [source1SourceCode, source2SourceCode], uiSourceCodeList: [compiledSourceCode] }}); + InspectorTest.assertEquals(2, panel._filesSelectElement.length); - addUISouceCode(model, "foo.js"); - var uiSourceCode = addUISouceCode(model, "bar.js"); - panel._uiSourceCodeReplaced({ data: { oldUISourceCodeList: [uiSourceCode], uiSourceCodeList: [uiSourceCode] }}); - showSourceFrame(panel, "bar.js"); + panel.detach(); next(); } ]);