OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../debugger-test.js"></script> | 4 <script src="../debugger-test.js"></script> |
5 <script src="../isolated-filesystem-test.js"></script> | 5 <script src="../isolated-filesystem-test.js"></script> |
6 <script src="./persistence-test.js"></script> | 6 <script src="./persistence-test.js"></script> |
7 <script src="./resources/foo.js"></script> | 7 <script src="./resources/foo.js"></script> |
8 <script> | 8 <script> |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
| 12 var testMapping = InspectorTest.initializeTestMapping(); |
12 var fs = new InspectorTest.TestFileSystem("file:///var/www"); | 13 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
13 var fsEntry = InspectorTest.addFooJSFile(fs); | 14 var fsEntry = InspectorTest.addFooJSFile(fs); |
14 var networkSourceFrame, fileSystemSourceFrame; | 15 var networkSourceFrame, fileSystemSourceFrame; |
15 | 16 |
16 InspectorTest.runTestSuite([ | 17 InspectorTest.runTestSuite([ |
17 function addFileSystem(next) | 18 function addFileSystem(next) |
18 { | 19 { |
19 fs.reportCreated(next); | 20 fs.reportCreated(next); |
20 }, | 21 }, |
21 | 22 |
(...skipping 25 matching lines...) Expand all Loading... |
47 fileSystemSourceFrame.setSelection(new TextUtils.TextRange(1, 0,
2, 5)); | 48 fileSystemSourceFrame.setSelection(new TextUtils.TextRange(1, 0,
2, 5)); |
48 fileSystemSourceFrame.scrollToLine(1); | 49 fileSystemSourceFrame.scrollToLine(1); |
49 dumpSourceFrame(fileSystemSourceFrame); | 50 dumpSourceFrame(fileSystemSourceFrame); |
50 dumpEditorTabs(); | 51 dumpEditorTabs(); |
51 next(); | 52 next(); |
52 } | 53 } |
53 }, | 54 }, |
54 | 55 |
55 function addFileMapping(next) | 56 function addFileMapping(next) |
56 { | 57 { |
| 58 testMapping.addBinding("foo.js"); |
57 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); | 59 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
58 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http:
//127.0.0.1:8000", "/"); | |
59 | 60 |
60 function onBindingCreated() | 61 function onBindingCreated() |
61 { | 62 { |
62 dumpEditorTabs(); | 63 dumpEditorTabs(); |
63 dumpSourceFrame(fileSystemSourceFrame); | 64 dumpSourceFrame(fileSystemSourceFrame); |
64 next(); | 65 next(); |
65 } | 66 } |
66 }, | 67 }, |
67 | 68 |
68 function removeFileMapping(next) | 69 function removeFileMapping(next) |
69 { | 70 { |
70 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); | 71 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); |
71 Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); | 72 testMapping.removeBinding("foo.js") |
72 | 73 |
73 function onBindingRemoved(event) | 74 function onBindingRemoved(event) |
74 { | 75 { |
75 var binding = event.data; | 76 var binding = event.data; |
76 if (binding.network.name() !== "foo.js") | 77 if (binding.network.name() !== "foo.js") |
77 return | 78 return |
78 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); | 79 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); |
79 dumpEditorTabs(); | 80 dumpEditorTabs(); |
80 dumpSourceFrame(fileSystemSourceFrame); | 81 dumpSourceFrame(fileSystemSourceFrame); |
81 next(); | 82 next(); |
(...skipping 18 matching lines...) Expand all Loading... |
100 InspectorTest.addResult(" firstVisibleLine: " + sourceFrame.textEdito
r.firstVisibleLine()); | 101 InspectorTest.addResult(" firstVisibleLine: " + sourceFrame.textEdito
r.firstVisibleLine()); |
101 InspectorTest.addResult(" isDirty: " + sourceFrame.uiSourceCode().isD
irty()); | 102 InspectorTest.addResult(" isDirty: " + sourceFrame.uiSourceCode().isD
irty()); |
102 } | 103 } |
103 }; | 104 }; |
104 </script> | 105 </script> |
105 </head> | 106 </head> |
106 <body onload="runTest()"> | 107 <body onload="runTest()"> |
107 <p>Verify that tabs get merged when binding is added and removed.</p> | 108 <p>Verify that tabs get merged when binding is added and removed.</p> |
108 </body> | 109 </body> |
109 </html> | 110 </html> |
OLD | NEW |